Staging
v0.5.1
https://github.com/python/cpython
Revision 2173bb818c6c726d831b106ed0d3fad7825905dc authored by Miss Islington (bot) on 11 September 2018, 06:00:47 UTC, committed by Gregory P. Smith on 11 September 2018, 06:00:47 UTC
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b67f49d8275c05d51b3ead50cf97f48)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
1 parent b2260e5
History
Tip revision: 2173bb818c6c726d831b106ed0d3fad7825905dc authored by Miss Islington (bot) on 11 September 2018, 06:00:47 UTC
bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9149)
Tip revision: 2173bb8
File Mode Size
.github
.vsts
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
.bzrignore -rw-r--r-- 582 bytes
.gitattributes -rw-r--r-- 1.6 KB
.gitignore -rw-r--r-- 1.4 KB
.hgignore -rw-r--r-- 1.3 KB
.travis.yml -rw-r--r-- 5.2 KB
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 59.9 KB
README.rst -rw-r--r-- 10.3 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.2 KB
config.sub -rwxr-xr-x 35.7 KB
configure -rwxr-xr-x 480.7 KB
configure.ac -rw-r--r-- 160.6 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 41.1 KB
setup.py -rw-r--r-- 102.1 KB

README.rst

back to top