summaryrefslogtreecommitdiff
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-05-26 20:22:14 +0000
committerGregory P. Smith <greg@mad-scientist.com>2008-05-26 20:22:14 +0000
commit4036fd4b752f744d455f592a83b4a1e36cd77a86 (patch)
treeb8edac46244c6d057bebeb334bbb3db127ecdccf /Lib/subprocess.py
parent3aa84a7f28659cfbed312e352775b32d2a58005b (diff)
downloadcpython-git-4036fd4b752f744d455f592a83b4a1e36cd77a86.tar.gz
Fixes issue2791: subprocess.Popen.communicate leaked a file descripton until
the last reference to the Popen instance was dropped. Adding explicit close() calls fixes it. Candidate for backport to release25-maint.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index dc639c953a..606559413e 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -661,8 +661,10 @@ class Popen(object):
self.stdin.close()
elif self.stdout:
stdout = self.stdout.read()
+ self.stdout.close()
elif self.stderr:
stderr = self.stderr.read()
+ self.stderr.close()
self.wait()
return (stdout, stderr)