From: Trevor Gamblin Date: Fri, 23 Jan 2026 16:28:58 +0000 (-0500) Subject: qemurunner.py: replace 'codecs.open()' with 'open()' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b80b52cd07580a7936d87bfad8ff42c5d436211c;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git qemurunner.py: replace 'codecs.open()' with 'open()' With newer Python versions, codecs.open() is deprecated, leading to the following warning: |Stderr: |/srv/pokybuild/tgamblin-qemux86/openembedded-core/meta/lib/oeqa/utils/qemurunner.py:133: DeprecationWarning: codecs.open() is deprecated. Use open() instead. | with codecs.open(self.logfile + extension, "ab") as f: Note that if we try to be explicit and make the 'errors' keyword 'strict' (as the codecs.open() call defaulted to), we see other warnings: |ValueError: binary mode doesn't take an errors argument Signed-off-by: Trevor Gamblin Signed-off-by: Mathieu Dubois-Briand --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index de26395bae..68e986150d 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -130,7 +130,7 @@ class QemuRunner: def log(self, msg, extension=""): if self.logfile: - with codecs.open(self.logfile + extension, "ab") as f: + with open(file=self.logfile + extension, mode="ab") as f: f.write(msg) self.msg += self.decode_qemulog(msg)