diff --git a/tools/gen_upcoming.py b/tools/gen_upcoming.py index 33b093d..31763f7 100755 --- a/tools/gen_upcoming.py +++ b/tools/gen_upcoming.py @@ -44,7 +44,10 @@ def parse_recurring_event(event, start, end): logging.info(f"Processing recurring event {event['SUMMARY'].to_ical().decode('utf-8')}") dtstart = parse(event["DTSTART"].to_ical()) rs = rruleset() - rs.rrule(rrulestr(event["RRULE"].to_ical().decode("utf-8"), dtstart=dtstart)) + # dtstart is normalized to naive local time above; pass ignoretz so a + # tz-aware UNTIL (RFC 5545 requires UTC for it) is treated as naive too, + # otherwise dateutil rejects the naive/aware mismatch. + rs.rrule(rrulestr(event["RRULE"].to_ical().decode("utf-8"), dtstart=dtstart, ignoretz=True)) if "EXDATE" in event.keys(): for exdate in event["EXDATE"]: rs.exdate(parse(exdate.to_ical()))