Skip to content
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

rrule parsing allows UNTIL with non-UTC dates #633

Closed
ryanpetrello opened this issue Mar 12, 2018 · 2 comments
Closed

rrule parsing allows UNTIL with non-UTC dates #633

ryanpetrello opened this issue Mar 12, 2018 · 2 comments

Comments

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Mar 12, 2018

~ cat utc_until.py && python utc_until.py
from datetime import datetime
import dateutil.rrule

rrule = dateutil.rrule.rrulestr(
    'DTSTART;TZID=America/New_York:20180601T120000 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20180602T000000'
)
print rrule.after(datetime.utcnow())
Traceback (most recent call last):
  File "utc_until.py", line 7, in <module>
    print rrule.after(datetime.utcnow())
  File "/home/ryan/.local/share/virtualenvs/tmp.jQo0RUu68U-Zv6c7Bw0/lib/python2.7/site-packages/dateutil/rrule.py", line 223, in after
    for i in gen:
  File "/home/ryan/.local/share/virtualenvs/tmp.jQo0RUu68U-Zv6c7Bw0/lib/python2.7/site-packages/dateutil/rrule.py", line 862, in _iter
    if until and res > until:
TypeError: can't compare offset-naive and offset-aware datetimes

According to RFC5545 Section 3.3.10:
https://tools.ietf.org/html/rfc5545#section-3.3.10

If the "DTSTART" property is specified as a date with UTC time or a date with local time and time zone reference, then the UNTIL rule part MUST be specified as a date with UTC time.

@ryanpetrello
Copy link
Contributor Author

(I'm working on a PR to address this)

@pganssle
Copy link
Member

I believe this is a duplicate of #620

@pganssle pganssle added this to the Bugfix release milestone Mar 12, 2018
ryanpetrello added a commit to ryanpetrello/dateutil that referenced this issue Mar 12, 2018
ryanpetrello added a commit to ryanpetrello/dateutil that referenced this issue Mar 12, 2018
ryanpetrello added a commit to ryanpetrello/dateutil that referenced this issue Mar 12, 2018
ryanpetrello added a commit to ryanpetrello/dateutil that referenced this issue Mar 13, 2018
@pganssle pganssle mentioned this issue Mar 24, 2018
@pganssle pganssle modified the milestones: Bugfix release, 2.7.3 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants