# Bug report ### Bug description: 1. Create a Python file `./startup.py`: ```py # Python startup file LINE 1 # Python startup file LINE 2 ``` 2. Run `PYTHONSTARTUP=./startup.py PYTHON_BASIC_REPL=1 python3` 3. Run ```pycon >>> undefined ``` Expected output: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> undefined NameError: name 'undefined' is not defined ``` Actual output: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> # Python startup file LINE 1 NameError: name 'undefined' is not defined ``` 4. Run ```pycon >>> while True: ... undefined ``` Expected output: ``` Traceback (most recent call last): File "<stdin>", line 2, in <module> undefined NameError: name 'undefined' is not defined ``` Actual output: ``` Traceback (most recent call last): File "<stdin>", line 2, in <module> # Python startup file LINE 2 NameError: name 'undefined' is not defined ``` 5. Run ```pycon >>> while True: ... pass ... undefined ``` Here, the output is correct and as expected: ``` Traceback (most recent call last): File "<stdin>", line 3, in <module> undefined NameError: name 'undefined' is not defined ``` ### CPython versions tested on: 3.13 ### Operating systems tested on: Linux