Skip to content

Commit 22c3a69

Browse files
committed
Use removeprefix rather than replace to avoid separator deletion
1 parent fc08f31 commit 22c3a69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/zarr/storage/_fsspec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ async def set_partial_values(
341341
async def list(self) -> AsyncIterator[str]:
342342
# docstring inherited
343343
allfiles = await self.fs._find(self.path, detail=False, withdirs=False)
344-
for onefile in (a.replace(self.path + "/", "") for a in allfiles):
344+
for onefile in (a.removeprefix(self.path + "/") for a in allfiles):
345345
yield onefile
346346

347347
async def list_dir(self, prefix: str) -> AsyncIterator[str]:

0 commit comments

Comments
 (0)