[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

Martin v. Löwis report at bugs.python.org
Fri Mar 9 08:14:35 CET 2012


Martin v. Löwis <martin at v.loewis.de> added the comment:

I'm not so sure that Python is in violation of the convention here. The exit code should report *unhandled* signals, indicating that the process didn't provide an exit code at all (as it didn't call exit(2)). You are supposed to use WIFEXITED/WIFSIGNALED/WIFSTOPPED on the status code, and interpret it as an exit code only if WIFEXITED.

Since Python *does* handle the signal, and exits "regularly", we shouldn't (and probably even can't) claim that we didn't exit (unless we raise the signal again instead of exiting).

----------

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


More information about the Python-bugs-list mailing list