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

khal crashes while searching in interactive mode #1349

Open
clustor opened this issue May 9, 2024 · 3 comments
Open

khal crashes while searching in interactive mode #1349

clustor opened this issue May 9, 2024 · 3 comments

Comments

@clustor
Copy link

clustor commented May 9, 2024

Describe the bug
When I press '/' to search for events in interactive mode, khal crashes

If applicable: Stack Trace

Traceback (most recent call last):
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1363, in start_pane
    loop.run()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 343, in run
    self._run()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 445, in _run
    self.event_loop.run()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 182, in run
    self._loop()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 229, in _loop
    record.data()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/display/_posix_raw_display.py", line 274, in wrapper
    return self.parse_input(event_loop, callback, self.get_available_raw_input())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/display/_raw_display_base.py", line 489, in parse_input
    callback(decoded_codes, raw_codes)
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 472, in _update
    self.process_input(keys)
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 572, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)  # noqa: PLW2901
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/popup.py", line 140, in keypress
    return self._current_widget.keypress(size, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/frame.py", line 451, in keypress
    return self.body.keypress((maxcol, remaining), key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1122, in keypress
    self.search()
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1127, in search
    overlay = urwid.Overlay(
              ^^^^^^^^^^^^^^
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/overlay.py", line 166, in __init__
    self.set_overlay_parameters(align, width, valign, height, min_width, min_height, left, right, top, bottom)
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/overlay.py", line 459, in set_overlay_parameters
    self.options(
  File "/usr/local/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/overlay.py", line 362, in options
    VAlign(valign_type),
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py", line 1171, in __new__
    raise ve_exc
ValueError: <WHSettings.RELATIVE: 'relative'> is not a valid VAlign

To Reproduce

  1. khal interactive
  2. Press '/'

Expected behavior

  • khal provides the user to start typing search string

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

  • khal, version 0.11.3

  • Installation method: brew

  • python version: 3.12

  • OS: MacOS Sonoma

  • The versions of your other python packages [e.g. the output of pip freeze]

aiohttp==3.8.4
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.2.0
appdirs==1.4.4
async-timeout==4.0.2
asyncclick==8.1.3.4
attrs==23.1.0
boto3==1.28.64
botocore==1.31.64
Brotli @ file:///private/tmp/python-brotli-20231117-5715-qv008m/Brotli-1.1.0
certifi==2023.7.22
charset-normalizer==3.1.0
click==8.1.3
defusedxml==0.7.1
diagrams==0.23.3
dulwich==0.21.5
Flask==2.2.3
frozenlist==1.3.3
graphviz==0.20.1
gunicorn==21.0.1
icalendar==5.0.5
idna==3.4
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
jmespath==1.0.1
kml2geojson==5.1.0
MarkupSafe==2.1.2
multidict==6.0.4
mutagen @ file:///private/tmp/python-mutagen-20231008-6107-91zfxm/mutagen-1.47.0
packaging==23.1
pathspec @ file:///private/tmp/python-pathspec-20231212-5149-sdd2ey/pathspec-0.12.1
platformdirs @ file:///private/tmp/python-platformdirs-20240131-5346-puime8/platformdirs-4.2.0
psutil @ file:///private/tmp/python-psutil-20240120-4912-5zd9yy/psutil-5.9.8
pycairo @ file:///private/tmp/py3cairo-20240213-6081-v7yhn5/pycairo-1.26.0
pycparser==2.22
pydantic==2.5.2
pydantic_core==2.14.5
pyee==8.2.2
PyGObject==3.48.2
pyppeteer==1.0.2
pyserial==3.5
python-dateutil==2.8.2
python-kasa==0.5.4
pytz==2023.3
pyudev==0.24.1
PyYAML @ file:///private/tmp/pyyaml-20231019-6134-1qsnlp0/PyYAML-6.0.1
requests @ file:///private/tmp/python-requests-20231124-5870-cua30x/requests-2.31.0
rshell==0.0.31
s3transfer==0.7.0
six==1.16.0
sniffio==1.3.0
tqdm==4.66.1
typed-ast==1.5.5
typing_extensions==4.9.0
urllib3==1.26.16
websockets==10.4
Werkzeug==2.2.3
xandikos==0.2.8
yarl==1.9.2
zipp==3.16.2
@geier
Copy link
Member

geier commented May 10, 2024

Thanks for reporting this issue.

I believe this should be fixed with upgrading urwid, see #1340

@clustor
Copy link
Author

clustor commented May 10, 2024

Thanks for pointing me to the root cause ticket. I am trying to determine the best way to upgrade urwid with brew. I see that urwid 2.5.3 is installed from https://github.com/Homebrew/homebrew-core/blob/ef5d63c5ec3ff5a25c63c240ae13d4bb51c5183a/Formula/k/khal.rb

But #1340 references urwid 2.6.8 fixes this. Would you mind pushing a release updating the min version of urwid required https://github.com/pimutils/khal/blob/master/pyproject.toml#L30 ? May be macos brew will pick this up then automatically. I need to dig a bit to understand brew ecosystem for this.

Until then, I will use khal from a virtual env.

@muttnooob
Copy link

I also have this issue, or similar. my python3-urwid seems to be the latest already. Anyone have any progress resolving this issue? See error, when I use "/" for search in khal interactive. Thanks!

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/lib64/python3.12/site-packages/urwid/event_loop/main_loop.py", line 343, in run
self._run()
File "/usr/lib64/python3.12/site-packages/urwid/event_loop/main_loop.py", line 445, in _run
self.event_loop.run()
File "/usr/lib64/python3.12/site-packages/urwid/event_loop/select_loop.py", line 182, in run
self._loop()
File "/usr/lib64/python3.12/site-packages/urwid/event_loop/select_loop.py", line 229, in _loop
record.data()
File "/usr/lib64/python3.12/site-packages/urwid/display/_posix_raw_display.py", line 274, in wrapper
return self.parse_input(event_loop, callback, self.get_available_raw_input())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/site-packages/urwid/display/_raw_display_base.py", line 489, in parse_input
callback(decoded_codes, raw_codes)
File "/usr/lib64/python3.12/site-packages/urwid/event_loop/main_loop.py", line 472, in _update
self.process_input(keys)
File "/usr/lib64/python3.12/site-packages/urwid/event_loop/main_loop.py", line 572, in process_input
k = self._topmost_widget.keypress(self.screen_size, k) # noqa: PLW2901
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/site-packages/urwid/widget/popup.py", line 140, in keypress
return self._current_widget.keypress(size, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/site-packages/urwid/widget/frame.py", line 451, in keypress
return self.body.keypress((maxcol, remaining), key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/khal/ui/init.py", line 1122, in keypress
self.search()
File "/usr/lib/python3.12/site-packages/khal/ui/init.py", line 1127, in search
overlay = urwid.Overlay(
^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/site-packages/urwid/widget/overlay.py", line 166, in init
self.set_overlay_parameters(align, width, valign, height, min_width, min_height, left, right, top, bottom)
File "/usr/lib64/python3.12/site-packages/urwid/widget/overlay.py", line 459, in set_overlay_parameters
self.options(
File "/usr/lib64/python3.12/site-packages/urwid/widget/overlay.py", line 362, in options
VAlign(valign_type),
^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/enum.py", line 757, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/enum.py", line 1171, in new
raise ve_exc
ValueError: <WHSettings.RELATIVE: 'relative'> is not a valid VAlign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants