You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
subprocess.communicate() doesn't close pipes on Windows #54972
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2010-12-25.22:43:41.873>created_at=<Date2010-12-23.11:59:26.308>labels= ['library', 'OS-windows']
title="subprocess.communicate() doesn't close pipes on Windows"updated_at=<Date2010-12-25.22:43:41.871>user='https://github.com/vstinner'
If more than one file (stdin, stdout and stderr) are pipes, Popen.communicate() uses threads calling _readerthread() on each pipe. But this method doesn't close the pipes, whereas all other communicate implementations (select, poll and the optimization if there is only one pipe) do close all pipes.
Attached patch fixes this issue.
Thanks Antoine for your nice ResourceWarning patch!
Activity
vstinner commentedon Dec 23, 2010
If more than one file (stdin, stdout and stderr) are pipes, Popen.communicate() uses threads calling _readerthread() on each pipe. But this method doesn't close the pipes, whereas all other communicate implementations (select, poll and the optimization if there is only one pipe) do close all pipes.
Attached patch fixes this issue.
Thanks Antoine for your nice ResourceWarning patch!
vstinner commentedon Dec 25, 2010
Fixed by r87485 (Python 3.2).
I don't want to fix it in 2.7 or 3.1, because maybe someone relies on this bug and it's a minor bug :-) Reopen the issue if you would like a backport.