commit | f3715d2fc72e191c58c76e1eba92f6bc0a5a0e9d | [log] [tgz] |
---|---|---|
author | Georg Brandl <georg@python.org> | Sat Feb 14 17:01:36 2009 +0000 |
committer | Georg Brandl <georg@python.org> | Sat Feb 14 17:01:36 2009 +0000 |
tree | 50f867a242a1748dac5af195a41c32d2f0e6a612 | |
parent | 95777bb019b2b42cef8caaf80723f3bb0409970c [diff] [blame] |
#5179: don't leak PIPE fds when child execution fails.
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 309f5d4..d91fbee 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py
@@ -1151,6 +1151,9 @@ if data != "": os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception