Repository navigation
fix(tz): map the Windows zones CLDR already names - #1059
Cherith1222 wants to merge 2 commits into
Conversation
Muguett-DBY
left a comment
There was a problem hiding this comment.
Checked ab35f7d against the pinned CLDR c4bb2c199c data. All 142 territory-001 IDs are covered. The nine changed entries match CLDR, and the two existing alias spellings retain equivalent offsets across the dates checked.
On native Windows/Python 3.12, I exercised pendulum.now() for every mapped ID, with and without a NUL tail, by substituting EnumValue results while using real registry handles. The suffix fallback and unknown-name error also behave as expected. No registry values or OS settings were changed.
With tzdata 2026.5, all 710 CLDR offset comparisons pass on each OS, including dates after the Canadian change. The full suite passes on Windows and Linux in both pure-Python and Rust-extension modes with the lockfile's dateutil 2.9.0.post0. Restoring only the base mapping makes nine of the ten mapping tests fail; restoring this head passes all ten. Validation run.
Fresh dateutil 3.0.0 exposes an unrelated existing fixture failure on unchanged master too; it does not come from this table change. I've kept the test-only correction separate in #1072.
AI-assisted review with Codex. This verifies mapping and lookup behavior; it does not claim to test Windows automatic timezone selection or the October Windows update itself.
Why
On Windows,
pendulum.now()looks upTimeZoneKeyNamein a fixed table and raisesLookupErrorwhen the name is missing. CLDR's territory 001 rows already name seven of those zones, including the Canada zones Windows added in October 2026. Two older rows also point at zones that no longer share the Windows offset.What changed
Scope
Europe/KyivandEtc/GMTspellings as they are.tzdatarequirement. Winnipeg's offset after 1 November 2026 still depends on a currenttzdata.Tradeoffs
Keeping Asia/Almaty and America/Chihuahua would preserve offsets that are an hour away from the Windows zone. This table already follows CLDR's territory 001 row for the other names.
Blast Radius
pendulum.now()on Windows reads this table. Machines on the new Canada zones stop raising. Machines on Central Asia Standard Time or Mountain Standard Time (Mexico) follow the CLDR zone.Verification
KeyError. Central Asia wasAsia/Almaty, and Mountain Standard Time (Mexico) wasAmerica/Chihuahua.py -3.13 -m pytest tests/tz/test_local_timezone.py -qreported 11 passed and 3 skipped. The skipped tests are the Unix-only cases.Asia/Taipei.Fixes #1058
Drafted with Cursor.