From 901aae13c1bcbeb89f02b62ae75acda4d6c87b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 12 Sep 2025 10:01:49 +0200 Subject: [PATCH] py: gen-py-formats.py: Open input file in binary mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jacopo Mondi --- 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 0ff1d12a..6323e237 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)