X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fd4ab3f262b0589f8c6fe475d166b412ac5beb76..815e3cccf6840d935e5a708588700cca23b976e9:/nominatim/config.py diff --git a/nominatim/config.py b/nominatim/config.py index 13d9cd8a..ef261079 100644 --- a/nominatim/config.py +++ b/nominatim/config.py @@ -144,7 +144,7 @@ class Configuration: style = self.__getattr__('IMPORT_STYLE') if style in ('admin', 'street', 'address', 'full', 'extratags'): - return self.config_dir / 'import-{}.style'.format(style) + return self.config_dir / f'import-{style}.style' return self.find_config_file('', 'IMPORT_STYLE') @@ -187,7 +187,7 @@ class Configuration: if configfile.suffix in ('.yaml', '.yml'): result = self._load_from_yaml(configfile) elif configfile.suffix == '.json': - with configfile.open('r') as cfg: + with configfile.open('r', encoding='utf-8') as cfg: result = json.load(cfg) else: raise UsageError(f"Config file '{configfile}' has unknown format.")