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 code in case of an error is always 1 since Python 3.13 #129900

Open
chrisbra opened this issue Feb 9, 2025 · 2 comments
Open

Exit code in case of an error is always 1 since Python 3.13 #129900

chrisbra opened this issue Feb 9, 2025 · 2 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@chrisbra
Copy link

chrisbra commented Feb 9, 2025

Bug report

Bug description:

We noticed a failure of our Vim test suite on the Github Windows runners, when it was updated from python3.12 to python3.13.

Vim basically does run in a terminal exit(123) and expects the return code to be 123, however, since python3.13 the return code seems to be 1.

Note this works find on the linux jobs, just on Windows this does not work correctly. Also note, python3 -c 'exit(123)' seems to work correctly, only when using an interactive session it doesn't seem to work right.

related:

exit(123)

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

@chrisbra chrisbra added the type-bug An unexpected behavior, bug, or error label Feb 9, 2025
@ZeroIntensity ZeroIntensity added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Feb 9, 2025
chrisbra added a commit to chrisbra/vim that referenced this issue Feb 9, 2025
…Windows

For some reasons, on Windows, python3.13 does no longer exit with the
expected return code. So let's check for either exit code 1 or 123 in
tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()

related: python/cpython#129900

Signed-off-by: Christian Brabandt <[email protected]>
@ZeroIntensity
Copy link
Member

ZeroIntensity commented Feb 9, 2025

I was able to reproduce this on Linux as well. Looking into it. (Note that this is specific to the REPL, this doesn't happen when running normal files.)

ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this issue Feb 9, 2025
chrisbra added a commit to chrisbra/vim that referenced this issue Feb 9, 2025
…Windows

For some reasons, on Windows, python3.13 does no longer exit with the
expected return code. So let's check for either exit code 1 or 123 in
tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()

related: python/cpython#129900

Signed-off-by: Christian Brabandt <[email protected]>
chrisbra added a commit to chrisbra/vim that referenced this issue Feb 9, 2025
…Windows

For some reasons, on Windows, python3.13 does no longer exit with the
expected return code. So let's check for either exit code 1 or 123 in
tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()

related: python/cpython#129900

Signed-off-by: Christian Brabandt <[email protected]>
chrisbra added a commit to vim/vim that referenced this issue Feb 9, 2025
…ndows

Problem:  tests: fix expected return code for python 3.13 on Windows
Solution: Check for return code 1 or 123 on Windows

There is a regression with python 3.13 on Windows, that it no longer
prints the requested error code, but instead exits with return code 1,
which  breaks the test-suite.

So let's check for either exit code 1 or 123 in tests
Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()

This will probably be fixed on the Python side, see the pull request
python/cpython#129901 but in the meantime, let's allow both error codes.

related: #16599
related: python/cpython#129900

Signed-off-by: Christian Brabandt <[email protected]>
@chrisbra
Copy link
Author

chrisbra commented Feb 9, 2025

Thanks. For now I have been working around it in the Vim test suite.

@picnixz picnixz changed the title exit() not working correctly on Windows Exit code in case of an error is always 1 since Python 3.13 Feb 10, 2025
@hugovk hugovk marked this as a duplicate of #129936 Feb 10, 2025
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 interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants