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

Jurko Gospodnetić report at bugs.python.org
Sun Dec 15 04:26:07 CET 2013


Jurko Gospodnetić added the comment:

This issue is related to issue #19983 on Windows.

  Also, I do not think the suggested -z option implementation should be accepted 'as is'.

  On Unix it would make Ctrl-C silently terminate the process if it occurs before default Python signal handling is enabled. I do not know what effect this would have on Windows - possibly the signal would simply be ignored & lost.

  It would also still leave a slight window between when Python sets up its default SIGINT handling and when user code has a chance to set up its own.

  My first instinct is to not do that and instead add an option to block SIGINT handling and allow user code to enable its own or default Python handling as it wishes and then unblock SIGINT handling. Note that by 'blocking' a signal I do not mean losing/ignoring it but delaying its handling until signal handling is unblocked.

----------

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


More information about the Python-bugs-list mailing list