Repository navigation
π fix(api): treat Windows drive letter case as one lock path - #929
Merged
gaborbernat merged 2 commits intoNov 17, 2026
Merged
Conversation
gaborbernat
force-pushed
the
fix/windows-drive-lock-identity
branch
from
November 16, 2026 21:26
399fb9b to
69176eb
Compare
gaborbernat
force-pushed
the
fix/windows-drive-lock-identity
branch
from
November 16, 2026 22:04
69176eb to
f63bc66
Compare
The concepts page said every spelling difference splits a lock, which the drive-prefix fold made untrue on Windows. Name the exception, reword the changelog entry for users, and pass a plain cancel_check in the deadlock test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows,
C:\work.lockandc:\work.lockname the same file, but filelock treated them as two locks. Withis_singleton=Trueeach spelling got its own instance, so code sharing one lock by path held two independent ones. With or without singletons, a same-thread acquire through the other spelling waited forever instead of raising theRuntimeErrorthat reports a deadlock. πͺ Both spellings now share one singleton and trip the deadlock check.Every place that keys a lock by path now ignores the case of the drive letter or the UNC
\\server\shareprefix: theFileLockandSoftReadWriteLocksingleton caches and the same-thread deadlock registry. The rest of the path keeps its case, because Windows directories can opt into case-sensitive names, soC:\Work.lockandC:\work.lockremain two locks as the docs already advise. Each lock still opens and reports the path it was created with. On POSIX the drive prefix is always empty, so nothing changes there. The SQLite-backedReadWriteLockalready compared whole Windows paths without regard to case and is unchanged.