[New-bugs-announce] [issue32985] subprocess.Popen: Confusing documentation for restore_signals

Alicia Boya García report at bugs.python.org
Fri Mar 2 12:31:25 EST 2018


New submission from Alicia Boya García <ntrrgc at gmail.com>:

The docs state:

> If restore_signals is true (the default) all signals that Python has set to SIG_IGN are restored to SIG_DFL in the child process before the exec. Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)

The first phrase and the second may seem contradictory for anyone that uses signal handling in their code.

I would definitely not describe the set of "SIGPIPE, SIGXFZ and SIGXFSZ" as "all signals that Python has set". It actually means "all the signals that Python set at startup"; the user could have changed different signals than these (e.g. SIGINT) for various purposes (e.g. not getting a KeyboardInterrupt while an interactive process is running).

The current wording may suggest that all signals changed by the user are reset in the child process, but this is not the case -- I could confirm by looking at _Py_RestoreSignals(). Only these three specific signals are restored.

----------
components: Library (Lib)
messages: 313146
nosy: ntrrgc
priority: normal
severity: normal
status: open
title: subprocess.Popen: Confusing documentation for restore_signals
versions: Python 3.6

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


More information about the New-bugs-announce mailing list