From d6d747c4497307d60691f2a9dc8a8a3b4c06c8c8 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Wed, 3 Sep 2025 20:18:56 -0700 Subject: [PATCH] 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 --- src/zarr/storage/_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zarr/storage/_common.py b/src/zarr/storage/_common.py index 817bda7892..85014b9aad 100644 --- a/src/zarr/storage/_common.py +++ b/src/zarr/storage/_common.py @@ -349,7 +349,7 @@ async def make_store_path( elif isinstance(store_like, Path): # Create a new LocalStore - store = await LocalStore.open(root=store_like, mode=mode) + store = await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) elif isinstance(store_like, str): # Either a FSSpec URI or a local filesystem path