-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-137576: Fix for Basic REPL Showing Incorrect Code in Tracebacks with PYTHONSTARTUP #137625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
My original patch here also caused the tracebacks to report the filename as |
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.
Thank you!
A couple of nits.
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). |
This patch attempts to fix #137576 by changing the way
interactive_filename
is 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 fromPYTHONSTARTUP
to be used instead of the interactive input when generating tracebacks).Updated behavior: