-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-126606: don't write incomplete pyc files #126627
gh-126606: don't write incomplete pyc files #126627
Conversation
Misc/NEWS.d/next/Core_and_Builtins/2024-11-09-16-10-22.gh-issue-126066.9zs4m4.rst
Outdated
Show resolved
Hide resolved
…e-126066.9zs4m4.rst Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some stylistic comments on the test and a question of what the best exception is.
When you're done making the requested changes, leave the comment: |
- use swap_attr instead of mock - nicer comments - remove magic constant
I have made the requested changes; please review again. |
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
Everything LGTM at this point (I just went ahead and tweaked a comment)! Once CI passes I will merge and hope the backports all succeed. 🤞 |
Thanks @cfbolz for the PR, and @brettcannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
(cherry picked from commit c695e37) Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Brett Cannon <brett@python.org>
GH-126809 is a backport of this pull request to the 3.13 branch. |
(cherry picked from commit c695e37) Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Brett Cannon <brett@python.org>
GH-126810 is a backport of this pull request to the 3.12 branch. |
fix corner case in importlib: so far, the code does not check the return value of
_io.FileIO.write
to see whether a pyc code was fully written to disk. If a ulimit is in place (or the disk is full or something), this could lead to truncated pyc files. After the fix, the written size is checked and the half-written file is removed.