Skip to content

mxm, IT's mad science

Sections
Personal tools
You are here: Home » Products » Open Source » iCalendar package » Patch for space between relative and weekday
Downloads
You can download mxm products here.

Due to it's technical and international nature, this section is in english.

Max M Has a blog too.

og er glad for mad

 

Comment

Above in this comment thread: iCalendar package for Python » Recurrencies... » icalendar error » Found fix » Thanks for fix

Patch for space between relative and weekday

Posted by Anonymous User at 2010-09-11 07:27 AM
Problem: iCalendar entries with PRODID:Microsoft CDO for Microsoft Exchange from time to time throw an error in parsing the recurrence rule.

The error looks like this:

"Error in recurrence rule: FREQ=MONTHLY;UNTIL=20110215T210000Z;INTERVAL=1;BYDAY=3 TU;WKST=SU"

The offending segment in this case is: "BYDAY=3 TU". The parser expects something like "BYDAY=3TU".

Fix:
Patch line 62 of prop.py from:
WEEKDAY_RULE = re.compile('(?P<signal>[+-]?)(?P<relative>[\d]?)'

to:
WEEKDAY_RULE = re.compile('(?P<signal>[+-]?)(?P<relative>[\d]?) ?'

Basically, add an optional space between the relative token and the weekday token.