New submission from STINNER Victor <victor.stin...@haypocalc.com>:

subprocess.check_output() doesn't close explicitly pipes if an error occurs. 
See for example issue #12493 for an example of an error on .communicate().

Attached patch uses a context manager to ensure that all pipes are always 
closed and that the status is read to avoid zombies.

Other subprocess functions should be fixed:
 - call() (will fix check_call)
 - getstatusoutput() (will fix getoutput): see patch attached to the issue 
#10197 to replace os.popen() by subprocess.Popen

----------
components: Library (Lib)
files: subprocess_check_output.patch
keywords: patch
messages: 139812
nosy: haypo
priority: normal
severity: normal
status: open
title: subprocess: check_output() doesn't close pipes on error
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22572/subprocess_check_output.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12494>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to