Skip to content

Commit cdadb53

Browse files
committed
to_posix in LocalStore
1 parent e37b52f commit cdadb53

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/hypothesis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
python-version: ['3.11']
29-
numpy-version: ['1.26']
29+
numpy-version: ['2.1']
3030
dependency-set: ["optional"]
3131

3232
steps:

src/zarr/storage/local.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,17 @@ async def exists(self, key: str) -> bool:
219219

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

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

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

0 commit comments

Comments
 (0)