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
{{ message }}
Repository navigation
Using r+ mode with zarr.open creates an empty directory #3295
Opening a non-existent location via zarr.open with r+ mode (see 'steps to reproduce') creates an empty directory at that location. Given the description in the zarr.open docstring: 'r+ means read/write (must exist)', I would expect no files to be changed before the GroupNotFoundError is thrown.
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 issuesimportzarr# creates the new directory data/images/test_r_plus.zarr, then throws GroupNotFoundErrorzarr_object=zarr.open(store="data/images/test_r_plus.zarr", mode="r+")
# Using mode r, doesn't create a new directory before it throw GroupNotFoundErrorzarr_object=zarr.open(store="data/images/test_r.zarr", mode="r")
Activity
K-Meech commentedon Jul 28, 2025
The issue seems to be inside
make_store_pathinsrc/zarr/storage/_common.py:_read_onlyis only set formode == 'r'await LocalStore.open(root=Path(store_like), read_only=_read_only)(where__read_onlyis False forr+mode)LocalStoreinsrc/zarr/storage/_local.py- a new directory is made by_openin every case where_read_only = False