Skip to content

Commit e050f7a

Browse files
committed
also check for read_only if store is a StorePath
1 parent 264baa3 commit e050f7a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/zarr/api/asynchronous.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
4242
from zarr.core.metadata.v2 import _default_compressor, _default_filters
4343
from zarr.errors import GroupNotFoundError, NodeTypeValidationError
44+
from zarr.storage import StorePath
4445
from zarr.storage._common import make_store_path
4546

4647
if TYPE_CHECKING:
@@ -327,7 +328,7 @@ async def open(
327328
"""
328329
zarr_format = _handle_zarr_version_or_format(zarr_version=zarr_version, zarr_format=zarr_format)
329330
if mode is None:
330-
if isinstance(store, Store) and store.read_only:
331+
if isinstance(store, (Store, StorePath)) and store.read_only:
331332
mode = "r"
332333
else:
333334
mode = "a"

0 commit comments

Comments
 (0)