Skip to content
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

Fixed lockfile check when using a Docker read-only filesystem #3832

Merged
merged 6 commits into from
Oct 26, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions package/MDAnalysis/coordinates/XDR.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ def _load_offsets(self):
try:
with fasteners.InterProcessLock(lock_name) as filelock:
pass
except PermissionError:
warnings.warn(f"Cannot write lock/offset file in same location as "
"{self.filename}. Using slow offset calculation.")
self._read_offsets(store=True)
return
except OSError as e:
if isinstance(e, PermissionError) or e.errno == errno.EROFS:
warnings.warn(f"Cannot write lock/offset file in same location as "
"{self.filename}. Using slow offset calculation.")
self._read_offsets(store=True)
return
jfennick marked this conversation as resolved.
Show resolved Hide resolved
else:
raise

with fasteners.InterProcessLock(lock_name) as filelock:
if not isfile(fname):
Expand Down