Skip to content

Exit codes are lost in the REPL #125880

@jleedev

Description

@jleedev

Bug report

Bug description:

Python's new REPL seems to eat exit codes and instead return 1:

 ¶ python
Python 3.13.0 (main, Oct 19 2024, 04:14:02) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit(42)
👉      1
 ¶ PYTHON_BASIC_REPL=1 python
Python 3.13.0 (main, Oct 19 2024, 04:14:02) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit(42)
👉      42
 ¶ python -m _pyrepl
>>> exit(42)
👉      42

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixestopic-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