pimutils / khal

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

Raise error properly on failure to parse ics #1259

Closed magarnicle closed 1 year ago

magarnicle commented 1 year ago

If cal_from_ics in icalendar.py raises a ValueError that is not to do with timezone issue, it will raise it instead of ignoring it and then generating "UnboundLocalError: local variable 'cal' referenced before assignment"

geier commented 1 year ago

Good catch, thanks! Could you please add yourself to AUTHORS.txt, and -- if you have -- provide an example .ics file that triggers the issue? (I'd like to write a test to cover that case.)

magarnicle commented 1 year ago

Sorry, should have read the contribution guildelines. I've added a test and the .ics from issue #1217

geier commented 1 year ago

Awesome, thanks!