collective / icalendar

icalendar parser library for Python
https://icalendar.readthedocs.io
Other
988 stars 171 forks source link

[RFC] handling of broken icals #174

Open geier opened 8 years ago

geier commented 8 years ago

I would like to introduce some kind of handling of for broken/invalid icalendar files and would like your input on how to build this feature.

Some ideas off the top of my head:

three different (possible) modes:

stlaz commented 8 years ago

It seems that the third option is the closest to the solution they use in libical where components consist of lists of properties. If an error occurred during parsing they add an error property accordingly.

See https://github.com/libical/libical/blob/master/src/libical/icalparser.c#L562.

thet commented 8 years ago

I your option 3 and the approach of @stlaz . I think this is fixed by: https://github.com/collective/icalendar/pull/175 - if you diagree, please repoen.

niccokunzmann commented 2 years ago

@geier, now, there is some kind of recognition of broken ical files. Would you close this or could you specify closing critaria?

niccokunzmann commented 2 years ago

I commented here: https://github.com/collective/icalendar/issues/315#issuecomment-1281476631 - I would do both - add a broken/valid property and not raise an exception but a warning.

geier commented 2 years ago

I don't really care about this issue, but we probably still should implement the suggested features (warnings and some kind of validate function).