Skip to content

ValueError: unsupported DTSTART parm: VALUE=DATE-TIME #401

@potuz

Description

@potuz

I reported this on khal:
pimutils/khal#679
and radicale:
Kozea/Radicale#646

When trying When trying to sync a calendar built from khal to radicale I get

Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/vobject/base.py", line 183, in transformToNati
ve
return self.behavior.transformToNative(self)
File "/usr/lib/python3.4/site-packages/vobject/icalendar.py", line 989, in transformT
oNative
obj.registerTzinfo(obj.tzinfo)
File "/usr/lib/python3.4/site-packages/vobject/icalendar.py", line 150, in gettzinfo
return tz.tzical(buffer).get()
File "/usr/lib/python3.4/site-packages/dateutil/tz/tz.py", line 1109, in init
self._parse_rfc(fobj.read())
File "/usr/lib/python3.4/site-packages/dateutil/tz/tz.py", line 1230, in _parse_rfc
cache=True)
File "/usr/lib/python3.4/site-packages/dateutil/rrule.py", line 1603, in call
return self._parse_rfc(s, **kwargs)
File "/usr/lib/python3.4/site-packages/dateutil/rrule.py", line 1562, in _parse_rfc
raise ValueError("unsupported DTSTART parm: "+parm)
ValueError: unsupported DTSTART parm: VALUE=DATE-TIME

Which is due to rrule.py not wanting any parameter to DTSTART.

The following patch is ignoring the parameter and solves the issue for me, until someone comes with a better fix.

$ cat /tmp/python-dateutil-fix-dtstart.patch
diff --git a/dateutil/rrule.py b/dateutil/rrule.py
index da94351..b447600 100644
--- a/dateutil/rrule.py
+++ b/dateutil/rrule.py
@@ -1559,7 +1559,8 @@ class _rrulestr(object):
                     exdatevals.append(value)
                 elif name == "DTSTART":
                     for parm in parms:
-                        raise ValueError("unsupported DTSTART parm: "+parm)
+                        if parm != "VALUE=DATE-TIME":
+                            raise ValueError("unsupported DTSTART parm: "+parm)
                     if not parser:
                         from dateutil import parser
                     dtstart = parser.parse(value, ignoretz=ignoretz,
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions