Skip to content

[BUGFIX] three lines where a print was used without the "f'" - #290

Merged
treee111 merged 1 commit into
treee111:developfrom
Ebe66:Fix-US-no-bordering-countries-on-Windows-error
Aug 20, 2026
Merged

[BUGFIX] three lines where a print was used without the "f'"#290
treee111 merged 1 commit into
treee111:developfrom
Ebe66:Fix-US-no-bordering-countries-on-Windows-error

Conversation

@Ebe66

@Ebe66 Ebe66 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

earlier title: Fix for error when creating a map for a US/ region without border countries

And fixed three lines where a print was used without the "f'"

When trying to generate a map file for a US/ region the program would crash on Windows (and as it turned out later also on WSL) because of the "/" in the regions name.

Pull Request Checklist

  • Reviewed the Contributing Guidelines
  • Commits (and commit-messages) are understandable
  • Tested with macOS / Linux (tested on WSL)
  • Tested with Windows

Three error messages in split_filtered_country_files_to_tiles were
missing the f-prefix, so {country} was printed literally instead of
the actual country name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@treee111
treee111 force-pushed the Fix-US-no-bordering-countries-on-Windows-error branch from 4b2f9c2 to 0c1488b Compare August 20, 2026 13:06
@treee111

Copy link
Copy Markdown
Owner

Branch updated — slash normalization removed, f-string fixes kept

Thanks for the PR! After reviewing it against the changes that landed since it was opened, I've updated the branch so only the relevant fix remains.

What was removed and why

The slash normalization changes (.replace("/", "_") / .replace("-us/","-us_") in file paths, the extra country.replace("/","_") not in tile['countries'] guard, and the country.replace("_", "/") in self.o_osm_data.border_countries check) are now redundant:

  • tile['countries'] has always been normalized — geofabrik.py replaces / with _ when building the countries list (line 190–191).
  • border_countries is now also normalized — PR [BUGFIX] Process US regions without border countries #297 added .replace('/', '_') in calc_border_countries and calc_country_name, so keys like us/texas never reach osm_maps_functions.py anymore.

Since both sides of every comparison and every file path are already slash-free, the extra .replace() calls do nothing and were removed.

What was kept

The three missing f-prefix fixes are real bugs unrelated to the slash issue — without the f, {country} is printed literally in the error message instead of the actual country name:

# before (broken — prints literal "{country}")
cmd, '! Error in osmconvert with country: {country}. Win/out_file_names')
cmd, '! Error in Osmium with country: {country}. macOS/out_file')
cmd, '! Error in Osmium with country: {country}. macOS/out_file_names')

# after (correct)
cmd, f'! Error in osmconvert with country: {country}. Win/out_file_names')
cmd, f'! Error in Osmium with country: {country}. macOS/out_file')
cmd, f'! Error in Osmium with country: {country}. macOS/out_file_names')

These three fixes are now the only change on the branch.

@treee111 treee111 changed the title Fix for error when creating a map for a US/ region without border co… [BUGFIX] three lines where a print was used without the "f'" Aug 20, 2026
@treee111
treee111 merged commit f105178 into treee111:develop Aug 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants