-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rruleset not readable in newer versions (0.9.5) #104
Comments
buster, I was having issues when upgrading radicale as well. Everything kept failing on rrules with an UNTIL clause even though it previously worked. I suspect commit 7b2db0e which altered icalendar.py is the culprit. It appears as though the intent was to ignore the timezone in rrules if dtstart was just a date. However, the check, which was not present in previous versions of vobject, tests ignoretz=isinstance(dtstart, datetime.date). This is True for both datetime.date AND datetime.datetime, so ignoretz=True is passed to dateutil.rrule.rrulestr() which breaks consistency checks when dtstart is timezone aware. From the comments, I think the intent was to only do this if dtstart was just a date. I wonder if the check should be "is date but not datetime". The patch below fixed it for me. --- ~/python/vobject-0.9.5/vobject/icalendar.py 2017-06-29 14:55:55.000000000 -0400 +++ ~/.virtualenvs/radicale2/lib/python3.4/site-packages/vobject/icalendar.py 2018-04-03 18:42:47.064826576 -0400 @@ -446,11 +446,22 @@ # a Ruby iCalendar library escapes semi-colons in rrules, # so also remove any backslashes value = line.value.replace('\\', '') + #rule = rrule.rrulestr( + # value, dtstart=dtstart, + # If dtstart has no time zone, `until` + # shouldn't get one, either: + #ignoretz=isinstance(dtstart, datetime.date)) + # commit 7b2db0e broke rrules from dateutil using until. + # added this hotfix. + is_it_just_a_date = ( + isinstance(dtstart, datetime.date) and + not isinstance(dtstart, datetime.datetime) + ) rule = rrule.rrulestr( value, dtstart=dtstart, # If dtstart has no time zone, `until` # shouldn't get one, either: - ignoretz=isinstance(dtstart, datetime.date)) + ignoretz=is_it_just_a_date) until = rule._until if until is not None and isinstance(dtstart, |
Hello,
i am having a problem with radicale which uses vobject.
As far as i can tell an older version of vobject supported accessing "rruleset" in a VTODO but 0.9.5 doesn't?
I receive the following traceback:
Is this expected to happen?
I've put example data and what i tried in the radicale issue tracker here: Kozea/Radicale#764
The text was updated successfully, but these errors were encountered: