[issue12494] subprocess: check_output() doesn't close pipes on error
STINNER Victor
report at bugs.python.org
Tue Jul 5 13:02:45 CEST 2011
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
subprocess_check_output-2.patch is a more complete patch: "fix" (?) call(), check_output() and getstatusoutput(). These functions kill the process if an exception occurs to not hang on wait() in Popen.__exit__().
Because of the kill, I don't know if the fix should be applied to 2.7 and 3.2. In case of an exception, is it better to keep the subprocess alive, or to kill it? If we keep it alive, the caller of the function cannot interact with the process, and we don't know exactly when it will finish.
By "exception", I mean unexpected exceptions: check_output() handles explicitly the TimeoutExpired exception.
----------
Added file: http://bugs.python.org/file22580/subprocess_check_output-2.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12494>
_______________________________________
More information about the Python-bugs-list
mailing list