* [PATCH] lib/bb/build.py: decode the command as UTF-8
@ 2016-07-15 10:27 Ross Burton
2016-07-15 23:08 ` Paul Eggleton
0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2016-07-15 10:27 UTC (permalink / raw)
To: bitbake-devel
The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the value
as otherwise "bberror" != b("bberror") and none of the messages from shell
functions are ever displayed.
Also add an else to the command parser so unhandled commands are noticed.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
bitbake/lib/bb/build.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 4f01d66..7c47680 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -389,7 +389,7 @@ exit $ret
lines = data.split(b'\0')
for line in lines:
splitval = line.split(b' ', 1)
- cmd = splitval[0]
+ cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
else:
@@ -413,7 +413,8 @@ exit $ret
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
-
+ else:
+ bb.warn("Unrecognised command '%s' on FIFO" % cmd)
tempdir = d.getVar('T', True)
fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
if os.path.exists(fifopath):
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/bb/build.py: decode the command as UTF-8
2016-07-15 10:27 [PATCH] lib/bb/build.py: decode the command as UTF-8 Ross Burton
@ 2016-07-15 23:08 ` Paul Eggleton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-07-15 23:08 UTC (permalink / raw)
To: bitbake-devel
On Fri, 15 Jul 2016 11:27:22 Ross Burton wrote:
> The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the
> value as otherwise "bberror" != b("bberror") and none of the messages from
> shell functions are ever displayed.
>
> Also add an else to the command parser so unhandled commands are noticed.
Thanks. Ideally this should be marked as "Fixes [YOCTO #9947]" when it gets
merged.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-15 23:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 10:27 [PATCH] lib/bb/build.py: decode the command as UTF-8 Ross Burton
2016-07-15 23:08 ` Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.