Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Closed
Description
Bug report
Bug description:
Start python with the basic repl and a PYTHONSTARTUP file
export PYTHON_BASIC_REPL=1;echo'import math'> /tmp/foo.py;export PYTHONSTARTUP="/tmp/foo.py"; python
type1/0 and the traceback shows
Python3.13.5|packagedbyAnaconda,Inc.| (main,Jun122025,16:09:02) [GCC11.2.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>1/0Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>importmath^^^ZeroDivisionError:divisionbyzero>>>
Expected behavior (i.e.export PYTHON_BASIC_REPL=1; unset PYTHONSTARTUP; python):
>>>1/0Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>1/0~^~ZeroDivisionError:divisionbyzero>>>
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-137576: Fix for Basic REPL Showing Incorrect Code in Tracebacks with PYTHONSTARTUP #137625
- [3.14] gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with
PYTHONSTARTUP(GH-137625) #137771 - [3.13] gh-137576: Fix for Basic REPL showing incorrect code in tracebacks with
PYTHONSTARTUP(GH-137625) #137778