Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.3k
gh-146355: Fixmain_module ref leak in_PyRun_SimpleStringFlagsWithName#146356
Open
A0su wants to merge 1 commit intopython:mainfrom
Open
gh-146355: Fixmain_module ref leak in_PyRun_SimpleStringFlagsWithName#146356A0su wants to merge 1 commit intopython:mainfrom
main_module ref leak in_PyRun_SimpleStringFlagsWithName#146356A0su wants to merge 1 commit intopython:mainfrom
Conversation
…PyRun_SimpleFileObject
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
python-cla-botbot commentedMar 24, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
gh-146355: Fix
main_moduleref leak in_PyRun_SimpleStringFlagsWithNameThis is a sub-issue for#146102 and original gist details can be foundhere
When
the_nameis NULL we'll fail to callPy_DECREFonmain_module. I used the same goto pattern as_PyRun_SimpleFileObjectto fix this.I omitted a new test entry as we have indirect coverage of functionality in
test_embed.py. Not sure if it makes sense for the scope of fixing the ref leak to include the additional code for a test in test_run.py (which has a TODO for this function).