summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart@stuartbishop.net>2011-11-04 17:32:42 +0700
committerStuart Bishop <stuart@stuartbishop.net>2011-11-04 17:32:42 +0700
commit391f15a4a31b2114d53ae5510e1c6ffe0043876c (patch)
tree6263c45f8fd8867c362e342550c36eec0b8e5af0
parentb3525169cedd766f0ee2d73672108c0720913dae (diff)
downloadpytz-391f15a4a31b2114d53ae5510e1c6ffe0043876c.tar.gz
Detect bad dst value from crossing the international date time and correct
-rw-r--r--src/pytz/tzfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pytz/tzfile.py b/src/pytz/tzfile.py
index 05944da..9c007c8 100644
--- a/src/pytz/tzfile.py
+++ b/src/pytz/tzfile.py
@@ -97,7 +97,9 @@ def build_tzinfo(zone, fp):
break
dst = inf[0] - prev_inf[0] # dst offset
- if dst <= 0: # Bad dst? Look further.
+ # Bad dst? Look further. DST > 24 hours happens when
+ # a timzone has moved across the international dateline.
+ if dst <= 0 or dst > 3600*3:
for j in range(i+1, len(transitions)):
stdinf = ttinfo[lindexes[j]]
if not stdinf[1]: