Open mdrovdahl opened 11 months ago
This ICS file (with the addition of an "END:VCALENDAR" line, which I assume got lost in cut&paste), passes RFC-5545 validation at https://icalendar.org/validator.html.
vObject raises:
Error
Traceback (most recent call last):
File "/Users/d/work/personal/vobject/vobject/base.py", line 185, in transformToNative
return self.behavior.transformToNative(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/d/work/personal/vobject/vobject/icalendar.py", line 1093, in transformToNative
obj.registerTzinfo(obj.tzinfo)
^^^^^^^^^^
File "/Users/d/work/personal/vobject/vobject/icalendar.py", line 159, in gettzinfo
return tz.tzical(buffer).get()
^^^^^^^^^^^^^^^^^
File "/Users/d/work/personal/vobject/venv312/lib/python3.12/site-packages/dateutil/tz/tz.py", line 1279, in __init__
self._parse_rfc(fobj.read())
File "/Users/d/work/personal/vobject/venv312/lib/python3.12/site-packages/dateutil/tz/tz.py", line 1443, in _parse_rfc
raise ValueError(
ValueError: unsupported TZID parm: =TZINFO
Those last two lines show the issue originating in dateutil
, and looking at the relevant function, it has:
if name == "TZID":
if parms:
raise ValueError(
"unsupported TZID parm: "+parms[0])
tzid = value
This reflects the conclusion in ics-py/ics-py#268 (as referenced above).
So this needs either a fix to dateutil
or some sort of work-around (in vObject).
I'm working with some .ics files generated by an online platform (teamsnap.com) that include a TZID component that is causing Radicale (actually vobject) to error:
Sample .ics
I spent a fair bit searching for related issues (like this https://github.com/ics-py/ics-py/issues/268). My workaround, for now, is to modify
read.components()
:https://github.com/Kozea/Radicale/blob/d7ce2f0b98589400b0e1718cfd7bb29b7ebeaebe/radicale/item/__init__.py#L45
to include: