Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-137288: Fix bug where boolean expressions are not associated with the correct exception handler#137310

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 7 commits intopython:mainfromiritkatriel:gh-137288
Aug 5, 2025

Conversation

@iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedAug 1, 2025
edited by bedevere-appbot
Loading

@iritkatrieliritkatriel added type-bugAn unexpected behavior, bug, or error interpreter-core(Objects, Python, Grammar, and Parser dirs) 3.14bugs and security fixes labelsAug 1, 2025
@picnixzpicnixz added needs backport to 3.14bugs and security fixes and removed 3.14bugs and security fixes labelsAug 1, 2025
@encukou
Copy link
Member

This looks reasonable to me but I don't know this code enough to review it.

However, the fix will require bumping the PYC magic number in 3.14.0rc2 :( Heads up,@hugovk

@markshannon
Copy link
Member

The code changes look good to me.

I think this needs a separate pyc magic number bump for the backport.
On main: 3654 -> 3655, and for 3.14: 3624 -> 3625.

@iritkatrieliritkatriel merged commit1f2026b intopython:mainAug 5, 2025
41 checks passed
@miss-islington-app
Copy link

Thanks@iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@iritkatriel, I could not cleanly backport this to3.14 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 1f2026b8a239b3169c0cad0157eb08358152b4c1 3.14

iritkatriel added a commit to iritkatriel/cpython that referenced this pull requestAug 5, 2025
…ociated with the correct exception handler (pythonGH-137310).(cherry picked from commit1f2026b)Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@bedevere-app
Copy link

GH-137427 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelAug 5, 2025
@rgommers
Copy link
Contributor

However, the fix will require bumping the PYC magic number in 3.14.0rc2 :( Heads up,@hugovk

I was pointed at this PR with a message saying "a fix for 3.14.0rc2 may require telling projects that already cut a release to redo that". On closer inspection, that doesn't seem to be the case. The ABI doesn't change here, and packages on PyPI shouldn't contain.pyc code (unless some bad legacy build config in a package explicitly includes.pyc code in wheels). And at install time,.pyc files with an older bytecode magic number should be ignored and be regenerated. So there is no serious impact here, right?

iritkatriel and efimov-mikhail reacted with thumbs up emoji

@encukou
Copy link
Member

I know that Fedora builds .pycs, installs them as root so users can't update them, and the more locked-down settings generate security alerts when users attempt to overwrite system files.
Not sure how other redistributors are affected, but I assume this is close to the worst case.

hroncok and rgommers reacted with thumbs up emoji

@rgommers
Copy link
Contributor

Ah of course, distros and other deployment methods that install with root/elevated privileges, thanks@encukou. A bit of digging turns up#73700, which seems like it wasn't much fun for affected redistributors.

There hopefully won't be many distros that distribute packages before the final 3.14.0 release; I believe Fedora is fairly exceptional in doing that. Same for sysadmins installing on multi-user systems, that should be rare pre-3.14.0-final.

hugovk pushed a commit that referenced this pull requestAug 12, 2025
…d with the correct exception handler (GH-137310). (#137427)Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>Co-authored-by: Petr Viktorin <encukou@gmail.com>
hroncok pushed a commit to fedora-python/cpython that referenced this pull requestAug 12, 2025
…ociated with the correct exception handler (pythonGH-137310). (python#137427)Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>Co-authored-by: Petr Viktorin <encukou@gmail.com>
@hugovk
Copy link
Member

FYI We'll do an early rc2 with this and add an rc3 next month:

Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull requestAug 19, 2025
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull requestSep 9, 2025
…ociated with the correct exception handler (pythonGH-137310). (python#137427)Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>Co-authored-by: Petr Viktorin <encukou@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees

No one assigned

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Python implicit boolean conversion in logical operations bypasses try/except on 3.14.0rc1

6 participants

@iritkatriel@encukou@markshannon@rgommers@hugovk@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp