=== modified file 'src/pytz/tests/test_tzinfo.py' --- src/pytz/tests/test_tzinfo.py 2011-10-04 04:13:01 +0000 +++ src/pytz/tests/test_tzinfo.py 2011-11-02 12:29:11 +0000 @@ -701,6 +701,15 @@ self.assertFalse('Europe/Belfast' in pytz.common_timezones_set) +class PacificApiaTestCase(unittest.TestCase): + def test_dst(self): + tz = pytz.timezone('Pacific/Apia') + before_leap = datetime(2011, 11, 1) + after_leap = datetime(2012, 2, 1) + self.assertEqual(tz.dst(before_leap), timedelta(hours=1)) + self.assertEqual(tz.dst(after_leap), timedelta(hours=1)) + + def test_suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite('pytz')) === modified file 'src/pytz/tzfile.py' --- src/pytz/tzfile.py 2011-02-08 10:18:52 +0000 +++ src/pytz/tzfile.py 2011-11-02 12:28:28 +0000 @@ -112,7 +112,7 @@ # might be up to plus or minus 30 seconds out, but it is # the best we can do. utcoffset = int((utcoffset + 30) // 60) * 60 - dst = int((dst + 30) // 60) * 60 + dst = int((dst + 30) // 60) * 60 % (24 * 60 * 60) transition_info.append(memorized_ttinfo(utcoffset, dst, tzname)) cls = type(zone, (DstTzInfo,), dict(