summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 13:22:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 23:05:45 +0100
commit8ec86d46f736ec3e625b741e97545377c79414ee (patch)
treec232137364553c4fea959fc0c6946409879e0879 /meta/lib/oeqa/utils
parentb5d67471dddd198723c4f711747783a33e8e5987 (diff)
downloadopenembedded-core-8ec86d46f736ec3e625b741e97545377c79414ee.tar.gz
qemurunner: Use backslashreplace with utf8 to make invalid characters clear
Switch to the backslashreplace error handling when decoding strings so that invalid characters are clear in the stream to improve debugging. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index b8f5111286..b738a261d8 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -109,7 +109,7 @@ class QemuRunner:
def decode_qemulog(self, todecode):
# Sanitize the data received from qemu as it may contain control characters
- msg = todecode.decode("utf-8", errors='ignore')
+ msg = todecode.decode("utf-8", errors='backslashreplace')
msg = re_control_char.sub('', msg)
return msg
@@ -473,7 +473,7 @@ class QemuRunner:
self.logger.error('Invalid file type: %s\n%s' % (file))
read = b''
- self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='ignore')))
+ self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='backslashreplace')))
data = data + read
if data:
bootlog += data