pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

EXDATE after RRULE UNTIL #591

Closed geier closed 7 years ago

geier commented 7 years ago

DTSTART;TZID=Europe/Berlin:20140526T090000 DTEND;TZID=Europe/Berlin:20140526T120000 RRULE:FREQ=WEEKLY;UNTIL=20140814T215959Z;BYDAY=MO,WE EXDATE;TZID=Europe/Berlin:20140827T090000

and this causes a throwback upon launch of khal or ikhal:

Unknown exception happened.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/khal/khalendar/khalendar.py", line 286, in _update_vevent
    update(event.raw, href=href, etag=etag, calendar=calendar)
  File "/usr/lib/python3/dist-packages/khal/khalendar/backend.py", line 260, in update
    self._update_impl(vevent, href, calendar)
  File "/usr/lib/python3/dist-packages/khal/khalendar/backend.py", line 349, in _update_impl
    dtstartend = aux.expand(vevent, href)
  File "/usr/lib/python3/dist-packages/khal/khalendar/aux.py", line 106, in expand
    dtstartl.remove(date)
KeyError: datetime.datetime(2014, 8, 27, 9, 0, tzinfo=<DstTzInfo 'Europe/Berlin' CEST+2:00:00 DST>)
warning: Skipping pennycal/4EC1BC2F-75AE-4F10-9B86-D5C41C375308.ics: datetime.datetime(2014, 8, 27, 9, 0, tzinfo=<DstTzInfo 'Europe/Berlin' CEST+2:00:00 DST>)
warning: This event will not be available in khal.

the excluded date is after the end date of this sequence. We should probably throw a warning and not raise an exception.

see https://github.com/pimutils/khal/issues/228#issuecomment-281219115

madduck commented 7 years ago

Instead of a warning, you might also just consider ignoring this, or at least only showing it in debug mode. After all, it's a mistake, all right, but ignoring the EXDATE in this case will have the desired effect: there won't be a repetition on that day (because the repetition is already over).

geier commented 7 years ago

this has actually been fixed with 60c248af4871e52ba55fe52e2e6332c3cc5db87e and shouldn't occur with recent versions of khal.

@fpytloun if you want to backport fixes like this to v0.8.x you might want to send an PR versus khal's v0.8.x branch.

edited fixed hash

fpytloun commented 7 years ago

@geier thank you for pinging me. I think it may be still possible to get 0.9.x into Debian stable. I will make an upload and ask release team to unblock migration.

madduck commented 7 years ago

@geier Oh nice, yes, I was actually running 0.8.4 from Debian when I chimed in.