]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tools/postcodes.py
Merge pull request #2709 from lonvia/less-strict-country-assignment
[nominatim.git] / nominatim / tools / postcodes.py
index cd778e5f975e7fdccd611f6d611281cfd2dff696..2b7027e721b04cd3775e5495459920fecebbc5c6 100644 (file)
@@ -36,7 +36,7 @@ class _CountryPostcodesCollector:
 
     def __init__(self, country):
         self.country = country
-        self.collected = dict()
+        self.collected = {}
 
 
     def add(self, postcode, x, y):
@@ -140,7 +140,7 @@ class _CountryPostcodesCollector:
 
         if fname.is_file():
             LOG.info("Using external postcode file '%s'.", fname)
-            return open(fname, 'r')
+            return open(fname, 'r', encoding='utf-8')
 
         fname = project_dir / f'{self.country}_postcodes.csv.gz'