[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

eryksun report at bugs.python.org
Fri Apr 24 19:09:33 CEST 2015


eryksun added the comment:

> I believe a better behavior for sys.exit() would be to truncate 
> the code values to 8-bit range so that non-zero status would 
> always be returned as non-zero, but possibly different value.

OK, so long as it's just for POSIX systems. Windows ExitProcess, ExitThread, TerminateProcess, and TerminateThread all use an unsigned int value for the exit code, and it's common to use a [Win32 error code][1] in the 16-bit range 0x0000 to 0xFFFF.

[1]: https://msdn.microsoft.com/en-us/library/cc231199

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24052>
_______________________________________


More information about the Python-bugs-list mailing list