On 2010-11-03, Gnarlodious <gnarlodi...@gmail.com> wrote:
> Under Python 3, subprocess.check_output returns a bytestring that
> doesn't parse. Since the CLI program (written in the 1990's) will
> never send Unicode, is there a way to downconvert the bytestring into
> type str so as to emulate Py2.6 behavior?

str() will convert a bytestring into a Python string object which you will
be able to parse so long as the output remains ASCII (which your example
is).  If the input uses another encoding or contains characters with the
high order bit set, you might need to fiddle with the strings encoding.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to