jazzband / icalevents

Python module for iCal URL/file parsing and querying.
MIT License
157 stars 72 forks source link

Repeating event raises an error with tzinfo #129

Open nbradley3207 opened 7 months ago

nbradley3207 commented 7 months ago

Using python 3.9.7 and icalevents 0.1.27

I have an Atlassian Wiki page with a calendar object. I can export the calendar to iCal format. When I try to parse the file with icalevents, I get an error with this specific block:

BEGIN:VEVENT DTSTAMP:20231221T180428Z DTSTART;VALUE=DATE:20231127 DTEND;VALUE=DATE:20231128 SUMMARY:DSOC CATEGORIES:other SUBCALENDAR-ID:3dfdd9f8-dc5a-49b6-9b54-644138545076 PARENT-CALENDAR-ID:f681d504-b5ed-4258-a68b-7deb867cf1bf PARENT-CALENDAR-NAME: SUBSCRIPTION-ID: SUBCALENDAR-TZ-ID:America/Los_Angeles SUBCALENDAR-NAME:My calendar EVENT-ID:163463 EVENT-ALLDAY:true UID:20231012T192858Z--1042663660@my_org.com DESCRIPTION: ORGANIZER;X-CONFLUENCE-USER-KEY=09ceee004595a94a014595d847942220;CN=My Name;CUTYPE=INDIVIDUAL:mailto:my_email@email.com RRULE:FREQ=WEEKLY;UNTIL=20240115;INTERVAL=1;BYDAY=MO CREATED:20231012T192858Z LAST-MODIFIED:20231130T174704Z SEQUENCE:3 X-CONFLUENCE-SUBCALENDAR-TYPE:other TRANSP:TRANSPARENT STATUS:CONFIRMED EXDATE;VALUE=DATE:20231225 EXDATE;VALUE=DATE:20231218 EXDATE;VALUE=DATE:20231225 EXDATE;VALUE=DATE:20231218 END:VEVENT

Here is the error:

Traceback (most recent call last): File "", line 1, in File "icalevents.py", line 57, in events found_events += parse_events( File "icalparser.py", line 370, in parse_events rule = parse_rrule(component) File "icalparser.py", line 528, in parse_rrule rule.exdate(exd.replace(tzinfo=None)) TypeError: 'tzinfo' is an invalid keyword argument for replace()

Removing the VEVENT block results in parsing just fine (with 106 other VEVENTS in the file). Possibly related to #47.

Andrevg09 commented 3 months ago

Hi i have the same error, is there any resolution for this?