Closed as duplicate of#129900
Closed as duplicate of#129900
Description
Bug report
Bug description:
Passing any non-zero integer to sys.exit()
causes Python to exit with exit code 1, regardless of the actual value of passed integer. This is inconsistent with the online documentation description, which does not describe or imply this behavior:
The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. If it is an integer, zero is considered “successful termination” and any nonzero value is considered “abnormal termination” by shells and the like.
Reproduced on Python 3.13.1 (provided by Arch Linux), Python 3.13.2 and 3.14.0a4 (both provided by astral-sh/python-build-standalone). Python 3.12 and lower has not affected.
CPython versions tested on:
3.13
Operating systems tested on:
Linux