From patchwork Sun Nov 15 08:48:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 104203 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4326.1794732553776882469 for ; Sun, 15 Nov 2026 00:49:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=MWrDjNGy; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-491f34b4e0fso935894f8f.2 for ; Sun, 15 Nov 2026 00:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1794732552; x=1795337352; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=VMrcEYbooq1pYljDR6hpHkfTVzQAC2HQyQLCCv+Hemg=; b=MWrDjNGy5w5iDdZXPTCzjx43irOnRGPmi9/c7DZojWJOTZBgXCVtIRCF4b/+9mOZZz 0W1RWJjqF+Pvly6QQ9x9AL/LwvdjUNZ6AscmNZnsNqBbXhho7SwEkqvV0DnfYeuJLDQM TXp4LfKZ+IvEqUuw5FAN3i/fVaXbgl4j0A5Yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794732552; x=1795337352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=VMrcEYbooq1pYljDR6hpHkfTVzQAC2HQyQLCCv+Hemg=; b=M/1VtRowyN3ryYGCTlGILP4KEB1arwAQYTnLuL5CwH8Uf3JkV/CA+gD8Q3s1Kufm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u7g3/LG/S6+tdZPBV459Y25IXHDhmsXcVKzC7GJFBPK 47gs= X-Received: by 2002:a05:6000:4009:b0:48c:7143:610c with SMTP id ffacd0b85a97d-49c73bf0a80mr17528787f8f.36.1794732551828; Sun, 15 Nov 2026 00:49:11 -0800 (PST) Return-Path: Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:4b65:588d:a4ce:ce3f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-49c60f8d66esm13804452f8f.57.2026.11.15.00.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2026 00:49:10 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/41] oeqa: Let subprocess decode output instead of calling .decode() Date: Sun, 15 Nov 2026 08:48:17 +0000 Message-ID: <20261115084845.701136-14-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261115084845.701136-1-richard.purdie@linuxfoundation.org> References: <20261115084845.701136-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sun, 15 Nov 2026 08:49:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250245 Pass text=True to the subprocess calls rather than decoding the bytes afterwards. This also covers CalledProcessError.output. Raw socket/pty reads and base64 output are left as bytes. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/oeqa/core/target/qemu.py | 2 +- meta/lib/oeqa/runtime/cases/boot.py | 4 ++-- meta/lib/oeqa/runtime/cases/dnf.py | 2 +- meta/lib/oeqa/runtime/cases/ping.py | 4 ++-- meta/lib/oeqa/sdk/testsdk.py | 4 ++-- meta/lib/oeqa/sdk/utils/sdkbuildproject.py | 5 +++-- meta/lib/oeqa/sdkext/testsdk.py | 4 ++-- .../lib/oeqa/selftest/cases/yoctotestresultsquerytests.py | 2 +- meta/lib/oeqa/utils/metadata.py | 8 ++++---- meta/lib/oeqa/utils/qemurunner.py | 3 +-- meta/lib/oeqa/utils/qemutinyrunner.py | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/meta/lib/oeqa/core/target/qemu.py b/meta/lib/oeqa/core/target/qemu.py index a4f53747b01..e3e5ec874d5 100644 --- a/meta/lib/oeqa/core/target/qemu.py +++ b/meta/lib/oeqa/core/target/qemu.py @@ -81,7 +81,7 @@ class OEQemuTarget(OESSHTarget): blcmd = ["tail", "-20", self.bootlog] msg += "===== start: snippet =====\n\n" try: - out = subprocess.check_output(blcmd, stderr=subprocess.STDOUT, timeout=1).decode('utf-8') + out = subprocess.check_output(blcmd, stderr=subprocess.STDOUT, timeout=1, text=True) msg += "file: %s\n\n" % self.bootlog msg += out except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as err: diff --git a/meta/lib/oeqa/runtime/cases/boot.py b/meta/lib/oeqa/runtime/cases/boot.py index dcee3311f78..1ea22ac9a63 100644 --- a/meta/lib/oeqa/runtime/cases/boot.py +++ b/meta/lib/oeqa/runtime/cases/boot.py @@ -24,8 +24,8 @@ class BootTest(OERuntimeTestCase): while count < 5: time.sleep(5) cmd = 'ping -c 1 %s' % self.target.ip - proc = Popen(cmd, shell=True, stdout=PIPE) - output += proc.communicate()[0].decode('utf-8') + proc = Popen(cmd, shell=True, stdout=PIPE, text=True) + output += proc.communicate()[0] if proc.poll() == 0: count += 1 else: diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index 1becc8d8a02..e96f2ac765d 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py @@ -103,7 +103,7 @@ class DnfRepoTest(DnfTest): @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk']) def test_dnf_install_from_http(self): output = subprocess.check_output('%s %s -name dnf-test-dep*' % (bb.utils.which(os.getenv('PATH'), "find"), - os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8") + os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True, text=True) rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1] url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path) self.dnf_with_repo('remove -y dnf-test-dep') diff --git a/meta/lib/oeqa/runtime/cases/ping.py b/meta/lib/oeqa/runtime/cases/ping.py index baea1b385ba..f4c57f0f1ac 100644 --- a/meta/lib/oeqa/runtime/cases/ping.py +++ b/meta/lib/oeqa/runtime/cases/ping.py @@ -28,8 +28,8 @@ class PingTest(OERuntimeTestCase): try: while count < 5: cmd = 'ping -c 1 %s' % self.target.ip - proc = Popen(cmd, shell=True, stdout=PIPE) - output += proc.communicate()[0].decode('utf-8') + proc = Popen(cmd, shell=True, stdout=PIPE, text=True) + output += proc.communicate()[0] if proc.poll() == 0: count += 1 else: diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py index 747608f260c..ee25d682b95 100644 --- a/meta/lib/oeqa/sdk/testsdk.py +++ b/meta/lib/oeqa/sdk/testsdk.py @@ -66,9 +66,9 @@ class TestSDK(TestSDKBase): import subprocess try: - subprocess.check_output("cd %s; %s <