diff --git a/src/zarr/storage/zip.py b/src/zarr/storage/zip.py index 755588fb7a..a186b3cf59 100644 --- a/src/zarr/storage/zip.py +++ b/src/zarr/storage/zip.py @@ -215,7 +215,7 @@ async def set_if_not_exists(self, key: str, value: Buffer) -> None: async def delete_dir(self, prefix: str) -> None: # only raise NotImplementedError if any keys are found self._check_writable() - if not prefix.endswith("/"): + if prefix != "" and not prefix.endswith("/"): prefix += "/" async for _ in self.list_prefix(prefix): raise NotImplementedError