Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

traceback shows wrong source code in basic REPL when PYTHONSTARTUP is set #137576

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@ilupin

Description

@ilupin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp