[issue14228] It is impossible to catch sigint on startup in python code

Antoine Pitrou report at bugs.python.org
Fri Mar 23 14:32:30 CET 2012


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

> Don't be offended, but this looks like a software coded by a 12 years
> old, who is proud about it and does not accept an error being an error
> and insists on doing it right, although it's a common understanding
> that throwing errors in non error situations.

No, the point is that the exception may be caused by a real bug and
having the traceback is tremendously useful to debug such situations.
So the Python runtime by default prints out the whole traceback when an
uncaught exception occurs. KeyboardInterrupt is not different in this
regard from, say, ZeroDivisionError.

As I said, a possible solution is to allow users to alter the default
signal handling (using an env var).

(note that, AFAICT, you're the first to report a problem here, although
this behaviour has existed for ages)

----------

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


More information about the Python-bugs-list mailing list