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

ikhal crashes when creating new event with filtered calendars #1380

Open
pheerai opened this issue Dec 21, 2024 · 0 comments
Open

ikhal crashes when creating new event with filtered calendars #1380

pheerai opened this issue Dec 21, 2024 · 0 comments

Comments

@pheerai
Copy link

pheerai commented Dec 21, 2024

Describe the bug
When opening ikhal with the -a-argument set to something other than the default it crashes when trying to create a new calendar entry.

If applicable: Stack Trace

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/ui/__init__.py", line 1363, in start_pane
    loop.run()
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 337, in run
    self._run()
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 439, in _run
    self.event_loop.run()
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 182, in run
    self._loop()
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 229, in _loop
    record.data()
  File "/usr/lib/python3.12/site-packages/urwid/display/_posix_raw_display.py", line 273, in wrapper
    return self.parse_input(event_loop, callback, self.get_available_raw_input())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/display/_raw_display_base.py", line 488, in parse_input
    callback(decoded_codes, raw_codes)
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 466, in _update
    self.process_input(keys)
  File "/usr/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 566, in process_input
    handled_key = self._topmost_widget.keypress(self.screen_size, key)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/popup.py", line 143, in keypress
    return self._current_widget.keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/frame.py", line 526, in keypress
    return self.body.keypress((maxcol, remaining), key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/__init__.py", line 1123, in keypress
    return super().keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/base.py", line 114, in keypress
    return super().keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/widget.py", line 729, in keypress
    return get_delegate(self).keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/widgets.py", line 313, in keypress
    key = super().keypress(size, key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/columns.py", line 1216, in keypress
    key = w.keypress(size_args[i], key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/widget.py", line 729, in keypress
    return get_delegate(self).keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/widget.py", line 729, in keypress
    return get_delegate(self).keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/urwid/widget/frame.py", line 526, in keypress
    return self.body.keypress((maxcol, remaining), key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/calendarwidget.py", line 330, in keypress
    return self.on_press[key](start, end)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/__init__.py", line 1177, in new_event
    self.eventscolumn.original_widget.new(date, end)
  File "/usr/lib/python3.12/site-packages/khal/ui/__init__.py", line 895, in new
    self.edit(event)
  File "/usr/lib/python3.12/site-packages/khal/ui/__init__.py", line 762, in edit
    editor = EventEditor(self.pane, event, update_colors, always_save=always_save)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/ui/editor.py", line 374, in __init__
    self.collection._calendars[self.event.calendar],
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'personal'

(Note: personal is my configured default, and is not included in the calendars to display)

To Reproduce
Steps to reproduce the behavior:

  • Configure khal with multiple calendars
  • Set one (cal1) as the default
  • Open ikhal filtering for another one: ikhal -a cal2
  • Try to create a new date

Expected behavior
I can create a new appointment, with either cal2 or no calendar selected (In case of multiple calendars being included" any of them/none of them)

OS, version, khal version and how you installed it:

  • The output of khal --version: khal, version 0.11.3
  • Installation method: Archlinux Repo
  • python version: 3.12.7
  • OS: Archlinux
  • Your khal config file:
[calendars]
    [[personal]]
        path = ~/.local/share/vdirsyncer/calendar/personal
    [[voltstock]]
        path = ~/.local/share/vdirsyncer/ws_calendar/voltstock-infos-1/
  (<Stripped: Some more calendars>)

[locale]
    weeknumbers = left
    unicode_symbols = False
    longdateformat = %Y-%m-%d
    longdatetimeformat = %Y-%m-%d %H:%M
    datetimeformat = %m-%d %H:%M
    dateformat = %m-%d
    firstweekday = 0

[default]
    default_calendar = personal
    timedelta = 3d
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

No branches or pull requests

1 participant