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

Subscribers

People subscribed via source and target branches