From 22bf7200f03603f85e7ec8ff87804657083f2e53 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 15 Nov 2024 17:34:50 +0100 Subject: [PATCH] handle empty string prefix in zipstore delete dir --- src/zarr/storage/zip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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