Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
image-info: don't use readfp() on configparser
Browse files Browse the repository at this point in the history
  • Loading branch information
thozza committed Jul 23, 2024
1 parent e54feab commit a132a33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/image-info
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a132a33

Please sign in to comment.