mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 12:32:12 +02:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user