gh-137576: Fix for Basic REPL Showing Incorrect Code in Tracebacks with PYTHONSTARTUP#137625
gh-137576: Fix for Basic REPL Showing Incorrect Code in Tracebacks with PYTHONSTARTUP#137625Eclips4 merged 8 commits intopython:mainfrom
Conversation
|
My original patch here also caused the tracebacks to report the filename as |
Misc/NEWS.d/next/Core_and_Builtins/2025-08-10-21-34-12.gh-issue-137576.0ZicS-.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
@adqm I'm going to merge this tomorrow. |
|
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). |
…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. |
|
@adqm Could you please manually backport this to 3.13? Thanks in advance! |
|
GH-137778 is a backport of this pull request to the 3.13 branch. |
…cks with `PYTHONSTARTUP` (python#137625) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
…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 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: