-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Comprehension iteration variable overwrite a variable of the same name in the outer scope inside a function with try..except #108654
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
Labels
3.12
only security fixes
3.13
bugs and security fixes
release-blocker
type-bug
An unexpected behavior, bug, or error
Comments
cc @carljm |
carljm
added a commit
to carljm/cpython
that referenced
this issue
Aug 30, 2023
carljm
added a commit
to carljm/cpython
that referenced
this issue
Aug 30, 2023
carljm
added a commit
to carljm/cpython
that referenced
this issue
Aug 30, 2023
carljm
added a commit
that referenced
this issue
Aug 30, 2023
…08659) Co-authored-by: Dong-hee Na <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 30, 2023
…on (pythonGH-108659) (cherry picked from commit d52c448) Co-authored-by: Carl Meyer <[email protected]> Co-authored-by: Dong-hee Na <[email protected]>
Yhg1s
pushed a commit
that referenced
this issue
Aug 31, 2023
…ion (GH-108659) (#108700) gh-108654: restore comprehension locals before handling exception (GH-108659) (cherry picked from commit d52c448) Co-authored-by: Carl Meyer <[email protected]> Co-authored-by: Dong-hee Na <[email protected]>
This looks completed, but please reopen if not @carljm! |
I can confirm that it's fixed it 3.12.0rc2 🎉 |
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Sep 9, 2023
serhiy-storchaka
added a commit
that referenced
this issue
Sep 11, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 11, 2023
…109189) (cherry picked from commit c0f488b) Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.12
only security fixes
3.13
bugs and security fixes
release-blocker
type-bug
An unexpected behavior, bug, or error
Bug report
Checklist
and am confident this bug has not been reported before
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.12.0rc1 (main, Aug 29 2023, 19:34:25) [Clang 12.0.5 (clang-1205.0.22.9)]
A clear and concise description of the bug:
In the release notes for 3.12.0rc1 there is the following paragraph about comprehension inlining:
I found a case when a comprehension iteration variable overwrite a variable of the same name in the outer scope:
However, if you run this code outside of the function, isolation works:
Linked PRs
The text was updated successfully, but these errors were encountered: