Backport r62724 from trunk. Fixes issue 2791. subprocess.Popen.communicate

now closes its stdout and stderr fds as soon as it is finished with them.
This commit is contained in:
Gregory P. Smith 2008-06-01 23:44:46 +00:00
parent 1a34834e09
commit 26660401c0
3 changed files with 22 additions and 0 deletions

View file

@ -660,8 +660,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)