[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed

Gregory P. Smith report at bugs.python.org
Mon Dec 2 05:02:26 CET 2013


Gregory P. Smith added the comment:

i went with the less invasive in terms of behavior change approach of making sure that the errpipe_write fd is always >= 3.  In Python 3.4 the code change was different and much simpler and on the Python only side as all fd's are opened O_CLOEXEC by default.

I'm not entirely sure why the test_multiprocessing_forkserver and test_multiprocessing_spawn failures happened on 3.4 with the earlier change that attempted to always list 0,1,2 in the fds_to_keep (derived from pass_fds) list so there _may_ be a bug lurking elsewhere there but I suspect the bug is actually that we don't always want to blindly list them in fds_to_keep as some programs may have reused some of them for other non-stdio purposes but still want them closed.

The change has been backported to the python-subprocess32 repo.

----------
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

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


More information about the Python-bugs-list mailing list