I get a strange exception when trying to write a iCalendar stream using
datetime values with the timezone set. This is the output from the test
script below:
VCALENDAR
VEVENT
DTSTART: 2002-01-07 12:15:00+01:00
UID: unique-uid
SUMMARY: summary
Traceback (most recent call last):
File "<stdin>", line 20, in <module>
File "<stdin>", line 15, in main
File "/usr/lib/pymodules/python2.7/vobject/base.py", line 186, in serialize
return behavior.serialize(self, buf, lineLength, validate)
File "/usr/lib/pymodules/python2.7/vobject/behavior.py", line 147, in serialize
cls.generateImplicitParameters(obj)
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 875, in generateImplicitParameters
obj.add(TimezoneComponent(tzinfo=getTzid(tzid)))
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 75, in __init__
self.tzinfo = tzinfo
File "/usr/lib/pymodules/python2.7/vobject/base.py", line 499, in __setattr__
prop.fset(self, value)
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 145, in settzinfo
transition = getTransition(transitionTo, year, tzinfo)
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 1897, in getTransition
uncorrected = firstTransition(generateDates(year, month, day), test)
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 1857, in firstTransition
if not test(dt):
File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 1884, in test
def test(dt): return tzinfo.dst(dt) != zeroDelta
File "/usr/lib/python2.7/dist-packages/pytz/tzinfo.py", line 445, in dst
dt = self.localize(dt, is_dst)
File "/usr/lib/python2.7/dist-packages/pytz/tzinfo.py", line 327, in localize
raise NonExistentTimeError(dt)
pytz.exceptions.NonExistentTimeError: 2000-03-26 02:00:00
I expected a iCalendar file with the dtstart value stored with timezone
information. This is how to reproduce the problem:
Import from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851982
I get a strange exception when trying to write a iCalendar stream using datetime values with the timezone set. This is the output from the test script below:
I expected a iCalendar file with the dtstart value stored with timezone information. This is how to reproduce the problem:
Is there a bug in the library or am I using it wrong?