diff --git a/src/zarr/storage/_zip.py b/src/zarr/storage/_zip.py index e52f160860..e5e59bcc03 100644 --- a/src/zarr/storage/_zip.py +++ b/src/zarr/storage/_zip.py @@ -90,6 +90,18 @@ def __init__( self.compression = compression self.allowZip64 = allowZip64 + def with_read_only(self, read_only: bool = False) -> ZipStore: + # docstring inherited + store = type(self)( + path=self.path, + mode='r', + read_only=read_only, + compression=self.compression, + allowZip64=self.allowZip64, + ) + store._sync_open() + return store + def _sync_open(self) -> None: if self._is_open: raise ValueError("store is already open")