Company map: the country hint reads GeoNames' capital and postal-code columns as country names #534
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#534
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingjobs/places.pyagainst the realcountryInfo.txtand resolving sample locations with it.Related to #108.
Checked again on 2026-10-01 against
mainat0a5cad587: still present._countries()builds the table of country names that narrows a city match, but it reads the wrong columns. In GeoNames'countryInfo.txtcolumn 4 is the country's English name, column 5 is its capital and column 13 is the postal-code format; there is no column of names by language. So every capital city becomes a "country", and no country name other than the English one is ever a hint. The tests pass because their fixture invents the layout the code expects.jobs/places.py:111-136(_countries:candidates = [columns[4], columns[5]], thencolumns[13].split(";")parsed asLanguage:Name; the header line, which starts with#ISO, is not skipped);jobs/places.py:169-175(resolve: a hint whose codes exclude every candidate returnsNone);tests/test_places.py:52-73and:88-101,tests/test_fetch_geonames.py:52-65and:81-93(country_rowrepeats the name in the capital column and putsEnglish:Germany;German:Deutschlandwhere the real file has the postal-code format)._countries()["victoria"]is{"SC"},["kingston"]is{"JM", "NF"},["washington"]is{"US"}and["country"]is{"#ISO"}. So:resolve("Melbourne, Victoria")andresolve("Geelong, Victoria")areNone, because Victoria is read as the Seychelles.resolve("Valencia, España")is Valencia in Venezuela,resolve("Córdoba, España")is Córdoba in Argentina andresolve("León, España")is León in Mexico, while"Valencia, Spain"is placed in Spain.#; drop the capital and the column-13 parsing. Names in other languages need a real source, fetched with the tables: GeoNames' alternate names for the countries' owngeonameid(column 16), filtered to those ids whenfetch_geonamesruns, or CLDR's territory names; either is folded and mapped to the ISO code. Rewrite the fixtures in both test files from realcountryInfo.txtrows, and correct the_countriesdocstring.Done when
tests/test_places.pybuilds its country table from realcountryInfo.txtrows and has tests thatresolve("Melbourne, Victoria")is placed in Australia andresolve("Valencia, España")in Spain; both fail today.