[issue23325] Turn SIG_DFL and SIG_IGN into functions

Serhiy Storchaka report at bugs.python.org
Sat Aug 25 13:42:29 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Numerical values of signal numbers are standardized. signal.signal(15, handler) is valid. SIGTERM is just a handy name for the constant 15.

But SIG_DFL and SIG_IGN are not integers in C (they are special pointers), and it is not declared anywhere that they should be integers in Python. The code that converts them to Python integer is implementation depending (PyLong_FromVoidPtr). Handcrafted SIG_DFL and SIG_IGN are broken by design, because the signal module uses identity comparison for SIG_DFL and SIG_IGN.

----------

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


More information about the Python-bugs-list mailing list