-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-130070: Fix exec(<string>, closure=<non-None>)
unexpected path
#130071
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
Conversation
exec(<string>, closure=<non-None>)
segfaultexec(<string>, closure=<non-None>)
segfault
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.
Before:
» ./python.exe
Python 3.14.0a5+ (heads/main:625470a7d2c, Feb 13 2025, 10:38:58) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exec("", closure=object())
Assertion failed: (!PyErr_Occurred()), function _PyAST_Validate, file ast.c, line 1047.
[1] 91990 abort ./python.exe
After: all tests pass.
Do we need to backport this?
Misc/NEWS.d/next/Core_and_Builtins/2025-02-13-05-09-31.gh-issue-130070.C8c9gK.rst
Outdated
Show resolved
Hide resolved
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.
LGTM.
Co-authored-by: sobolevn <mail@sobolevn.me>
NVM, this issue seems to be specific to my debug build: #130070 (comment). |
exec(<string>, closure=<non-None>)
segfaultexec(<string>, closure=<non-None>)
unexpected path
Sorry, I'm still new to C 😅 This isn't a segfault, it's a fix for failed assertion. The program was stopped by the |
Misc/NEWS.d/next/Core_and_Builtins/2025-02-13-05-09-31.gh-issue-130070.C8c9gK.rst
Outdated
Show resolved
Hide resolved
I'd also change the branch name, but that would close the PR as a side effect |
I don't think that's needed, the branch name is usually not relevant :) |
I think we can backport this. |
Does it also crash on 3.12 and 3.13? If yes, let's backport it |
Reproduced on 3.12 and 3.13. ❯ python -VV && python -c 'exec("", closure=object())'
Python 3.12.9+ (heads/3.12:0931693f95b, Feb 18 2025, 16:24:22) [GCC 11.4.0]
python: Python/ast.c:1044: _PyAST_Validate: Assertion `!PyErr_Occurred()' failed.
Aborted ❯ python -VV && python -c 'exec("", closure=object())'
Python 3.13.2+ (heads/3.13:57e8b0cbee1, Feb 18 2025, 16:30:24) [GCC 11.4.0]
python: Python/ast.c:1049: _PyAST_Validate: Assertion `!PyErr_Occurred()' failed.
Aborted Let's backport! 🚀 |
Sorry, @bswck and @Eclips4, I could not cleanly backport this to
|
@bswck Would you mind creating a manual backport for 3.13? :) |
Yes, sure! |
…path (python#130071) Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled) for `exec` when the `source` argument is a string and the `closure` argument is not `None`. Co-authored-by: sobolevn <mail@sobolevn.me> (cherry picked from commit 954b2cf)
…path (python#130071) Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled) for `exec` when the `source` argument is a string and the `closure` argument is not `None`. Co-authored-by: sobolevn <mail@sobolevn.me> (cherry picked from commit 954b2cf)
…path (python#130071) Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled) for `exec` when the `source` argument is a string and the `closure` argument is not `None`. Co-authored-by: sobolevn <mail@sobolevn.me> (cherry picked from commit 954b2cf)
GH-132627 is a backport of this pull request to the 3.13 branch. |
… path (GH-130071) (#132627) gh-130070: Fix `exec(<string>, closure=<non-None>)` unexpected path (#130071) Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled) for `exec` when the `source` argument is a string and the `closure` argument is not `None`. Co-authored-by: sobolevn <mail@sobolevn.me> (cherry picked from commit 954b2cf)
Closes gh-130070