From 926f3dfe2dfe98e220b1709e57982c7aa154b5ae Mon Sep 17 00:00:00 2001 From: Martin Vuille Date: Sun, 27 Nov 2016 15:02:37 -0500 Subject: terminal.py: Pass string instead of bytes to ExecutionError to avoid exception 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 (From OE-Core rev: 063b63d4d324c23322ac1b6b7c7928e725d7b968) (From OE-Core rev: df4d5246d47acc54aa322b777364c9b86f9a4c54) Signed-off-by: Martin Vuille Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- meta/lib/oe/terminal.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta/lib/oe') diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 3901ad3f26..3c8ef59a45 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -227,6 +227,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) -- cgit v1.2.3-54-g00ecf