Usage statistics: no country for clock-rule zones, and Johnston Atoll is UM

From review: EET and WET link to Athens and Lisbon but name clock rules,
not Greece or Portugal, so they and the other rule names (CET, EST5EDT, …)
send nothing. Pacific/Johnston has left zone.tab, which made its Honolulu
group look only American; it's set to UM by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-10-14 13:01:46 +11:00
1 parent e9b02d61e7
commit bcdb4c3b78
3 files changed
+12 -10

No files matched your search

+8 -1
View File
@@ -34,9 +34,16 @@ def resolve(z):
countries_of = {}
for zone, cc in country.items():
countries_of.setdefault(resolve(zone), set()).add(cc)
# Clock rules rather than places (EET links to Athens, WET to Lisbon): no country.
GENERIC = {'CET', 'EET', 'MET', 'WET', 'EST', 'MST', 'HST', 'CST6CDT', 'EST5EDT', 'MST7MDT', 'PST8PDT'}
# Places that have left zone.tab, so their target's group looks like another country's.
PLACES = {'Pacific/Johnston': 'UM'}
dropped = []
for alias in links:
if alias in country:
if alias in country or alias in GENERIC or alias.startswith('Etc/'):
continue
if alias in PLACES:
country[alias] = PLACES[alias]
continue
ccs = countries_of.get(resolve(alias), set())
if len(ccs) == 1:
+3 -1
View File
@@ -172,7 +172,9 @@ class Lifecycle(Base):
for tz, want in (("America/Argentina/Buenos_Aires", "AR"), ("Asia/Calcutta", "IN"), ("US/Pacific", "US"),
("Europe/Vaduz", "LI"), ("Africa/Asmera", "ER"), ("Africa/Asmara", "ER"), ("Pacific/Truk", "FM"),
("Pacific/Ponape", "FM"), ("America/Montreal", "CA"), ("America/Nassau", "BS"),
("Europe/Amsterdam", "NL"), ("Etc/GMT+10", None), ("CET", None), ("UTC", None), ("alice", None),
("Europe/Amsterdam", "NL"), ("Etc/GMT+10", None), ("CET", None),
("EET", None), ("WET", None), ("PST8PDT", None), ("HST", None), ("Pacific/Johnston", "UM"),
("Japan", "JP"), ("UTC", None), ("alice", None),
("home/alex/private", None), ("America/alex", None), ("../etc/passwd", None)):
with mock.patch.dict(os.environ, {"FRAME_CONTROL_TIMEZONE": tz}):
self.assertEqual(tm.country(), want, tz)
+1 -8
View File
@@ -376,7 +376,6 @@ COUNTRY = {
'Brazil/DeNoronha': 'BR',
'Brazil/East': 'BR',
'Brazil/West': 'BR',
'CST6CDT': 'US',
'Canada/Atlantic': 'CA',
'Canada/Central': 'CA',
'Canada/Eastern': 'CA',
@@ -388,8 +387,6 @@ COUNTRY = {
'Chile/Continental': 'CL',
'Chile/EasterIsland': 'CL',
'Cuba': 'CU',
'EET': 'GR',
'EST5EDT': 'US',
'Egypt': 'EG',
'Eire': 'IE',
'Europe/Amsterdam': 'NL',
@@ -458,7 +455,6 @@ COUNTRY = {
'Europe/Zurich': 'CH',
'GB': 'GB',
'GB-Eire': 'GB',
'HST': 'US',
'Hongkong': 'HK',
'Iceland': 'IS',
'Indian/Antananarivo': 'MG',
@@ -478,7 +474,6 @@ COUNTRY = {
'Japan': 'JP',
'Kwajalein': 'MH',
'Libya': 'LY',
'MST7MDT': 'US',
'Mexico/BajaNorte': 'MX',
'Mexico/BajaSur': 'MX',
'Mexico/General': 'MX',
@@ -486,7 +481,6 @@ COUNTRY = {
'NZ-CHAT': 'NZ',
'Navajo': 'US',
'PRC': 'CN',
'PST8PDT': 'US',
'Pacific/Apia': 'WS',
'Pacific/Auckland': 'NZ',
'Pacific/Bougainville': 'PG',
@@ -503,7 +497,7 @@ COUNTRY = {
'Pacific/Guadalcanal': 'SB',
'Pacific/Guam': 'GU',
'Pacific/Honolulu': 'US',
'Pacific/Johnston': 'US',
'Pacific/Johnston': 'UM',
'Pacific/Kanton': 'KI',
'Pacific/Kiritimati': 'KI',
'Pacific/Kosrae': 'FM',
@@ -550,5 +544,4 @@ COUNTRY = {
'US/Pacific': 'US',
'US/Samoa': 'AS',
'W-SU': 'RU',
'WET': 'PT',
}