[issue30654] signal module always overwrites SIGINT on interpreter shutdown

STINNER Victor report at bugs.python.org
Fri Jun 1 05:53:46 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

> I'd rather not backport this to 2.7 as it's quite late in the maintenance cycle and I'd like to avoid any regressions there.

Since it's a subtle behavior change and the PR doesn't add a flag to opt-in for the old behaviour, I'm not sure about backporting the change (to 3.6 or 3.7).

For 3.7, we are very close to the final release. It doesn't give much time to users to test the new behavior :-( I would suggest to keep the old behavior in Python 3.7 as well.

To be honest, I don't understand well the change. So I'm not confortable with it.

I understand that Py_Initialize() + Py_Finalize() restored the SIGINT handler, but now Python *always* sets SIGINT to SIG_DFL in Py_Finalize(). So if an application has its own signal handler, Python replaces it...

But embedded Python also gives the choice of not setting Python signal handlers in Py_Initialize().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30654>
_______________________________________


More information about the Python-bugs-list mailing list