Skip to content

Commit

Permalink
to_posix in LocalStore
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamman committed Oct 23, 2024
1 parent e37b52f commit cdadb53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
python-version: ['3.11']
numpy-version: ['1.26']
numpy-version: ['2.1']
dependency-set: ["optional"]

steps:
Expand Down
10 changes: 5 additions & 5 deletions src/zarr/storage/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ async def exists(self, key: str) -> bool:

async def list(self) -> AsyncGenerator[str, None]:
# docstring inherited
to_strip = str(self.root) + "/"
to_strip = self.root.as_posix() + "/"
for p in list(self.root.rglob("*")):
if p.is_file():
yield str(p).replace(to_strip, "")
yield p.as_posix().replace(to_strip, "")

async def list_prefix(self, prefix: str) -> AsyncGenerator[str, None]:
# docstring inherited
to_strip = os.path.join(str(self.root / prefix))
to_strip = (self.root / prefix).as_posix() + "/" # TODO: fixme in 2430
for p in (self.root / prefix).rglob("*"):
if p.is_file():
yield str(p.relative_to(to_strip))
yield p.as_posix().replace(to_strip, "")

async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
# docstring inherited
Expand All @@ -239,6 +239,6 @@ async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
try:
key_iter = base.iterdir()
for key in key_iter:
yield str(key).replace(to_strip, "")
yield key.as_posix().replace(to_strip, "")
except (FileNotFoundError, NotADirectoryError):
pass

0 comments on commit cdadb53

Please sign in to comment.