diff options
authorEd Bartosh <>2017-03-06 17:10:12 +0200
committerRichard Purdie <>2017-03-08 11:13:47 +0000
commit4a46dd5190d97fdcb6297a0c1d8c824d425c4c51 (patch)
parent770b87d903644641da41594193ee61b564dd99e9 (diff)
openembedded-core-contrib-4a46dd5190d97fdcb6297a0c1d8c824d425c4c51.tar.bz2 ignore decode errors
qemu output can contain control characters. This cause qemurunner API to crash when decoding the output to utf-8: Traceback (most recent call last): File "/usr/lib64/python3.4/", line 911, in _bootstrap_inner File "meta/lib/oeqa/utils/", line 472, in run File "/usr/lib64/python3.4/", line 859, in run self._target(*self._args, **self._kwargs) File "meta/lib/oeqa/utils/", line 465, in threadtarget self.eventloop() File "meta/lib/oeqa/utils/", line 526, in eventloop self.logfunc(data) File "meta/lib/oeqa/utils/", line 77, in log msg = msg.decode("utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 0: unexpected end of data Added errors='ignore' to decode call to fix this. Signed-off-by: Ed Bartosh <> Signed-off-by: Ross Burton <>
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/ b/meta/lib/oeqa/utils/
index 19f0f92b74..59dc11d00f 100644
--- a/meta/lib/oeqa/utils/
+++ b/meta/lib/oeqa/utils/
@@ -74,7 +74,7 @@ class QemuRunner:
if self.logfile:
# It is needed to sanitize the data received from qemu
# because is possible to have control characters
- msg = msg.decode("utf-8")
+ msg = msg.decode("utf-8", errors='ignore')
msg = re_control_char.sub('', msg)
with, "a", encoding="utf-8") as f:
f.write("%s" % msg)