[issue20584] On FreeBSD, signal.NSIG is smaller than biggest signal value

Jan-Philip Gehrcke report at bugs.python.org
Fri May 23 11:57:40 CEST 2014


Jan-Philip Gehrcke added the comment:

We should match the unit test with the documentation for signal.NSIG. Either the code or the docs or both need to change.

Currently the docs say that signal.NSIG is "One more than the number of the highest signal number." ("https://docs.python.org/3.4/library/signal.html#signal.NSIG).

In case of FreeBSD's _SIG_MAXSIG (128) the documentation is still wrong: the highest signal value MAX is 126 (see http://bugs.python.org/issue20584#msg210892). According to the docs, NSIG should then be 127.

In signal_nsig_freebsd-2.patch the test `self.assertLess(max(signals), signal.NSIG)` tests for NSIG > MAX instead of for NSIG = MAX+1.

So, either 

- we count signals by ourselves and build our own value of NSIG, in which case we can guarantee that NSIG = MAX+1 or

- we rely on the platform header files for extracting NSIG, but must note in the docs that NSIG is not always MAX+1.

The current patch + a documentation change would implement the latter case.

What is the exact meaning of _SIG_MAXSIG, where is that meaning defined?

----------

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


More information about the Python-bugs-list mailing list