GeezerVison is showing github.com — gh-118934: Make PyEval_GetLocals return borrowed reference by gaogaotiantian · Pull Request #119769 · python/cpython
Conversation
gaogaotiantian
commented
May 30, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Per discussion with @markshannon in Pittsburgh, we simulate what we did pre-PEP667. We store the locals dict in frame->f_locals so that we can return a borrowed reference. The frame->f_locals will be cleared when the frame is released. This way we can keep the behavior of PyEval_GetLocals().
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Just realized this will overwrite f_locals when it's called inside a comprehension of a non-optimized scope. We might have to use a new member in FrameObject to store this.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
A few formatting suggestions and a question about the return value
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 3, 2024
|
@gaogaotiantian I merged the suggestion that reverts back to the Python 3.12 semantics, so we can get a CI run on that version of the refleak fix.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
@gaogaotiantian CI is happy with going back to the Python 3.12 behaviour, so if you're happy I think this is good to merge for the final beta.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x Fedora Clang Installed 3.13 has failed when building commit 233ed46.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#builders/1392/builds/214) and take a look at the build logs.
- Check if the failure is related to this commit (233ed46) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#builders/1392/builds/214
Failed tests:
Failed subtests:
- test_inspect_keeps_globals_from_inspected_file - test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file
- test_inspect_keeps_globals_from_inspected_module - test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module
Summary of the results of the build (if available):
==
Click to see traceback logs
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.clang-installed/build/target/lib/python3.13/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: FOO= not found in output
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.clang-installed/build/target/lib/python3.13/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __name__= not found in output
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.clang-installed/build/target/lib/python3.13/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __package__= not found in output
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x Fedora LTO + PGO 3.13 has failed when building commit 233ed46.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#builders/1511/builds/215) and take a look at the build logs.
- Check if the failure is related to this commit (233ed46) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#builders/1511/builds/215
Failed tests:
Failed subtests:
- test_inspect_keeps_globals_from_inspected_module - test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module
Summary of the results of the build (if available):
==
Click to see traceback logs
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.lto-pgo/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __package__= not found in output
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.lto-pgo/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __file__= not found in output
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.13.edelsohn-fedora-z.lto-pgo/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
self.fail(f"{var}= not found in output")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: FOO= not found in output
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
ncoghlan
ncoghlan approved these changes
markshannon
Awaiting requested review from markshannon
markshannon is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|