scripts: python3: decode subprocess output

stdeout and stderr content returned by subprocess API has different
types in Python 3(bytes) and Python 2(string). Decoding it to
'utf-8' makes it unicode on both pythons.

(From OE-Core rev: ae4d36375683b6cfd48af25bfca70b2e77f7ade5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-06-02 13:13:00 +03:00
committed by Richard Purdie
parent a8314b9531
commit 4e36eeee77
3 changed files with 3 additions and 3 deletions

View File

@@ -198,7 +198,7 @@ def runcmd(cmd,destdir=None,printerr=True,out=None,env=None):
raise e
err.seek(0)
output = err.read()
output = err.read().decode('utf-8')
logger.debug("output: %s" % output.replace(chr(0), '\\0'))
return output