[Calypso] Incorrect parsing of rrule?

Petter Reinholdtsen pere at hungry.com
Sat Jan 23 15:08:34 PST 2016


Running a patched version of calypso, I see this backtrace.

Failed REPORT for /calendars/user/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/calypso/__init__.py", line 495, in do_REPORT
    self._answer = xmlutils.report(self.path, xml_request, self._collection)
  File "/usr/lib/python2.7/dist-packages/calypso/xmlutils.py", line 352, in report
    if not match_filter(item, filter_element):
  File "/usr/lib/python2.7/dist-packages/calypso/xmlutils.py", line 307, in match_filter
    if match_filter_element(item.object, fe):
  File "/usr/lib/python2.7/dist-packages/calypso/xmlutils.py", line 256, in match_filter_element
    if match_filter_element (vc, fc):
  File "/usr/lib/python2.7/dist-packages/calypso/xmlutils.py", line 251, in match_filter_element
    if match_filter_element(vobject, fc):
  File "/usr/lib/python2.7/dist-packages/calypso/xmlutils.py", line 284, in match_filter_element
    end_datetime = dateutil.parser.parse(end)
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 748, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 310, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 366, in _parse
    l = _timelex.split(timestr)
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 150, in split
    return list(cls(s))
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 147, in next
    return self.__next__()  # Python 2.x support
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 141, in __next__
    token = self.get_token()
  File "/usr/lib/python2.7/dist-packages/dateutil/parser.py", line 72, in get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'


After looking at the code, I suspect the problem is related to the
content of some calendar entry, but am unsure exactly what.  Anyone got
any idea what to look for?  The code in question seem to operate og
rrule entries. The RRULE lines for the only entry in the problematic
collection look like this:

  RRULE:FREQ=YEARLY;COUNT=16;BYDAY=-1SU;BYMONTH=9
  RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
  RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3

The calendar entry was created using korganizer.

-- 
Happy hacking
Petter Reinholdtsen


More information about the Calypso mailing list