lpil / icalendar

🗓️ A small library for reading and writing ICalendar files.
MIT License
103 stars 56 forks source link

Fixes to date & timezone parsing, add ignore_errors flag #51

Open timsu opened 3 years ago

timsu commented 3 years ago

We've seen a number of errors in Outlook-generated ICS files in the wild. This PR adds a few fixes to make the parser more flexible:

lpil commented 3 years ago

This approach seems somewhat heavy-handed to me. Is there a particular kind of error that is expected?

timsu commented 3 years ago

Are you talking about ignore_errors, or custom timezones parsing? The custom timezones I agree it's not great, the ideal would be to actually interpret VTIMEZONE properly. I can remove that part of the handling if you'd like.

This comes from crashes we've seen trying to parse user ics files, mostly generated by Outlook 365. I can also attach some samples if that's helpful.

lpil commented 3 years ago

The ignoring of errors part. I would much rather handle it without swallowing exceptions. Is there a particular bit that is expected to fail?