-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
silx.io.h5py_utils: Fixed support of libhdf5 v1.14.4 #4177
Conversation
2fdc9e3
to
1ca125f
Compare
if locking is None and mode == "r" and not swmr: | ||
locking = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the main change: keep None
or set to False
if not locking: | ||
if locking is None and mode == "r" and not swmr: | ||
locking = False | ||
if locking in (False, "false"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to accomodate all possible values of h5py.File's locking
:
locking – The file locking behavior. One of:
False (or “false”) – Disable file locking
True (or “true”) – Enable file locking
”best-effort” – Enable file locking but ignore some errors
None – Use HDF5 defaults
I left the former way to disable locking with HDF5_USE_FILE_LCOKING
env. var. as it is, so it only supports True
, False
, None
.
Checklist:
<Module or Topic>: <Action> <Summary>
(see contributing guidelines)This PR keeps
locking=None
instead of forcing it toTrue
when checking if it can disable it so that it uses libhdf5 default locking mode (eitherbest-effort
- the default - orTrue
- which can be set as default at compile time...).libhdf5 v1.14.4 (that comes in h5py v3.12.1 wheel) fixed an issue with retrieving the file locking information from opened files in order to fix the opening of external links (that was not respecting the file locking).
It seems that beforehand, the compatibility of the ignore locking errors (the difference between
locking=True
andlocking="best-effort"
) was not tested when opening already opened files while it is tested now.See https://github.com/HDFGroup/hdf5/blob/57948148dbcb275c9a39212eebc62e071b11a00d/release_docs/RELEASE.txt#L917-L940
It also adds typing on the modified functions.