summaryrefslogtreecommitdiff
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-11-11 01:37:02 -0800
committerGregory P. Smith <greg@krypto.org>2012-11-11 01:37:02 -0800
commit12489d98e692717a93694644dac4975d54106178 (patch)
treefd89ced1744ea9395e0d5d0cd432b3a3b8641f5b /Lib/subprocess.py
parent3aee2221229b9802dcc27b2709d5e97918b8ad46 (diff)
downloadcpython-git-12489d98e692717a93694644dac4975d54106178.tar.gz
Fixes issue #16140: The subprocess module no longer double closes its
child subprocess.PIPE parent file descriptors on child error prior to exec(). This would lead to race conditions in multithreaded programs where another thread opened a file reusing the fd which was then closed out from beneath it by the errant second close.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index fcc3e6e3ba..a322829469 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1378,9 +1378,6 @@ class Popen(object):
child_exception_type = getattr(
builtins, exception_name.decode('ascii'),
RuntimeError)
- for fd in (p2cwrite, c2pread, errread):
- if fd != -1:
- os.close(fd)
err_msg = err_msg.decode(errors="surrogatepass")
if issubclass(child_exception_type, OSError) and hex_errno:
errno_num = int(hex_errno, 16)