From a132a338e77490b2c96823f034c3d6ee95005283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Tue, 23 Jul 2024 11:33:16 +0200 Subject: [PATCH] image-info: don't use readfp() on configparser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix https://gitlab.com/redhat/services/products/image-builder/ci/manifest-db/-/jobs/7403518528#L2132 Signed-off-by: Tomáš Hozza --- tools/image-info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/image-info b/tools/image-info index 5d96a3af..fa51d1b5 100755 --- a/tools/image-info +++ b/tools/image-info @@ -2110,11 +2110,11 @@ def _read_inifile_to_dict(config_path): result = {} with contextlib.suppress(FileNotFoundError): - with open(config_path) as f: + with open(config_path, encoding="utf-8") as f: parser = configparser.RawConfigParser() # prevent conversion of the opion name to lowercase parser.optionxform = lambda option: option - parser.readfp(f) + parser.read_file(f) for section in parser.sections(): section_config = dict(parser.items(section))