diff --git a/gcsfs/core.py b/gcsfs/core.py index da4d07dd..20bcda6d 100644 --- a/gcsfs/core.py +++ b/gcsfs/core.py @@ -564,10 +564,12 @@ def _filter_ghost_items(items): filtered_items = [] for item in items: - if item.get("kind", "") != "storage#object" \ - and item.get("size", "0") != "0" \ - and item.get("crc32c", "") != "AAAAAA==": - filtered_items.append(item) + if item.get("kind", "") == "storage#object" \ + and item.get("size", "") == "0" \ + and item.get("crc32c", "") == "AAAAAA==": + # This is a ghost item, skip it + continue + filtered_items.append(item) return filtered_items