[oe-commits] [openembedded-core] 57/76: terminal.py: Pass string instead of bytes to ExecutionError to avoid exception

git at git.openembedded.org git at git.openembedded.org
Wed Nov 30 15:49:42 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 063b63d4d324c23322ac1b6b7c7928e725d7b968
Author: Martin Vuille <jpmv27 at yahoo.com>
AuthorDate: Sun Nov 27 15:02:37 2016 -0500

    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
    
    Signed-off-by: Martin Vuille <jpmv27 at yahoo.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oe/terminal.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 38e66ce..a89fa45 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -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)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list