pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

Khal crashes, adding a repeating event #1187

Closed bw9ubwo closed 1 year ago

bw9ubwo commented 2 years ago
khal, version 0.10.5

khal new tuesday 14:30 150 -r weekly "text"
Traceback (most recent call last):
  File "/home/mono/.local/bin/khal", line 8, in <module>
    sys.exit(main_khal())
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/mono/.local/lib/python3.10/site-packages/khal/cli.py", line 394, in new
    new_func(
  File "/home/mono/.local/lib/python3.10/site-packages/khal/controllers.py", line 378, in new_from_string
    new_from_args(
  File "/home/mono/.local/lib/python3.10/site-packages/khal/controllers.py", line 393, in new_from_args
    event = new_vevent(
  File "/home/mono/.local/lib/python3.10/site-packages/khal/icalendar.py", line 132, in new_event
    rrule = rrulefstr(repeat, until, locale, dtstart.tzinfo)
AttributeError: 'datetime.date' object has no attribute 'tzinfo'
tjensch commented 2 years ago

I experience similar issues. I've set up events with roundcube (1.4.13-6.4.el7.kolab_16) and aCalendar+ (2.6.1). On first sight, recurring events of the type "Repeat Every X day(s), for X time(s)" do work, but recurring events of the type "Repeat Every X week(s), until xxx" dont. Setting an EndDate for the "Repeat every day" causes khal to crash. Additionally if I delete specific entries from a working recurring event, khal crashes. Also events of the type "Repeat [ondate]" dont work, but this option is only available with roundcube and additionally screws up the time of the event when synced to aCalender+.

Unknown exception happened.
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/khal/khalendar/khalendar.py", line 339, in _update_vevent
    update(event.raw, href=href, etag=etag, calendar=calendar)
  File "/usr/lib/python3.10/site-packages/khal/khalendar/backend.py", line 239, in update
    self._update_impl(vevent, href, calendar)
  File "/usr/lib/python3.10/site-packages/khal/khalendar/backend.py", line 354, in _update_impl
    dtstartend = expand_vevent(vevent, href)
  File "/usr/lib/python3.10/site-packages/khal/icalendar.py", line 320, in expand
    for date in get_dates(vevent, 'EXDATE') or ():
  File "/usr/lib/python3.10/site-packages/khal/icalendar.py", line 237, in sanitize_datetime
    date = events_tz.localize(date)
  File "/usr/lib/python3.10/site-packages/pytz/tzinfo.py", line 317, in localize
    if dt.tzinfo is not None:
AttributeError: 'datetime.date' object has no attribute 'tzinfo'
Iss-in commented 1 year ago

similar trouble here as well

geier commented 1 year ago

Thank you for reporting these issues. Unfortunately, I cannot reproduce them on my end. It also looks to me, like @jdnumm and @tjensch have different issues (but the stack trace looks similar).

geier commented 1 year ago

If those are still issues, please open new issues with the information requested by the new issue template.