github tox-dev/filelock 4.3.3

2 hours ago

Bug fixes

  • An async lock acquired in a task that has since finished, such as with asyncio.run(lock.acquire()), is released again when the lock is garbage collected while held. Self-deadlock detection kept a strong reference to that task, whose result references the lock, so the lock was never finalized and stayed held until the process exited (#1150) by @vinilpolepalli.
  • On POSIX, if an exhausted disk quota prevents SoftFileLock from removing a failed marker, cleanup tries to leave a one-byte record, as it already does for a full filesystem. On filesystems with atomic exchange, a later caller can reclaim it once space is available (#1147) by @darrenhuai and @gaborbernat.
  • Singleton locks and SoftFileLease singletons accept the same bound method passed again as on_acquired or on_compromise, instead of treating each attribute access as a different callback. A built-in bound method, such as records.append, still has to be the same saved object (#1139) by @feiiiiii5, @gaborbernat and @LemonCondor.

Security

  • On Unix, when creating the lock file is denied, FileLock no longer follows a symlink at the lock path to decide whether the file exists. Another account that swaps one in can no longer learn from how acquire() fails whether the symlink's target exists for the locking account. Such a symlink now fails with ELOOP whatever it points to (#1144) by @gaborbernat.

Performance

  • Importing filelock no longer slows every audited call in the process, such as id(): the fork-safety audit hook is installed on first lock use instead of at import (#1152) by @gaborbernat.

New Contributors

🐍 PyPI release

📜 Full Changelog

Don't miss a new filelock release

NewReleases is sending notifications on new releases.