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

Antoine Pitrou report at bugs.python.org
Tue Mar 20 12:50:20 CET 2012


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

> > Or we could change Py_InitializeEx() to setup the signal handlers
> > after having imported the site module:
> 
> Note that I don't really like this solution, because it's better to
> setup handlers for fatal signals (SIGPIPE, SIGXF...) before executing
> arbitrary Python code (site).

Agreed. I think we'd better disable SIGINT initialization when a certain
environment variable is set.
(AFAICT, the issue is only about SIGINT since it's the only one where
the default behaviour is overriden)

----------

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


More information about the Python-bugs-list mailing list