From 3cb423c2805524de8f7ec6a664d3def33859420a Mon Sep 17 00:00:00 2001 From: niemeyer <> Date: Thu, 28 Feb 2008 05:00:57 +0000 Subject: Fixed DST signal handling in zoneinfo files. Reported by Nicholas F. Fabry and John-Mark Gurney. (that changeset adds just the test, the actual fix was committed in the last revision by mistake). --- NEWS | 4 +++- test.py | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 27fd1cc..fd54ae0 100644 --- a/NEWS +++ b/NEWS @@ -14,7 +14,9 @@ Version 1.4 - Calls like gettz("GMT+3") and gettz("UTC-2") will now return the expected values, instead of the TZ variable behavior. - + +- Fixed DST signal handling in zoneinfo files. Reported by + Nicholas F. Fabry and John-Mark Gurney. Version 1.3 diff --git a/test.py b/test.py index b7ad75e..f58a558 100644 --- a/test.py +++ b/test.py @@ -3877,6 +3877,15 @@ END:VTIMEZONE self.assertEqual(datetime(2003,10,26,0,59,tzinfo=tz).tzname(), "EDT") self.assertEqual(datetime(2003,10,26,1,00,tzinfo=tz).tzname(), "EST") + def testZoneInfoOffsetSignal(self): + utc = gettz("UTC") + nyc = zoneinfo.gettz("America/New_York") + t0 = datetime(2007,11,4,0,30, tzinfo=nyc) + t1 = t0.astimezone(utc) + t2 = t1.astimezone(nyc) + self.assertEquals(t0, t2) + self.assertEquals(nyc.dst(t0), timedelta(hours=1)) + def testICalStart1(self): tz = tzical(StringIO(self.TZICAL_EST5EDT)).get() self.assertEqual(datetime(2003,4,6,1,59,tzinfo=tz).tzname(), "EST") -- cgit v1.2.1