Repository navigation
Conversation
A failed open of the temporary file named the destination. A failed write or flush named it as well, and a failed rename named only that destination. Python names the temporary file, no file, or both files. The message follows Python.
A failed open of .lock named the state root, and so did a failed pid write. Python names .lock, .lock.posix, the directory, or no file. The acquisition snapshots that text before a later close.
State-root preflight failures now populate osFailure. Lock-file errors carry their full joined paths, while non-operating-system lock refusals leave osFailure empty.
Recursive directory creation now carries the path passed to the system call that failed. Atomic writes and state locks use that ancestor in their OSError diagnostics.
Lock acquisition starts with a clean errno before synthesizing a short-write failure. Atomic replacement cleanup no longer probes a temporary path after that path has been renamed away.
Every allocation failure while formatting an OSError now keeps that system error and uses the static fallback message. Atomic-write callers deinitialize diagnostics after any failure.
RootLock.release ignored a failed flock(LOCK_UN), so the caller exited successfully. The Python reference raises the operating-system error after it closes both descriptors. The release now does the same and returns the error after closing them.
HaoZeke
force-pushed
the
fix/oserror-paths-lock-makedirs
branch
from
November 20, 2026 19:45
cad791d to
6939a09
Compare
Contributor
Author
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.
Four zig-common fixes that make failed filesystem calls report the file
Python names.
The stack names the file a failed replacement reports, names the
directory a failed makedirs reports, records which lock call failed so a
caller can name the right file, and returns an unlock error from the
state-root lock instead of dropping it. Each commit has one fragment and
its own test.
Draft: this branch also carries the five consumer lineup helper commits it is stacked on, which are not in main yet.