[docs] [issue21382] Signal module doesnt raises ValueError Exception

Florent Xicluna report at bugs.python.org
Tue Apr 29 19:16:49 CEST 2014


Florent Xicluna added the comment:

It's about documentation only.

The sentence is not wrong, but it is slightly confusing, and there's no hint which signals are defined on Windows.

"On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in any other case."

Reading only this documentation, if the developer doesn't have a test platform on Windows, he could blindly write:

try:
    signal.signal(signal.SIGPIPE, lambda signum, frame: sys.exit(1))
except ValueError:
    pass

... until a Windows user detects the issue (thank you rsevcan)


Now I just found this page which is relevant here ... either we could link to the page in a "See also" section, or give an hint about which signals are defined or not.
http://msdn.microsoft.com/en-us/library/xdkz3x12.aspx

----------
components:  -Library (Lib)
priority: normal -> low
versions: +Python 3.4, Python 3.5

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


More information about the docs mailing list