From: Martin Vuille <jpmv27@yahoo.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] terminal.py: Pass string instead of bytes to ExecutionError to avoid exception
Date: Sun, 27 Nov 2016 15:02:37 -0500 [thread overview]
Message-ID: <1480276957-22652-1-git-send-email-jpmv27@yahoo.com> (raw)
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>
---
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 3901ad3..3c8ef59 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)
--
2.7.4
reply other threads:[~2016-11-27 20:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480276957-22652-1-git-send-email-jpmv27@yahoo.com \
--to=jpmv27@yahoo.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox