Skip to content

Commit d6d747c

Browse files
committed
Pass read_only into LocalStore.open()
Currently, `read_only` is not passed in `open()`, which means the default value of `read_only=False` is confusingly used instead. This mostly just surprisng, but also has minor performance implications because `read_only=False` means Zarr attempts to create directories on this line (which is a no-op because `exist_ok=True`): https://github.com/zarr-developers/zarr-python/blob/e738e2fb88dbead26a853d9982ff46eab64f313f/src/zarr/storage/_local.py#L167-L169
1 parent 6c04c82 commit d6d747c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/zarr/storage/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ async def make_store_path(
349349

350350
elif isinstance(store_like, Path):
351351
# Create a new LocalStore
352-
store = await LocalStore.open(root=store_like, mode=mode)
352+
store = await LocalStore.open(root=store_like, mode=mode, read_only=_read_only)
353353

354354
elif isinstance(store_like, str):
355355
# Either a FSSpec URI or a local filesystem path

0 commit comments

Comments
 (0)