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

Fix TypeError bug in RDATE all day event handling #153

Merged
merged 1 commit into from
Nov 24, 2022
Merged

Fix TypeError bug in RDATE all day event handling #153

merged 1 commit into from
Nov 24, 2022

Conversation

allenporter
Copy link
Owner

@allenporter allenporter commented Nov 24, 2022

Fix bug in RDATE all day event handling:

tests/test_timeline.py:916: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../ical/ical/iter.py:234: in overlapping
    for item in self._iterable:
../ical/ical/iter.py:143: in __next__
    self._make_heap()
../ical/ical/iter.py:133: in _make_heap
    next_item = next(iterator)
../ical/ical/iter.py:113: in __iter__
    for dtvalue in self._recur:
gcal_sync/timeline.py:106: in __iter__
    for value in self._func:
gcal_sync/timeline.py:92: in __iter__
    for value in self._dt_iter:
../ical/ical/iter.py:113: in __iter__
    for dtvalue in self._recur:
venv/lib/python3.9/site-packages/dateutil/rrule.py:1396: in _iter
    heapq.heapify(rlist)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <dateutil.rrule.rruleset._genitem object at 0x7f484cc22b50>
other = <dateutil.rrule.rruleset._genitem object at 0x7f484cc221c0>

    def __lt__(self, other):
>       return self.dt < other.dt
E       TypeError: can't compare datetime.datetime to datetime.date

venv/lib/python3.9/site-packages/dateutil/rrule.py:1338: TypeError

The approach is to simplify the date vs datetime workaround that already exists, due to limitations in dateutil.rrule when used in a dateutil.ruleset.

@allenporter allenporter merged commit 215460d into main Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant