ikhal Crashes when attempting to edit an Event
Open
Nobody has claimed this yet.
needs info
type: bug
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
When I try to navigate down past the start/end datetimes I get this:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/khal/ui/__init__.py", line 1365, in start_pane
loop.run()
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 287, in run
self._run()
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 385, in _run
self.event_loop.run()
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 790, in run
self._loop()
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 827, in _loop
self._watch_files[fd]()
File "/usr/lib/python3.10/site-packages/urwid/raw_display.py", line 416, in <lambda>
wrapper = lambda: self.parse_input(
File "/usr/lib/python3.10/site-packages/urwid/raw_display.py", line 515, in parse_input
callback(processed, processed_codes)
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 412, in _update
self.process_input(keys)
File "/usr/lib/python3.10/site-packages/urwid/main_loop.py", line 513, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/usr/lib/python3.10/site-packages/urwid/wimp.py", line 651, in keypress
return self._current_widget.keypress(size, key)
File "/usr/lib/python3.10/site-packages/urwid/container.py", line 1135, in keypress
return self.body.keypress( (maxcol, remaining), key )
File "/usr/lib/python3.10/site-packages/urwid/container.py", line 2316, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/usr/lib/python3.10/site-packages/khal/ui/editor.py", line 544, in keypress
return super().keypress(size, key)
File "/usr/lib/python3.10/site-packages/khal/ui/widgets.py", line 376, in keypress
key = super().keypress(size, key)
File "/usr/lib/python3.10/site-packages/urwid/listbox.py", line 968, in keypress
key = focus_widget.keypress((maxcol,),key)
File "/usr/lib/python3.10/site-packages/urwid/container.py", line 2316, in keypress
key = w.keypress((mc,) + size[1:], key)
File "/usr/lib/python3.10/site-packages/urwid/wimp.py", line 543, in keypress
self._emit('click')
File "/usr/lib/python3.10/site-packages/urwid/widget.py", line 461, in _emit
signals.emit_signal(self, name, self, *args)
File "/usr/lib/python3.10/site-packages/urwid/signals.py", line 265, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
File "/usr/lib/python3.10/site-packages/urwid/signals.py", line 295, in _call_callback
return bool(callback(*args_to_pass))
File "/usr/lib/python3.10/site-packages/khal/ui/editor.py", line 524, in save
self.collection.update(self.event)
File "/usr/lib/python3.10/site-packages/khal/khalendar/khalendar.py", line 174, in update
event.etag = self._storages[event.calendar].update(event.href, event, event.etag)
File "/usr/lib/python3.10/site-packages/khal/khalendar/vdir.py", line 250, in update
if not isinstance(item.raw, str):
File "/usr/lib/python3.10/site-packages/khal/khalendar/event.py", line 382, in raw
timezone = create_timezone(tzinfo, self.start)
File "/usr/lib/python3.10/site-packages/khal/khalendar/event.py", line 937, in create_timezone
tz.fromutc(tz._utc_transition_times[num]).replace(tzinfo=None))
File "/usr/lib/python3.10/site-packages/pytz/tzinfo.py", line 201, in fromutc
return (dt + inf[0]).replace(tzinfo=self._tzinfos[inf])
OverflowError: date value out of range
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in khal/ui/editor.py at save, then follow the update path through khal/khalendar/khalendar.py and khal/khalendar/vdir.py to khal/khalendar/event.py:create_timezone. Reproduce the crash by editing an event and navigating past its start/end datetimes, then trace the OverflowError. Done means the same edit flow no longer crashes when saving the event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100