{{ message }}
gh-137576: Fix for Basic REPL Showing Incorrect Code in Tracebacks with PYTHONSTARTUP#137625
Merged
Conversation
Contributor
Author
Eclips4
approved these changes
Aug 11, 2025
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Member
|
@adqm I'm going to merge this tomorrow. |
Contributor
Author
|
Great, thanks!! I just tested; the bug is indeed present on current 3.13 and 3.14 branches. These patches apply cleanly to 3.14 as of right now but not to 3.13 (though I'm happy to make the necessary changes there). |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Aug 14, 2025
…cks with `PYTHONSTARTUP` (pythonGH-137625) (cherry picked from commit 04f8ef6) Co-authored-by: adam j hartz <hz@mit.edu> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
Sorry, @adqm and @Eclips4, I could not cleanly backport this to |
|
GH-137771 is a backport of this pull request to the 3.14 branch. |
Member
|
@adqm Could you please manually backport this to 3.13? Thanks in advance! |
Member
|
GH-137778 is a backport of this pull request to the 3.13 branch. |
Contributor
Author
Eclips4
added a commit
that referenced
this pull request
Aug 15, 2025
Agent-Hellboy
pushed a commit
to Agent-Hellboy/cpython
that referenced
this pull request
Aug 19, 2025
…cks with `PYTHONSTARTUP` (python#137625) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
hugovk
pushed a commit
that referenced
this pull request
Aug 27, 2025
kumaraditya303
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Sep 9, 2025
…tracebacks with `PYTHONSTARTUP` (pythonGH-137625) (python#137771) Co-authored-by: adam j hartz <hz@mit.edu> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
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.

This patch attempts to fix #137576 by changing the way
interactive_filenameis computed for the basic REPL to make sure that it always begins with<and ends with>so that doesn't get an entry inlinecache.cache(which was causing the source fromPYTHONSTARTUPto be used instead of the interactive input when generating tracebacks).Updated behavior: