jazzband / icalevents

Python module for iCal URL/file parsing and querying.
MIT License
157 stars 72 forks source link

Fix reversion of RRULE UNTIL behavior #88

Closed tresni closed 2 years ago

tresni commented 2 years ago

Prior to 0.1.25, ics files containing events like the following worked normally. A change in 11dfa8c64c5eca807e370067e5b30b52602b0d07 caused these to break. This is an ics I'm getting from Google for my scheduled lunches :)

This restores the pre-0.1.25 behavior and continues to pass all tests.

BEGIN:VEVENT
SUMMARY:LUNCH
DTSTART;TZID=America/Boise:20210929T130000
DTEND;TZID=America/Boise:20210929T135000
DTSTAMP:20211029T005456Z
UID:not_sure_if_this_uid_is_secret@google.com
SEQUENCE:3
RRULE:FREQ=WEEKLY;UNTIL=20211020;BYDAY=MO,TH,WE;WKST=SU
EXDATE;TZID=America/Boise:20211013T130000
CREATED:20210811T153934Z
DESCRIPTION:
LAST-MODIFIED:20210927T184338Z
LOCATION:
STATUS:CONFIRMED
TRANSP:OPAQUE
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
BEGIN:VALARM
ACKNOWLEDGED:20210830T185450Z
ACTION:NONE
TRIGGER;VALUE=DATE-TIME:19760401T005545Z
UID:343EB08E-9C4C-4151-92D0-80B351A080B2
X-WR-ALARMUID:343EB08E-9C4C-4151-92D0-80B351A080B2
END:VALARM
END:VEVENT

This event fails to parse with the following error:

ValueError: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware

codecov[bot] commented 2 years ago

Codecov Report

Merging #88 (d7c153b) into master (c151e7c) will decrease coverage by 0.59%. The diff coverage is 100.00%.

:exclamation: Current head d7c153b differs from pull request most recent head 16573fc. Consider uploading reports for the commit 16573fc to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
- Coverage   87.60%   87.00%   -0.60%     
==========================================
  Files           4        4              
  Lines         355      354       -1     
  Branches       92       91       -1     
==========================================
- Hits          311      308       -3     
- Misses         21       22       +1     
- Partials       23       24       +1     
Impacted Files Coverage Δ
icalevents/icalparser.py 87.78% <100.00%> (-0.05%) :arrow_down:
icalevents/icaldownload.py 78.57% <0.00%> (-4.77%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c151e7c...16573fc. Read the comment docs.

tresni commented 2 years ago

Should be ready to merge now @eigenmannmartin . Thanks for the heads up :)