From patchwork Fri Sep 12 12:55:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24349 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E2890C324E for ; Fri, 12 Sep 2025 12:55:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B95FC69367; Fri, 12 Sep 2025 14:55:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uoUJzZQi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 408FA69367 for ; Fri, 12 Sep 2025 14:55:34 +0200 (CEST) Received: from pb-laptop.local (185.221.142.115.nat.pool.zt.hu [185.221.142.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1EF1FC6E; Fri, 12 Sep 2025 14:54:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1757681658; bh=e/G19yM/wrBv1C/0sDFJW6ys5NsuwKRGFiM/Jkf3xSQ=; h=From:To:Subject:Date:From; b=uoUJzZQiFBVsOxmfouSI6a9T+H9TA6EnCfZ1hZud8BKEi17vpgDtY6DcSSNopwmzv jv23HlQfwXk/wrtb4DdQNBwT5PRNx5rMA8jjx5zp18ik2Hb2ggJs/+3PWwvrXrT7+b VCmUP7faboFfT6XvNyPVkRcsKLclkgz67j5R/lG4= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org, Laurent Pinchart Subject: [RFC PATCH v2 1/2] py: gen-py-formats.py: Open input file in binary mode Date: Fri, 12 Sep 2025 14:55:27 +0200 Message-ID: <20250912125528.1963619-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Other code generation scripts do that already and let pyyaml deal with decoding utf-8, etc. So do the same here as well. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/py/libcamera/gen-py-formats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/libcamera/gen-py-formats.py b/src/py/libcamera/gen-py-formats.py index 0ff1d12ac..6323e237f 100755 --- a/src/py/libcamera/gen-py-formats.py +++ b/src/py/libcamera/gen-py-formats.py @@ -37,7 +37,7 @@ def main(argv): help='Template file name.') args = parser.parse_args(argv[1:]) - with open(args.input, encoding='utf-8') as f: + with open(args.input, 'rb') as f: formats = yaml.safe_load(f)['formats'] data = generate(formats)