-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix for dateutil 2.7 #798
Fix for dateutil 2.7 #798
Conversation
This does seem to work, but you lost the comma at the end of the line. |
if this works as intended, could it be released in a new version soon? |
So I finally identified the problem, but sadly haven't (implemented) a solution yet. Here is a brief description of the problem and possible solutions: Problem descriptionBecause of an incompatibility between dateutil's rrule and pytz's timezone we are currently removing a the timezone information before calculating the recurrence instances and applying the timezone afterwards to all the recurrence instances. The problem occurs, when there is a localized UNTIL parameter, which is indicated by a Z (as in UTC or Zulu time) like this: Possible solutions:
Comments, ideas and PRs are welcome |
Dateutil is BSD (and Apache 2.0) licensed |
Why are dateutil's and pytz's timezone incompatible? Aren't they all subclasses of What are the changes of either upstream fixing this (eg: is there an upstream bug). monkeypatching (option 1) sounds like the best idea to me. The only other possible solution would be to try and fix rrule upstream (or maybe both?). |
@WhyNotHugo have a look at dateutil/dateutil#641 |
khal/utils.py
Outdated
@@ -335,9 +349,12 @@ def sanitize_datetime(date): | |||
# doesn't know any larger transition times | |||
rrule._until = dt.datetime(2037, 12, 31) | |||
elif getattr(rrule._until, 'tzinfo', None): | |||
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this raise
ought to be here.
But good news: there is another option, read dateutil's code and discover the ignore_tz option. This needs some more working around some issues, but this is mostly fixed. Now this showed that we have a bug (i.e., we generate non compliant .ics files) in the |
IMHO, ignoring the timezone is a valid short term workaround. However, the proper fix (long term) should be to move away from |
dfd30c4
to
4cec51f
Compare
Would it be possible to release a new version of khal with this fix? It would help in keeping khal in Debian (it will be removed from testing today if there is no fix to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908497) |
@legrostdg sorry, forgot to notify you, I actually did a release on that day, which is only available on pypi for the moment. |
great, thanks! |
More information incoming
fixes #780