You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "…/site-packages/vobject/icalendar.py", line 501, in getrruleset
if rruleset._rrule[-1][0] != adddtstart:
File "…site-packages/dateutil/rrule.py", line 159, in __getitem__
res = advance_iterator(gen)
File "…/site-packages/dateutil/rrule.py", line 860, in _iter
if until and res > until:
TypeError: can't compare offset-naive and offset-aware datetimes
Actual values are:
res = datetime.datetime(2013, 1, 17, 0, 0) from DTSTART;VALUE=DATE:20130117
until = datetime.datetime(2013, 3, 30, 23, 0, tzinfo=tzutc()) from RRULE:FREQ=WEEKLY;UNTIL=20130330T230000Z;BYDAY=TH
The text was updated successfully, but these errors were encountered:
rule = rrule.rrulestr(value, dtstart=dtstart)
until = rule._until
If dtstart has no timezone, util will have a time-zone (utc) (see below).
Just behind this place there is code handling the case that until.tzinfo != dtstart.tzinfo, but only if isinstance(dtstart, datetime.datetime). I assume the case isinstance(dtstart, datetime.date). needs to be handled here, too.
Insights from my debugging-session:
> …/site-packages/vobject/icalendar.py(447)getrruleset()
-> rule = rrule.rrulestr(value, dtstart=dtstart)
(Pdb) n
> …/site-packages/vobject/icalendar.py(448)getrruleset()
-> until = rule._until
(Pdb) p dtstart
datetime.date(2013, 1, 17)
(Pdb) p until
datetime.datetime(2013, 3, 30, 23, 0, tzinfo=tzutc())
(Pdb) p rule._tzinfo
None
(Pdb) p until.tzinfo
tzutc()
The following code fails with
TypeError: can't compare offset-naive and offset-aware datetimes
.Traceback:
Actual values are:
res = datetime.datetime(2013, 1, 17, 0, 0)
fromDTSTART;VALUE=DATE:20130117
until = datetime.datetime(2013, 3, 30, 23, 0, tzinfo=tzutc())
fromRRULE:FREQ=WEEKLY;UNTIL=20130330T230000Z;BYDAY=TH
The text was updated successfully, but these errors were encountered: