[issue9922] subprocess.getstatusoutput can fail with utf8 UnicodeDecodeError

Ned Deily report at bugs.python.org
Thu Mar 3 23:08:15 CET 2011

Ned Deily <nad at acm.org> added the comment:

I don't have a strong feeling about it but it seems to me that getstatusoutput is broken now so something should needs to be changed.  If I understand your suggestion, adding a universal_newlines option to getstatusoutput similar to Popen, with a True (default) to return str False to return bytes, should provide an upwards compatible compromise.  And whatever solution is adopted for Issue6135 should be able to be applied here as well.

On the other hand, getstatusoutput was a carryover from the commands module in Python 2 and I'm not sure why it was not just removed in Python 3 as it seems to duplicate what can be done with Popen.  Perhaps it should just be deprecated and removed?


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list