You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read-write locks become None instead of raising when part of filelock fails to load #879
If part of filelock itself fails to load, the read-write lock classes silently become None instead of raising an error. filelock sets them to None on purpose when Python has no SQLite support, but the check cannot tell that case apart from a missing piece of filelock. The program then crashes later, at the first use of the lock, with an error that does not mention filelock.
This happens in frozen apps. Since 4.2, filelock loads the read-write lock code by name on first use, so freezers such as Nuitka and PyInstaller leave that code out unless told to include it.
Expected
An import error that names the missing filelock module
Actual
ReadWriteLock is None, then an unrelated TypeError where the program uses it
Suggested fix
Set the classes to None only when the missing module is SQLite, and raise every other import error:
changed the title [-]ReadWriteLock is None when its own module fails to import, not only without sqlite3[/-][+]Read-write locks become None instead of raising when part of filelock fails to load[/+]on Oct 25, 2026
Activity
[-]ReadWriteLock is None when its own module fails to import, not only without sqlite3[/-][+]Read-write locks become None instead of raising when part of filelock fails to load[/+]Take filelock 4.2.9 (#1246)