From patchwork Tue Jan 6 22:03:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1307 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737078; bh=6o6M2okFqb+/4FQ7Xdm+p52NrxBJ0r4i7571R0wtENM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=l/iLbxwfdzmsguJzj5Lh4nXU/hgcNs28mNFgTckrN98zuiF2FTsytM8uDFMndWQH7 4Q7zooU/0Rt+7EkboOfquyzI2pz83vDIKw9iuwaQ2E6H8sWSn2KPiLYjNidTJXTZjE d5H/jeQsU7xRl3vwO+LMhYkVwbn8evP0steFGY8S9aU6bBoSFzJMTcYh3F20FqE7LD 87EV7dypTqqaztleOjNaFMcs3uttnj131uy54VnLN584aBom7oFZI5qla4iNzi70tL m7zgxLOFnjbGqh1uOldsyCxzoqCqdq7cI3Sy2/KaYA3bOtIR7C/Es1XVtql/9oP7nZ efDzcVNCADwLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 418DF69158 for ; Tue, 6 Jan 2026 15:04:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZzibADJXvty5 for ; Tue, 6 Jan 2026 15:04:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737078; bh=6o6M2okFqb+/4FQ7Xdm+p52NrxBJ0r4i7571R0wtENM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=l/iLbxwfdzmsguJzj5Lh4nXU/hgcNs28mNFgTckrN98zuiF2FTsytM8uDFMndWQH7 4Q7zooU/0Rt+7EkboOfquyzI2pz83vDIKw9iuwaQ2E6H8sWSn2KPiLYjNidTJXTZjE d5H/jeQsU7xRl3vwO+LMhYkVwbn8evP0steFGY8S9aU6bBoSFzJMTcYh3F20FqE7LD 87EV7dypTqqaztleOjNaFMcs3uttnj131uy54VnLN584aBom7oFZI5qla4iNzi70tL m7zgxLOFnjbGqh1uOldsyCxzoqCqdq7cI3Sy2/KaYA3bOtIR7C/Es1XVtql/9oP7nZ efDzcVNCADwLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 29A9569146 for ; Tue, 6 Jan 2026 15:04:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737077; bh=7fBMCGlND57NU/ZtTwiIRhB5uJESpbb6Qy0PpXGLsjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/C0H2Ho7V06+cfZOco8rkpq+g7AkjOhtIDL+C1fmCxBgnwWZnX343I3JHx9sJ3TH /80FarOxCHsOzPPmUHAW4/APEJYn8dOSaNMpGLh0MTtKvAMDMTtT8bd2hXEaoAYYhR zvvuf1dAx7RKPmwOoX5GIRxPbUPXKBOmKe+FrMvgTHMVjjtxs7eLDKCw4bYPN++ptM L49fFn+nNpKF2gdMRCk+xCsmqpyckVOf6WdPh1sXol+2DKlC+eUvrpym4nQBoQNlw6 qkruiHkuE0t2zwr68aFX4cDj8DFpKe7uoHUl9eMWi8trQTMNBWwXsIGkU7IK5Dk+of Ml5542V4r7GFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1243A5FF82; Tue, 6 Jan 2026 15:04:37 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 61NL2pjcJ13L; Tue, 6 Jan 2026 15:04:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737072; bh=4OXC/J5dBnUVsQ2rt5GEF7JSAZpRHztF3XAlixjMfCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PxjQCNkiX09wSKTukOwCXk3dBQ1K3B8uW4YcwFimcriSGcr6DopFOUIz9zZ5xl//h fpPaKmIjETyq1l0in2WsluwHnMUGeio1oiL/Fk2b7fM0x8FDtU6GAofXvdHF+ghm0B x46k2Cx7U30L0uygnufgp/rD7ZZA4xngVqdHwMwMrdHOPQM7xRejqZrLlhqwIfCpp0 WkCfRiwEuFf2r4u01Nf8/Iv8cPv96RsXExk4nxMAbcts/+xSSYihVTUdBwoPLy6RqS dgTspCmyRousZrYE5rsd6qR4PjF/dqvytfAl3WNvYlV0b4ml30COX2gjRsdvmBnHw0 UDRxv4nuEShhQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8D19A69146; Tue, 6 Jan 2026 15:04:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:22 -0700 Message-ID: <20260106220403.2915630-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260106220403.2915630-1-sjg@u-boot.org> References: <20260106220403.2915630-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HYLM65JPGV4WY52X4HO5UGIXRGMISWL2 X-Message-ID-Hash: HYLM65JPGV4WY52X4HO5UGIXRGMISWL2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/29] buildman: Add explicit encoding to open() calls List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add encoding='utf-8' to all open() calls to avoid implicit encoding assumptions. This fixes pylint W1514 (unspecified-encoding) warnings. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 63456542b54..7582f178e8c 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -761,7 +761,7 @@ class Builder: """ config = {} if os.path.exists(fname): - with open(fname) as fd: + with open(fname, encoding='utf-8') as fd: for line in fd: line = line.strip() if line.startswith('#define'): @@ -797,7 +797,7 @@ class Builder: """ environment = {} if os.path.exists(fname): - with open(fname) as fd: + with open(fname, encoding='utf-8') as fd: for line in fd.read().split('\0'): try: key, value = line.split('=', 1) @@ -828,7 +828,7 @@ class Builder: config = {} environment = {} if os.path.exists(done_file): - with open(done_file, 'r') as fd: + with open(done_file, 'r', encoding='utf-8') as fd: try: return_code = int(fd.readline()) except ValueError: @@ -838,7 +838,7 @@ class Builder: err_lines = [] err_file = self.get_err_file(commit_upto, target) if os.path.exists(err_file): - with open(err_file, 'r') as fd: + with open(err_file, 'r', encoding='utf-8') as fd: err_lines = self.filter_errors(fd.readlines()) # Decide whether the build was ok, failed or created warnings @@ -851,7 +851,7 @@ class Builder: # Convert size information to our simple format if os.path.exists(sizes_file): - with open(sizes_file, 'r') as fd: + with open(sizes_file, 'r', encoding='utf-8') as fd: for line in fd.readlines(): values = line.split() rodata = 0 @@ -870,7 +870,7 @@ class Builder: if read_func_sizes: pattern = self.get_func_sizes_file(commit_upto, target, '*') for fname in glob.glob(pattern): - with open(fname, 'r') as fd: + with open(fname, 'r', encoding='utf-8') as fd: dict_name = os.path.basename(fname).replace('.sizes', '') func_sizes[dict_name] = self.read_func_sizes(fname, fd)