[issue15798] subprocess.Popen() fails if 0, 1 or 2 descriptor is closed
Gregory P. Smith
report at bugs.python.org
Wed Aug 29 18:34:45 CEST 2012
Gregory P. Smith added the comment:
Yes, something along the lines of that patch is what I was thinking. BTW, this is only necessary for the errpipe_write fd. errpipe_read is for the parent process.
I'm going to do it within _create_pipe so that the optimal _posixsubprocess.cloexec_pipe pipe2() based implementation can be used when possible rather than needing to call _set_cloexec() on the dup'ed fd.
There are some recent Linux specific possibilities such as fcntl with F_DUPFD, or better F_DUPFD_CLOEXEC, that would make this a single call. Using that may be overkill for this situation but it looks easy enough while I'm in there.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15798>
_______________________________________
More information about the Python-bugs-list
mailing list