This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ian Macartney
Recipients Ian Macartney, docs@python, krichter, martin.panter
Date 2015-12-09.08:54:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449651246.72.0.225714961371.issue25787@psf.upfronthosting.co.za>
In-reply-to
Content
I don't have much experience with what should and shouldn't be in the python docs, however I was recently bitten by a subtlety in signal/subprocess that might be worth documenting.

Anything written to stdout in a signal handler could end up in the stdout of a process returned by Popen, if stdout gets flushed in the signal handler during a critical part of the Popen call. Furthermore, any output buffered before calling Popen could also be flushed by the signal handler, showing up in the child process's stdout. The same goes for stderr.

On 2.7.7 at least, the window where this can happen is between lines 1268-1290 in subprocess.py, where the child process has duplicated stdout, but hasn't yet called execvp.

This is a result of signal inheritance that caught me off guard, and wasn't clear to me by reading the documentation.
History
Date User Action Args
2015-12-09 08:54:06Ian Macartneysetrecipients: + Ian Macartney, docs@python, martin.panter, krichter
2015-12-09 08:54:06Ian Macartneysetmessageid: <1449651246.72.0.225714961371.issue25787@psf.upfronthosting.co.za>
2015-12-09 08:54:06Ian Macartneylinkissue25787 messages
2015-12-09 08:54:06Ian Macartneycreate