Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit codes are lost in the REPL #125880

Open
jleedev opened this issue Oct 23, 2024 · 1 comment
Open

Exit codes are lost in the REPL #125880

jleedev opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@jleedev
Copy link

jleedev commented Oct 23, 2024

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

@jleedev jleedev added the type-bug An unexpected behavior, bug, or error label Oct 23, 2024
@JelleZijlstra JelleZijlstra added the topic-repl Related to the interactive shell label Oct 23, 2024
@Eclips4
Copy link
Member

Eclips4 commented Oct 23, 2024

Hello!
Thanks for the report.
Confirmed on current main as well.
3.12 behavior:

admin@Admins-MacBook-Air ~/p/cpython (main)> python3.12
Python 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit(128)
admin@Admins-MacBook-Air ~/p/cpython (main) [128]>

@Eclips4 Eclips4 added 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Oct 23, 2024
@Eclips4 Eclips4 self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants