filelock is a platform-independent file locking library for Python. It provides a way for Python programs to coordinate access to files and avoid conflicts when multiple processes need the same file.
Project status
- Actively maintained: The most recent upstream push was 2026-07-21, and multiple updates to
tox-dev/filelock(versions 3.32.0 down to 3.29.6) landed throughout 2026-07-16 to 2026-07-21, indicating active development rather than a maintenance-only period. - Apparent update cadence: Several releases within about a week (at least 3.29.6 on 07-06, then multiple updates 07-16 through 07-21), suggesting a fairly brisk cadence relative to today (2026-07-23).
AI summary generated
Recent updates
3.32.2
Release 3.32.2 focuses on stabilizing tests on NetBSD/GraalPy and improving correctness around lease heartbeat threads. The code changes strengthen async cancellation and heartbeat lifecycle handling to ensure locks and claims are handed back when heartbeat threads cannot start or are racing with release.
3.32.0
Release 3.32.0 primarily updates CI to run the test suite on Python 3.15 (including the free-threaded build) and adjusts packaging so tests can run from an unpacked sdist. The code diff also includes functional behavioral changes in lock shutdown and reader-scanning resource handling, which are not described in the release notes.
Features3.31.2
Release 3.31.2 includes a fix in the strict locking implementation to handle runtimes where the errno constant ENOTSUP is missing. The code changes not only adjust error-code handling, it also removes the direct import of ENOTSUP to avoid runtime import failures on such platforms.
3.31.1
Release 3.31.1 includes a functional fix around how SoftFileLease stores and refreshes its claim, plus additional internal coverage/reflection improvements. The main behavior change ensures the lease claim and heartbeat are scoped to the acquisition context so that a second thread cannot accidentally stop the first thread's heartbeat.
3.31.0
filelock 3.31.0 focuses on platform compatibility and correctness. It adds Termux/Android support and updates StrictSoftFileLock contention behavior by keeping the intent claim stable for the whole hold, preventing two processes from being treated as holders under heavy contention.
BreakingFeatures3.30.3
Release 3.30.3 focuses on documentation and UI polish, plus a targeted fix in the asyncio deadlock detection logic for AsyncFileLock and AsyncSoftFileLock. The asyncio change scopes the reentrant-deadlock registry to the owning asyncio task, addressing false-positive deadlock RuntimeErrors across tasks. The documentation updates improve table-of-contents behavior across font sizes and make Mermaid diagrams follow the active light/dark theme.
3.30.2
Release 3.30.2 focuses on correcting how file lock marker records are interpreted during stale lock recovery, and on clarifying strict lock lifetime behavior. The code changes ensure that markers using an unsupported mode are treated as belonging to a live owner so they are not evicted by age.
3.30.1
Version 3.30.1 includes fixes for strict locking behavior under NFSv3 stale filehandles, and for lease marker parsing when the stored lease duration is non-finite (nan/inf). It also adjusts the internal fork-reset protocol matching to align with how the method is provided on class objects.
3.30.0
filelock 3.30.0 introduces a major expansion of soft-lock capabilities, including strict soft locks and expiring leases, plus new API options for error-handling policies and hooks. The release also adds native descriptor locking utilities and significantly hardens async and SQLite related fork behavior. Overall, the change set is large (80 files) and includes new protocol-level marker formats and deeper internal refactors.
Features3.29.7
Release 3.29.7 focuses on improving deadlock detection for the asyncio-based locks and tightening marker and file writability handling. It updates the async lock acquisition flow to detect cross-instance reentrant deadlocks before entering the poll loop, and adjusts soft write-marker and util logic to avoid platform-specific stalls or incorrect acceptance.
Breaking3.29.6
This release focuses on concurrency and filesystem permission correctness. It serializes singleton lock construction to prevent a race, and it removes a dead mtime-based short circuit when checking whether a lock file is writable.
3.29.5
Release 3.29.5 focuses on making file lock acquisition and release more robust under concurrency, especially for the soft read/write lock implementation. It also tightens safety checks around symlinks and adds stricter validation for the lock lifetime setter, along with a change to how Unix lock files are handled after release.
Breaking3.29.4
Filelock 3.29.4 focuses on lock correctness on filesystems with coarse modification-time granularity and flaky heartbeat touch behavior. It verifies inode identity when breaking stale locks, and it prevents the read/write heartbeat thread from terminating on transient touch errors.
3.29.3
filelock 3.29.3 includes CI and release workflow adjustments, plus stricter parsing of lock holder PIDs to prevent invalid PIDs from being treated as alive. The code change centralizes PID parsing through _parse_lock_holder so malformed lock files are more consistently ignored and self-healed.