From: Sarah Hoffmann Date: Wed, 30 Apr 2025 08:49:37 +0000 (+0200) Subject: release 5.1.0.post6 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/refs/heads/master?hp=ba57ce6ffbd5efc17366d969e0c73e75c5290083 release 5.1.0.post6 --- diff --git a/packaging/nominatim-api/pyproject.toml b/packaging/nominatim-api/pyproject.toml index b7970029..dce6b9d0 100644 --- a/packaging/nominatim-api/pyproject.toml +++ b/packaging/nominatim-api/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nominatim-api" -version = "5.1.0.post4" +version = "5.1.0.post6" description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Search library." readme = "README.md" requires-python = ">=3.7" diff --git a/packaging/nominatim-db/pyproject.toml b/packaging/nominatim-db/pyproject.toml index d9df9f66..c4ba5958 100644 --- a/packaging/nominatim-db/pyproject.toml +++ b/packaging/nominatim-db/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nominatim-db" -version = "5.1.0.post4" +version = "5.1.0.post6" description = "A tool for building a database of OpenStreetMap for geocoding and for searching the database. Database backend." readme = "README.md" requires-python = ">=3.7" @@ -21,7 +21,7 @@ dependencies = [ "jinja2==3.1.6", "pyYAML==6.0.2", "psutil==7.0.0", - "PyICU==2.15", + "PyICU==2.15.2", "osmium==4.0.2", ] diff --git a/src/nominatim_api/search/token_assignment.py b/src/nominatim_api/search/token_assignment.py index a0df7d03..4247158c 100644 --- a/src/nominatim_api/search/token_assignment.py +++ b/src/nominatim_api/search/token_assignment.py @@ -287,7 +287,7 @@ class _TokenSequence: return penalty = self.penalty - if self.direction == 1 and query.dir_penalty > 0: + if not base.country and self.direction == 1 and query.dir_penalty > 0: penalty += query.dir_penalty log().comment('first word = name') @@ -332,7 +332,7 @@ class _TokenSequence: return penalty = self.penalty - if self.direction == -1 and query.dir_penalty < 0: + if not base.country and self.direction == -1 and query.dir_penalty < 0: penalty -= query.dir_penalty if self.direction == -1 or len(base.address) > 1 or base.postcode: diff --git a/src/nominatim_api/v1/format_xml.py b/src/nominatim_api/v1/format_xml.py index b3f0e562..ed6aca0a 100644 --- a/src/nominatim_api/v1/format_xml.py +++ b/src/nominatim_api/v1/format_xml.py @@ -90,7 +90,7 @@ def format_base_xml(results: Union[ReverseResults, SearchResults], result will be output, otherwise a list. """ root = ET.Element(xml_root_tag) - root.set('timestamp', dt.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S +00:00')) + root.set('timestamp', dt.datetime.now(dt.timezone.utc).strftime('%a, %d %b %Y %H:%M:%S +00:00')) root.set('attribution', cl.OSM_ATTRIBUTION) for k, v in xml_extra_info.items(): root.set(k, v)