@@ -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='replace')
msg = re_control_char.sub('', msg)
return msg
@@ -474,7 +474,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='replace')))
data = data + read
if data:
bootlog += data
It seems like "ignore" is stopping decoding and failing to detect login prompts. Maybe "replace" works more reliably when reads from serial console are incomplete and we're trying to detect the login prompt. See logs like: https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5833/steps/14/logs/stdio https://autobuilder.yocto.io/pub/failed-builds-data/6.5%20kernel/log.do_testimage.3051530 https://autobuilder.yocto.io/pub/failed-builds-data/6.5%20kernel/qemu_boot_log.20231001114436 Python documentation is not clear on how "ignore" and "replace" differ and both should continue processing if there are errors in the stream: https://docs.python.org/3/library/codecs.html#error-handlers Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> --- meta/lib/oeqa/utils/qemurunner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)