summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Pieviläinen <tomi.pievilainen+launchpad@iki.fi>2012-03-28 18:04:02 +0300
committerTomi Pieviläinen <tomi.pievilainen+launchpad@iki.fi>2012-03-28 18:04:02 +0300
commite5515075578b4dce946e22a80ed87041405512ba (patch)
treeed182321be549b1cfd8cbdc6eb4eb610c9692764
parent4e5cd8f57f07f634411034a1571c23decb15aad1 (diff)
downloaddateutil-e5515075578b4dce946e22a80ed87041405512ba.tar.gz
Change tzdata ftp server and processing
Due to Astrolabe lawsuite, the tzdata is now hosted at IANA. It seems like something has changed in the file ordering too, so that backwards now needs to be explicitly ordered as last to make links work (there was a bug that UTC wasn't linked to Etc/UTC, for example).
-rw-r--r--dateutil/zoneinfo/__init__.py5
-rwxr-xr-xupdatezinfo.py10
2 files changed, 9 insertions, 6 deletions
diff --git a/dateutil/zoneinfo/__init__.py b/dateutil/zoneinfo/__init__.py
index 0ffb294..a1b3487 100644
--- a/dateutil/zoneinfo/__init__.py
+++ b/dateutil/zoneinfo/__init__.py
@@ -66,7 +66,10 @@ def rebuild(filename, tag=None, format="gz"):
targetname = "zoneinfo%s.tar.%s" % (tag, format)
try:
tf = TarFile.open(filename)
- for name in tf.getnames():
+ # The "backwards" zone file contains links to other files, so must be
+ # processed as last
+ for name in sorted(tf.getnames(),
+ key=lambda k: k != "backward" and k or "z"):
if not (name.endswith(".sh") or
name.endswith(".tab") or
name == "leapseconds"):
diff --git a/updatezinfo.py b/updatezinfo.py
index 415b8c3..46b3cf7 100755
--- a/updatezinfo.py
+++ b/updatezinfo.py
@@ -1,12 +1,12 @@
#!/usr/bin/python
-from dateutil.zoneinfo import rebuild
-import shutil
-import sys
import os
import re
+import sys
+
+from dateutil.zoneinfo import rebuild
-SERVER = "elsie.nci.nih.gov"
-DIR = "/pub"
+SERVER = "ftp.iana.org"
+DIR = "/tz"
NAME = re.compile("tzdata(.*).tar.gz")
def main():