mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
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.
This commit is contained in:
parent
3aa84a7f28
commit
4036fd4b75
2 changed files with 21 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue