gh-139289: Lazy import rlcompleter to fix the refleak#139305
Merged
gaogaotiantian merged 6 commits intopython:mainfrom Sep 26, 2025
Merged
gh-139289: Lazy import rlcompleter to fix the refleak#139305gaogaotiantian merged 6 commits intopython:mainfrom
gaogaotiantian merged 6 commits intopython:mainfrom
Conversation
Member
Author
|
Hey @encukou , as this fixes the broken buildbot, should we try to expedite it? |
Member
Author
|
Maybe @iritkatriel can help with the review as you are familiar with the background? The original code has no problem with its own but the existing issue of |
iritkatriel
approved these changes
Sep 26, 2025
|
Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Sorry, @gaogaotiantian, I could not cleanly backport this to |
|
GH-139357 is a backport of this pull request to the 3.13 branch. |
gaogaotiantian
added a commit
that referenced
this pull request
Sep 26, 2025
encukou
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 9, 2025
encukou
pushed a commit
that referenced
this pull request
Oct 10, 2025
… subprocess (GH-139185) (GH-139305) (GH-139280) * gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (GH-139185) (cherry picked from commit c8624cd) * gh-139289: Lazy import rlcompleter to fix the refleak (GH-139305) (cherry picked from commit 8288f36) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
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 free
to 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.
We made the
rlcompleterimport even lazier. It will now only be imported when being used. We also need to customize the import procedure to avoid having side effects of changing the completer. However, theatexitcallback will still be added.This is not the final solution, but it can fix the refleak while not exposing the original problem again. We should polish it after we fix the
import rlcompleterside effect for good.atexitmodule breaks refleak check #139289