Skip to content

Commit

Permalink
Use removeprefix rather than replace to avoid separator deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
moradology committed Jan 30, 2025
1 parent fc08f31 commit 22c3a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zarr/storage/_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ async def set_partial_values(
async def list(self) -> AsyncIterator[str]:
# docstring inherited
allfiles = await self.fs._find(self.path, detail=False, withdirs=False)
for onefile in (a.replace(self.path + "/", "") for a in allfiles):
for onefile in (a.removeprefix(self.path + "/") for a in allfiles):
yield onefile

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

0 comments on commit 22c3a69

Please sign in to comment.