diff options
Diffstat (limited to 'dateutil/zoneinfo/__init__.py')
-rw-r--r-- | dateutil/zoneinfo/__init__.py | 5 |
1 files changed, 4 insertions, 1 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"): |