]> code.ossystems Code Review - openembedded-core.git/commitdiff
terminal.py: Pass string instead of bytes to ExecutionError to avoid exception
authorMartin Vuille <jpmv27@yahoo.com>
Sun, 27 Nov 2016 20:02:37 +0000 (15:02 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Nov 2016 15:47:15 +0000 (15:47 +0000)
Based on run() in bitbake/lib/bb/process.py, ExecutionError() expects strings
not bytes. Passing bytes results in a "TypeError: Can't convert 'bytes' object
to str implicitly" exception.

Fixes Bug 10729

Signed-off-by: Martin Vuille <jpmv27@yahoo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oe/terminal.py

index 38e66cef1ff42d2cbfb18ad53d2ae7398e8410fb..a89fa456912ce175b6e241a47c55fc8da7c3e53b 100644 (file)
@@ -239,6 +239,8 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
 
     pipe = terminal(sh_cmd, title, env, d)
     output = pipe.communicate()[0]
+    if output:
+        output = output.decode("utf-8")
     if pipe.returncode != 0:
         raise ExecutionError(sh_cmd, pipe.returncode, output)