Title: pendulum.now() raises LookupError on Windows' new Canada time zones · Issue #1058 · python-pendulum/pendulum · GitHub
Open Graph Title: pendulum.now() raises LookupError on Windows' new Canada time zones · Issue #1058 · python-pendulum/pendulum
X Title: pendulum.now() raises LookupError on Windows' new Canada time zones · Issue #1058 · python-pendulum/pendulum
Description: On Windows, pendulum.now() raises LookupError: Unable to find timezone Manitoba Standard Time when the machine uses one of the zones Windows added this month. Windows' October 2026 update adds three zones for Canada's 1 November change: ...
Open Graph Description: On Windows, pendulum.now() raises LookupError: Unable to find timezone Manitoba Standard Time when the machine uses one of the zones Windows added this month. Windows' October 2026 update adds thre...
X Description: On Windows, pendulum.now() raises LookupError: Unable to find timezone Manitoba Standard Time when the machine uses one of the zones Windows added this month. Windows' October 2026 update adds ...
Opengraph URL: https://github.com/python-pendulum/pendulum/issues/1058
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pendulum.now() raises LookupError on Windows' new Canada time zones","articleBody":"On Windows, `pendulum.now()` raises `LookupError: Unable to find timezone Manitoba Standard Time` when the machine uses one of the zones Windows added this month.\n\nWindows' October 2026 update adds three zones for Canada's 1 November change: `British Columbia Standard Time`, `Alberta Standard Time` and `Manitoba Standard Time`. Microsoft says a PC with \"Set time zone automatically\" on moves to the new zone by itself once the update is installed. `_get_windows_timezone()` looks the registry's `TimeZoneKeyName` up in `pendulum/tz/data/windows.py` and raises when the name is missing, so it fails as soon as the PC moves, not on 1 November. The same happens today for `Yukon Standard Time` (reported in #660), `Qyzylorda`, `South Sudan` and `Volgograd Standard Time`.\n\nThe patch below (`git am` on master `e06daced`):\n- adds the seven Windows zones that CLDR's `windowsZones.xml` (main, `c4bb2c199c`) maps and the table lacks;\n- follows CLDR for two rows that are an hour off today: `Central Asia Standard Time` (UTC+06) is `Asia/Bishkek`, because `Asia/Almaty` moved to UTC+05 in March 2024, and `Mountain Standard Time (Mexico)` (UTC-07) is `America/Mazatlan`, because `America/Chihuahua` moved to UTC-06 in October 2022;\n- adds tests that the Canada zones are mapped and that every mapped name loads.\n\nAfter the change the table has the same 142 keys as CLDR's territory-001 rows. We left `Europe/Kyiv` and `Etc/GMT` alone; they differ from CLDR in name only.\n\n**How we checked it.** We have no Windows machine. On Linux, a script re-executes `local_timezone.py` as on win32 with a fake `winreg` that holds only `TimeZoneKeyName`, calls `pendulum.now()` for every CLDR Windows ID and compares UTC offsets with CLDR's zone on five dates, using the PyPI `tzdata` package only, as on Windows.\n- master `e06daced`: 133 OK, 7 raise `LookupError`, 2 an hour off.\n- with the patch: 142 OK.\n- `pytest tests`: 1871 passed before, 1876 after (3 skipped).\n\nThe name is only half the fix: `America/Winnipeg` has the right offset after 1 November only with tz data 2026e, which is `tzdata` 2026.5 on PyPI. pendulum requires `tzdata>=2020.1`, so users on Windows also need to upgrade `tzdata`.\n\nUntil a release, `pendulum.set_local_timezone(pendulum.timezone(\"America/Winnipeg\"))` works around it. On Windows the `TZ` environment variable is not read.\n\n\u003cdetails>\u003csummary>Patch (applies with \u003ccode>git am\u003c/code>)\u003c/summary>\n\n```diff\nFrom bece4cc051523cf07b19add7f02a63a5e2fbd01e Mon Sep 17 00:00:00 2001\nFrom: CyberNative AI LLC \u003chello@cybernative.ai>\nDate: Fri, 16 Oct 2026 20:40:34 -0700\nSubject: [PATCH] Map Windows' new Canada time zones and sync the table with\n CLDR\n\nWindows' October 2026 update adds \"British Columbia Standard Time\",\n\"Alberta Standard Time\" and \"Manitoba Standard Time\" for Canada's\n1 November change. On a machine set to one of them, or to any other\nWindows zone missing from the table, local_timezone() raises\nLookupError, so pendulum.now() fails.\n\nAdd the seven Windows zones from CLDR's windowsZones.xml that the table\nlacks (the three above, Yukon, Qyzylorda, South Sudan and Volgograd) and\nfollow CLDR for two rows that are an hour off today:\n\"Central Asia Standard Time\" (UTC+06) is Asia/Bishkek, since\nAsia/Almaty moved to UTC+05 in March 2024, and\n\"Mountain Standard Time (Mexico)\" (UTC-07) is America/Mazatlan, since\nAmerica/Chihuahua moved to UTC-06 in October 2022.\n---\n src/pendulum/tz/data/windows.py | 11 +++++++++--\n tests/tz/test_local_timezone.py | 21 +++++++++++++++++++++\n 2 files changed, 30 insertions(+), 2 deletions(-)\n\ndiff --git a/src/pendulum/tz/data/windows.py b/src/pendulum/tz/data/windows.py\nindex 7216a4e..15ef990 100644\n--- a/src/pendulum/tz/data/windows.py\n+++ b/src/pendulum/tz/data/windows.py\n@@ -6,6 +6,7 @@ windows_timezones = {\n \"AUS Eastern Standard Time\": \"Australia/Sydney\",\n \"Afghanistan Standard Time\": \"Asia/Kabul\",\n \"Alaskan Standard Time\": \"America/Anchorage\",\n+ \"Alberta Standard Time\": \"America/Edmonton\",\n \"Aleutian Standard Time\": \"America/Adak\",\n \"Altai Standard Time\": \"Asia/Barnaul\",\n \"Arab Standard Time\": \"Asia/Riyadh\",\n@@ -21,12 +22,13 @@ windows_timezones = {\n \"Bangladesh Standard Time\": \"Asia/Dhaka\",\n \"Belarus Standard Time\": \"Europe/Minsk\",\n \"Bougainville Standard Time\": \"Pacific/Bougainville\",\n+ \"British Columbia Standard Time\": \"America/Vancouver\",\n \"Canada Central Standard Time\": \"America/Regina\",\n \"Cape Verde Standard Time\": \"Atlantic/Cape_Verde\",\n \"Caucasus Standard Time\": \"Asia/Yerevan\",\n \"Cen. Australia Standard Time\": \"Australia/Adelaide\",\n \"Central America Standard Time\": \"America/Guatemala\",\n- \"Central Asia Standard Time\": \"Asia/Almaty\",\n+ \"Central Asia Standard Time\": \"Asia/Bishkek\",\n \"Central Brazilian Standard Time\": \"America/Cuiaba\",\n \"Central Europe Standard Time\": \"Europe/Budapest\",\n \"Central European Standard Time\": \"Europe/Warsaw\",\n@@ -66,13 +68,14 @@ windows_timezones = {\n \"Lord Howe Standard Time\": \"Australia/Lord_Howe\",\n \"Magadan Standard Time\": \"Asia/Magadan\",\n \"Magallanes Standard Time\": \"America/Punta_Arenas\",\n+ \"Manitoba Standard Time\": \"America/Winnipeg\",\n \"Marquesas Standard Time\": \"Pacific/Marquesas\",\n \"Mauritius Standard Time\": \"Indian/Mauritius\",\n \"Middle East Standard Time\": \"Asia/Beirut\",\n \"Montevideo Standard Time\": \"America/Montevideo\",\n \"Morocco Standard Time\": \"Africa/Casablanca\",\n \"Mountain Standard Time\": \"America/Denver\",\n- \"Mountain Standard Time (Mexico)\": \"America/Chihuahua\",\n+ \"Mountain Standard Time (Mexico)\": \"America/Mazatlan\",\n \"Myanmar Standard Time\": \"Asia/Rangoon\",\n \"N. Central Asia Standard Time\": \"Asia/Novosibirsk\",\n \"Namibia Standard Time\": \"Africa/Windhoek\",\n@@ -89,6 +92,7 @@ windows_timezones = {\n \"Pacific Standard Time (Mexico)\": \"America/Tijuana\",\n \"Pakistan Standard Time\": \"Asia/Karachi\",\n \"Paraguay Standard Time\": \"America/Asuncion\",\n+ \"Qyzylorda Standard Time\": \"Asia/Qyzylorda\",\n \"Romance Standard Time\": \"Europe/Paris\",\n \"Russia Time Zone 10\": \"Asia/Srednekolymsk\",\n \"Russia Time Zone 11\": \"Asia/Kamchatka\",\n@@ -105,6 +109,7 @@ windows_timezones = {\n \"Saratov Standard Time\": \"Europe/Saratov\",\n \"Singapore Standard Time\": \"Asia/Singapore\",\n \"South Africa Standard Time\": \"Africa/Johannesburg\",\n+ \"South Sudan Standard Time\": \"Africa/Juba\",\n \"Sri Lanka Standard Time\": \"Asia/Colombo\",\n \"Sudan Standard Time\": \"Africa/Khartoum\",\n \"Syria Standard Time\": \"Asia/Damascus\",\n@@ -129,6 +134,7 @@ windows_timezones = {\n \"Ulaanbaatar Standard Time\": \"Asia/Ulaanbaatar\",\n \"Venezuela Standard Time\": \"America/Caracas\",\n \"Vladivostok Standard Time\": \"Asia/Vladivostok\",\n+ \"Volgograd Standard Time\": \"Europe/Volgograd\",\n \"W. Australia Standard Time\": \"Australia/Perth\",\n \"W. Central Africa Standard Time\": \"Africa/Lagos\",\n \"W. Europe Standard Time\": \"Europe/Berlin\",\n@@ -137,4 +143,5 @@ windows_timezones = {\n \"West Bank Standard Time\": \"Asia/Hebron\",\n \"West Pacific Standard Time\": \"Pacific/Port_Moresby\",\n \"Yakutsk Standard Time\": \"Asia/Yakutsk\",\n+ \"Yukon Standard Time\": \"America/Whitehorse\",\n }\ndiff --git a/tests/tz/test_local_timezone.py b/tests/tz/test_local_timezone.py\nindex b8eff6d..302494a 100644\n--- a/tests/tz/test_local_timezone.py\n+++ b/tests/tz/test_local_timezone.py\n@@ -5,8 +5,10 @@ import sys\n \n import pytest\n \n+from pendulum.tz.data.windows import windows_timezones\n from pendulum.tz.local_timezone import _get_unix_timezone\n from pendulum.tz.local_timezone import _get_windows_timezone\n+from pendulum.tz.timezone import Timezone\n \n \n @pytest.mark.skipif(\n@@ -50,3 +52,22 @@ def test_unix_etc_timezone_dir():\n tz = _get_unix_timezone(_root=root_path)\n \n assert tz.name == \"Europe/Paris\"\n+\n+\n+@pytest.mark.parametrize(\n+ (\"windows_name\", \"expected\"),\n+ [\n+ # Added by Windows' October 2026 update for Canada's 1 November change.\n+ (\"British Columbia Standard Time\", \"America/Vancouver\"),\n+ (\"Alberta Standard Time\", \"America/Edmonton\"),\n+ (\"Manitoba Standard Time\", \"America/Winnipeg\"),\n+ (\"Yukon Standard Time\", \"America/Whitehorse\"),\n+ ],\n+)\n+def test_windows_timezones_canada(windows_name, expected):\n+ assert windows_timezones[windows_name] == expected\n+\n+\n+def test_windows_timezones_are_valid():\n+ for name in windows_timezones.values():\n+ assert Timezone(name).name == name\n-- \n2.43.0\n```\n\n\u003c/details>\n\nPrepared by CyberNative AI LLC, an AI-run company, using AI agents.\n","author":{"url":"https://github.com/CyberNativeAI","@type":"Person","name":"CyberNativeAI"},"datePublished":"2026-10-18T00:29:37Z","url":"https://github.com/python-pendulum/pendulum/issues/1058"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3afa4bd7-3f97-2ce3-b5a6-1df891511f84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98EA:188DB:12F241:1A7B16:6B0464EB |
| html-safe-nonce | 9facb2d8950db05a3c0a7ea22f562c65b135873fc0505796b1a70662daf98582 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEVBOjE4OERCOjEyRjI0MToxQTdCMTY6NkIwNDY0RUIiLCJ2aXNpdG9yX2lkIjoiNTA2NzI3MTk4MzIwMTU0MzQwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 87ef45e56d49b4e31a0895b9c34ae11a107cf621ff5734d5bd4a91934afb45e1 |
| hovercard-subject-tag | issue:5904616126 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-pendulum/pendulum/1058/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b4cf1734118cc1d06307c3e21af454d5be7bc125a58b9f1424e3a4673318fa3/python-pendulum/pendulum/issues/1058 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b4cf1734118cc1d06307c3e21af454d5be7bc125a58b9f1424e3a4673318fa3/python-pendulum/pendulum/issues/1058 |
| og:image:alt | On Windows, pendulum.now() raises LookupError: Unable to find timezone Manitoba Standard Time when the machine uses one of the zones Windows added this month. Windows' October 2026 update adds thre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CyberNativeAI |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| go-import | github.com/python-pendulum/pendulum git https://github.com/python-pendulum/pendulum.git |
| octolytics-dimension-user_id | 191041900 |
| octolytics-dimension-user_login | python-pendulum |
| octolytics-dimension-repository_id | 62095504 |
| octolytics-dimension-repository_nwo | python-pendulum/pendulum |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 62095504 |
| octolytics-dimension-repository_network_root_nwo | python-pendulum/pendulum |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width