-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Open
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
type 1/0
and the traceback shows
Python 3.13.5 | packaged by Anaconda, Inc. | (main, Jun 12 2025, 16:09:02) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1/0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
import math
^^^
ZeroDivisionError: division by zero
>>>
Expected behavior (i.e. export PYTHON_BASIC_REPL=1; unset PYTHONSTARTUP; python
):
>>> 1/0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
1/0
~^~
ZeroDivisionError: division by zero
>>>
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error