summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 13:20:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 23:05:45 +0100
commitb5d67471dddd198723c4f711747783a33e8e5987 (patch)
tree9de06227b79e65f52294fa3ce36b28cdcc93c0ac /meta/lib
parent63ea1efdaaf1173ef4f2f69b5a3403afef4b556a (diff)
downloadopenembedded-core-contrib-b5d67471dddd198723c4f711747783a33e8e5987.tar.gz
qemurunner: Skip conversion from/to binary data for logfile
There is no point in decoding binary data only to encode it again risking conversion issues. Write the raw data to the log file as binary and skip the conversion. Also always update self.msg even if a logfile isn't specified to improve logging/debug. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 22cf258ddd..b8f5111286 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -115,10 +115,9 @@ class QemuRunner:
def log(self, msg):
if self.logfile:
- msg = self.decode_qemulog(msg)
- self.msg += msg
- with codecs.open(self.logfile, "a", encoding="utf-8") as f:
- f.write("%s" % msg)
+ with codecs.open(self.logfile, "ab") as f:
+ f.write(msg)
+ self.msg += self.decode_qemulog(msg)
def getOutput(self, o):
import fcntl