[issue13285] signal module ignores external signal changes

Charles-François Natali report at bugs.python.org
Fri Oct 28 16:01:07 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> So it's impossible to reliably save and restore signal handlers through 
> python when they can also be changed outside the python interpreter.

signal.getsignal() or signal.signal() return the current/previous handler as a Python function. How could it return a reference to a native (i.e. C) signal handler?
While we could in theory return it as a magic cookie (i.e. the handler's address as returned by sigaction/signal) that can just be passed back to signal.signal(), it would be a bad idea: if the user passes an invalid address, the process will crash when the signal is received.

----------
nosy: +neologix

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


More information about the Python-bugs-list mailing list