]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/config.py
pylint: avoid explicit use of format() function
[nominatim.git] / nominatim / config.py
index 13d9cd8a0d502e4b1f1b5ab58ca7e0761772cfaf..ef2610793bad4a8e0ea4efca62e685d6c90fee5a 100644 (file)
@@ -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.")