diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-11-11 01:37:02 -0800 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-11-11 01:37:02 -0800 |
commit | 12489d98e692717a93694644dac4975d54106178 (patch) | |
tree | fd89ced1744ea9395e0d5d0cd432b3a3b8641f5b /Lib/subprocess.py | |
parent | 3aee2221229b9802dcc27b2709d5e97918b8ad46 (diff) | |
download | cpython-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.py | 3 |
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) |