diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-04 13:22:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-04 23:05:54 +0100 |
commit | 4abef7a9d9564c55ab4b8323ee4df9a5c8de6acd (patch) | |
tree | 6e67dca4418916a98c294bb3bd6462098afd333b /meta/lib/oeqa/utils/qemurunner.py | |
parent | 2305928a00fe4d7b65a06b68156297de051101c6 (diff) | |
download | poky-4abef7a9d9564c55ab4b8323ee4df9a5c8de6acd.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.
(From OE-Core rev: 8ec86d46f736ec3e625b741e97545377c79414ee)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 4 |
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: | |||
109 | 109 | ||
110 | def decode_qemulog(self, todecode): | 110 | def decode_qemulog(self, todecode): |
111 | # Sanitize the data received from qemu as it may contain control characters | 111 | # Sanitize the data received from qemu as it may contain control characters |
112 | msg = todecode.decode("utf-8", errors='ignore') | 112 | msg = todecode.decode("utf-8", errors='backslashreplace') |
113 | msg = re_control_char.sub('', msg) | 113 | msg = re_control_char.sub('', msg) |
114 | return msg | 114 | return msg |
115 | 115 | ||
@@ -473,7 +473,7 @@ class QemuRunner: | |||
473 | self.logger.error('Invalid file type: %s\n%s' % (file)) | 473 | self.logger.error('Invalid file type: %s\n%s' % (file)) |
474 | read = b'' | 474 | read = b'' |
475 | 475 | ||
476 | self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='ignore'))) | 476 | self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='backslashreplace'))) |
477 | data = data + read | 477 | data = data + read |
478 | if data: | 478 | if data: |
479 | bootlog += data | 479 | bootlog += data |