Merge lp:~ahasenack/ubuntu/precise/python-tz/day-leap-fix-885163 into lp:ubuntu/precise/python-tz

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 25
Proposed branch: lp:~ahasenack/ubuntu/precise/python-tz/day-leap-fix-885163
Merge into: lp:ubuntu/precise/python-tz
Diff against target: 71 lines (+52/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/samoa-idl (+44/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~ahasenack/ubuntu/precise/python-tz/day-leap-fix-885163
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+87407@code.launchpad.net

Description of the change

This branch has the patch from bug #885163, done by Forest Bond. I tested it in oneiric and lucid and I intend to do an SRU release for those plus natty and maverick. The first step is to get this into precise.

My testcase was Landscape, which had a few broken pages due to this bug. With the patched package installed, Landscape worked again (tested on lucid and oneiric).

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This other test case, taken from a bug comment, can also be used:

#!/usr/bin/python
import pytz
from datetime import datetime
tz = pytz.timezone("Pacific/Apia")
d2 = datetime(2012,1,1)
local = tz.localize(d2)
local.dst()
print "All is good, NOT hit by bug #885163!"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-11-08 15:47:51 +0000
3+++ debian/changelog 2012-01-03 19:50:45 +0000
4@@ -1,3 +1,10 @@
5+python-tz (2011k-0ubuntu3) precise; urgency=low
6+
7+ [ Forest Bond ]
8+ * Add patch samoa-idl (LP: #885163).
9+
10+ -- Andreas Hasenack <andreas@canonical.com> Tue, 03 Jan 2012 17:37:59 -0200
11+
12 python-tz (2011k-0ubuntu2) precise; urgency=low
13
14 * debian/patches/tzdata: Restore patch to use tzdata package for
15
16=== added file 'debian/patches/samoa-idl'
17--- debian/patches/samoa-idl 1970-01-01 00:00:00 +0000
18+++ debian/patches/samoa-idl 2012-01-03 19:50:45 +0000
19@@ -0,0 +1,44 @@
20+=== modified file 'pytz/pytz/tests/test_tzinfo.py'
21+--- pytz.orig/pytz/tests/test_tzinfo.py 2011-11-04 09:32:28 +0000
22++++ pytz/pytz/tests/test_tzinfo.py 2011-11-04 09:59:20 +0000
23+@@ -533,6 +533,24 @@
24+ }
25+
26+
27++class SamoaInternationalDateLineChange(USEasternDSTStartTestCase):
28++ # At the end of 2011, Samoa will switch from being east of the
29++ # international dateline to the west. There will be no Dec 30th
30++ # 2011 and it will switch from UTC-11 to UTC+13.
31++ tzinfo = pytz.timezone('Pacific/Apia')
32++ transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
33++ before = {
34++ 'tzname': 'WSDT',
35++ 'utcoffset': timedelta(hours=-10),
36++ 'dst': timedelta(hours=1),
37++ }
38++ after = {
39++ 'tzname': 'WSDT',
40++ 'utcoffset': timedelta(hours=14),
41++ 'dst': timedelta(hours=1),
42++ }
43++
44++
45+ class ReferenceUSEasternDSTStartTestCase(USEasternDSTStartTestCase):
46+ tzinfo = reference.Eastern
47+ def test_arithmetic(self):
48+
49+=== modified file 'src/pytz/tzfile.py'
50+--- src/pytz/tzfile.py 2011-02-08 10:18:52 +0000
51++++ src/pytz/tzfile.py 2011-11-04 10:32:42 +0000
52+@@ -97,7 +97,9 @@
53+ break
54+ dst = inf[0] - prev_inf[0] # dst offset
55+
56+- if dst <= 0: # Bad dst? Look further.
57++ # Bad dst? Look further. DST > 24 hours happens when
58++ # a timzone has moved across the international dateline.
59++ if dst <= 0 or dst > 3600*3:
60+ for j in range(i+1, len(transitions)):
61+ stdinf = ttinfo[lindexes[j]]
62+ if not stdinf[1]:
63+
64
65=== modified file 'debian/patches/series'
66--- debian/patches/series 2011-11-08 15:47:51 +0000
67+++ debian/patches/series 2012-01-03 19:50:45 +0000
68@@ -1,2 +1,3 @@
69 tzdata
70+samoa-idl
71 debian-changes-2011k-0ubuntu2

Subscribers

People subscribed via source and target branches