You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the latest main branch, zarr.group raises a FileNotFoundError when creating a new group - see example code below.
Error:
File "C:\Users\kimme\Documents\Repos\forked\zarr-python\src\zarr\storage\_common.py", line 361, in make_store_path
store = await LocalStore.open(root=store_like, mode=mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kimme\Documents\Repos\forked\zarr-python\src\zarr\storage\_local.py", line 142, in open
await store._open()
File "C:\Users\kimme\Documents\Repos\forked\zarr-python\src\zarr\storage\_local.py", line 154, in _open
raise FileNotFoundError(f"{self.root} does not exist")
FileNotFoundError: data\example.zarr does not exist
Steps to reproduce
# /// script# requires-python = ">=3.11"# dependencies = [# "zarr@git+https://github.com/zarr-developers/zarr-python.git@main",# ]# ///## This script automatically imports the development branch of zarr to check for issuesimportzarrroot=zarr.group('data/example.zarr')
😬 thanks for uncovering this, and it's not great that we don't test for it!
My PR seems to have uncovered an issue in how groups are created; I believe this is the fix, but I don't have time to write a test that fails before the change at the moment, so others please feel free to open a PR with the fix and a test!
diff --git a/src/zarr/api/asynchronous.py b/src/zarr/api/asynchronous.py
index fdbd3b34..55249236 100644
--- a/src/zarr/api/asynchronous.py+++ b/src/zarr/api/asynchronous.py@@ -677,7 +677,7 @@ async def group(
if overwrite:
mode = "w"
else:
- mode = "r+"+ mode = "w-"
store_path = await make_store_path(store, path=path, mode=mode, storage_options=storage_options)
if chunk_store is not None:
@dstansby I posted a PR with your proposed change, and some tests, here: #3426. Unfortunately, fixing this particular bug triggers test failures elsewhere in the codebase. Store permissions really is the gift that keeps on giving.
Activity
d-v-b commentedon Aug 26, 2025
can you test this with 3.1.1? I wonder if somehow this slipped in via #3307
K-Meech commentedon Aug 26, 2025
I tried with
3.1.1and there is no error raised there.dstansby commentedon Aug 26, 2025
😬 thanks for uncovering this, and it's not great that we don't test for it!
My PR seems to have uncovered an issue in how groups are created; I believe this is the fix, but I don't have time to write a test that fails before the change at the moment, so others please feel free to open a PR with the fix and a test!
Exclude Zarr 3.1.2 due to zarr-developers/zarr-python#3406
Exclude Zarr 3.1.2 due to zarr-developers/zarr-python#3406 (#787)
d-v-b commentedon Sep 2, 2025
@dstansby I posted a PR with your proposed change, and some tests, here: #3426. Unfortunately, fixing this particular bug triggers test failures elsewhere in the codebase. Store permissions really is the gift that keeps on giving.