[Vobject] Bug in icalendar.py

Cyrus Daboo cyrus+lists.vobject at daboo.name
Fri Jul 7 13:35:41 CDT 2006


Hi,
In icalendar.py, line 383:

  if until is not None and until.tzinfo != dtstart.tzinfo:

This cases an exception when dtstart is a datetime.date object and not a 
datetime.datetime object (which can happen when DTSTART;VALUE=DATE is used).

The following fix seem to do the trick:

  if until is not None and isinstance(dtstart, datetime.datetime) and 
(until.tzinfo != dtstart.tzinfo):

However, I'm not totally sure what all this 'until' testing is about at 
that point in the code so I would prefer someone else to examine this and 
make sure the fix is appropriate before going ahead and committing it.

-- 
Cyrus Daboo



More information about the VObject mailing list