STINNER Victor <victor.stin...@haypocalc.com> added the comment: subprocess_getoutput.patch: patch subprocess.getstatusoutput() to use directly Popen, instead of os.popen, with stderr=subprocess.STDOUT instead of "2>&1" shell redirection. It strips also all trailing spaces and newlines, not just the last one. And finally, it removes "Availability: UNIX." from the documentation.
I tried to add a shell argument (to be able to disable the shell) and to accept any Popen keyword, but I don't know how to implement shell=False if the input is a list of arguments. list2cmdline() is unsafe on UNIX (see #8972). And if getstatusoutput() doesn't accept argument list, it becomes useless with shell=False (it doesn't support to call a program with arguments). Note: the status is still shifted on UNIX to be compatible with the wait() format. ---------- keywords: +patch Added file: http://bugs.python.org/file20985/subprocess_getoutput.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10197> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com