Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

timezone: Improve tzdata parser’s compatibility with zic(8).

Anders Kaseorg2e9cd20380b1
diff --git a/zerver/lib/timezone.py b/zerver/lib/timezone.py
index 5c787e5249a..4b4f3a7b22c 100644
--- a/zerver/lib/timezone.py
+++ b/zerver/lib/timezone.py
@@ -9,8 +9,9 @@ def get_canonical_timezone_map() -> Dict[str, str]:
canonical = {}
with get_tzdata_zi() as f:
for line in f:
- if line.startswith("L "):
- l, name, alias = line.split()
+ fields = line.split()
+ if fields and "link".startswith(fields[0].lower()): # zic(8) accepts any prefix of Link
+ code, name, alias = fields
canonical[alias] = name
return canonical