gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure#141931
Merged
gpshead merged 9 commits intopython:mainfrom Nov 27, 2025
Merged
gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure#141931gpshead merged 9 commits intopython:mainfrom
gpshead merged 9 commits intopython:mainfrom
Conversation
brettcannon
reviewed
Nov 25, 2025
Interruption by a system call or something is not completely unexpected. Retry the write with the remaining data.
4d74676 to
914caf1
Compare
Contributor
Author
|
Squashed in that suggestion to avoid the CLA bot. |
cmaloney
reviewed
Nov 26, 2025
cee386f to
c8ba03f
Compare
vstinner
reviewed
Nov 27, 2025
vstinner
reviewed
Nov 27, 2025
Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-21-09-30.gh-issue-141930.hIIzSd.rst
Outdated
Show resolved
Hide resolved
gpshead
approved these changes
Nov 27, 2025
Member
gpshead
left a comment
There was a problem hiding this comment.
I reworded the news and title because "retry" and "retried" imply the wrong thing. The important thing is that the write will be "complete" so that's the word I put in NEWS or we'll get the actual underlying error.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Nov 27, 2025
…etter error message on failure (pythonGH-141931) * Use open() to write the bytecode * Convert to unittest style asserts * Tweak news, thanks @vstinner * Tidy * reword NEWS, avoid word "retried" (cherry picked from commit 656a64b) Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
|
Sorry, @stefanor and @gpshead, I could not cleanly backport this to |
|
GH-142021 is a backport of this pull request to the 3.14 branch. |
|
GH-142023 is a backport of this pull request to the 3.13 branch. |
hugovk
pushed a commit
that referenced
this pull request
Dec 1, 2025
StanFromIreland
pushed a commit
to StanFromIreland/cpython
that referenced
this pull request
Dec 6, 2025
…etter error message on failure (pythonGH-141931) * Use open() to write the bytecode * Convert to unittest style asserts * Tweak news, thanks @vstinner * Tidy * reword NEWS, avoid word "retried"
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.
Writes are not guaranteed to complete by the operating system. Use the normal file object to do the necessary retries and raise appropriate errors, if we fail to completely write a
.pycfile in one syscall..pycif unable to completely write a.pycfile in one go #141930