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

Antoine Pitrou report at bugs.python.org
Sun Apr 1 17:39:53 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> Because calling exit() is the right way to end a process. For example,
> it does the following:
> - atexit()-registered finalizers are run
> - stdio streams are flushed and closed (although it could probably
> done by the interpreter)
> - files created with tmpfile() are removed (on POSIX systems, they're
> removed after creation, but you can imagine an implementation where
> they would need to be explicitely removed upon close)
> 
> This would not be performed if the signal is raised.
> Since the user has the possibility of restoring default signal
> handlers with SIG_DFL, I think we could stcik with the current
> behavior.

Ah, ok, I agree with you, then.

----------

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


More information about the Python-bugs-list mailing list