fix: initialize _lock attribute in ZipStore (#3588)#3761
Closed
abishop1990 wants to merge 1 commit intozarr-developers:mainfrom
Closed
fix: initialize _lock attribute in ZipStore (#3588)#3761abishop1990 wants to merge 1 commit intozarr-developers:mainfrom
abishop1990 wants to merge 1 commit intozarr-developers:mainfrom
Conversation
ZipStore._lock was initialized in _sync_open() but accessed by methods (get, set, exists, etc.) that can be called before the store is opened. This caused AttributeError: 'ZipStore' object has no attribute '_lock'. Move _lock initialization to __init__ so it is always available after instantiation, regardless of whether the store has been opened yet. Fixes zarr-developers#3588
Contributor
|
thanks @abishop1990, how does this compare to #3593? |
Contributor
Author
|
I see PR #3593 is already addressing this issue. Closing to avoid duplicate work and let the existing PR move forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3588.
ZipStore._lock was initialized in
_sync_open()but accessed by methods (get, set, exists, etc.) that can be called before the store is explicitly opened. This caused:Changes
self._lock = threading.RLock()from_sync_open()to__init__()test_lock_initialized_before_openTesting
_lockexists immediately after instantiation