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
AttributeError: 'ZipStore' object has no attribute '_lock' #3588
Calling the exists method on a ZipStore instance for an existing ZIP file raises the exception AttributeError: 'ZipStore' object has no attribute '_lock'. It seems this is because the method is not protected by a block
ifnotself._is_open:
self._sync_open()
as seen elsewhere in the code. If this was simply an omission it should be an easy fix, I can open a PR if you want.
Thanks a lot for the great library!
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 issuesfromzarr.storageimportZipStorefromzipfileimportZipFileimportasyncioZipFile("/tmp/tmp.zip", "w").close()
asyncdefmain():
withZipStore("/tmp/tmp.zip", mode="r") asstore:
returnawaitstore.exists("somekey")
asyncio.run(main())
Activity
d-v-b commentedon Nov 20, 2025
sorry about this, and a PR fixing it would be great
oelhammouchi commentedon Nov 21, 2025
@d-v-b see #3593
fix: initialize _lock attribute in ZipStore (zarr-developers#3588)
fix(storage): add _is_open guard in ZipStore.exists to prevent Attrib…
fix(storage): open ZipStore archive on first use from every method an…
d-v-b commentedon Oct 27, 2026
closed by #4450