You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found the following event in the wild and it make the library crash on it becasue DTSTART is a date and DTEND is a datetime.
Possibly it is a invalid event, but it exists and the library is crashing even with skip_bad_series=True
Event processed or event skipped (if skip_bad_series)
Tried to import the ics to Gnome Evolution and it take it without problem.
Console output
Traceback (most recent call last):
File "xxx.py", line 49, in yyy
...
^^^^^^^^^^^^^^^^^^^^^^^^
File "xxx.py", line 104, in yyy
zzz = recurring_ical_events.of(calendar, skip_bad_series=True).between(start_date, end_date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 1446, in of
return calendar_query(
^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 1290, in __init__
component_adapter.collect_series_from(calendar, self._skip_errors)
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 1191, in collect_series_from
result.append(self._series(components))
^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 610, in __init__
self.compute_span_extension()
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 615, in compute_span_extension
self.recurrence.extend_query_span_by
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 413, in extend_query_span_by
return self.core.extend_query_span_by
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 259, in cached_property
self.__dict__[name] = value = func(self)
^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 884, in extend_query_span_by
subtract_from_start = self.duration
^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 259, in cached_property
self.__dict__[name] = value = func(self)
^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/recurring_ical_events.py", line 865, in duration
return self.end - self.start
~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.date'
Version:
pip list
Additional context
Suggested implementation
@cached_propertydefduration(self) ->datetime.timedelta:
"""The duration of the component."""start, end=make_comparable((self.start, self.end))
returnend-start
We're using Polar.sh so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work.
The text was updated successfully, but these errors were encountered:
.duration is called without making use of make_comparable in extend_query_span_by and in between. It fail at both locations.
The change propose to call make_comparable inside .duration but I'm not sure it is a nice fix.
Describe the bug
I've found the following event in the wild and it make the library crash on it becasue DTSTART is a date and DTEND is a datetime.
Possibly it is a invalid event, but it exists and the library is crashing even with
skip_bad_series=True
ICS file
Expected behavior
Event processed or event skipped (if skip_bad_series)
Tried to import the ics to Gnome Evolution and it take it without problem.
Console output
Version:
Additional context
Suggested implementation
python-recurring-ical-events/test/calendars/issue-15-duplicated-events.ics
Line 1 in f4a90b2
python-recurring-ical-events/test/test_issue_15.py
Line 21 in f4a90b2
We're using Polar.sh so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work.
The text was updated successfully, but these errors were encountered: