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

Search does not work on macos arm64 #1357

Closed
gachikuku opened this issue Aug 17, 2024 · 10 comments
Closed

Search does not work on macos arm64 #1357

gachikuku opened this issue Aug 17, 2024 · 10 comments

Comments

@gachikuku
Copy link
Contributor

Describe the bug
When I'm in ikhal and i press / to search the program crashes.

If applicable: Stack Trace

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1363, in start_pane
    loop.run()
  File "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/main_loop.py", line 343, in run
    self._run()
  File "/opt/homebrew/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 "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 182, in run
    self._loop()
  File "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/event_loop/select_loop.py", line 229, in _loop
    record.data()
  File "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/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 "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1122, in keypress
    self.search()
  File "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/khal/ui/__init__.py", line 1127, in search
    overlay = urwid.Overlay(
              ^^^^^^^^^^^^^^
  File "/opt/homebrew/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 "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/overlay.py", line 459, in set_overlay_parameters
    self.options(
  File "/opt/homebrew/Cellar/khal/0.11.3/libexec/lib/python3.12/site-packages/urwid/widget/overlay.py", line 362, in options
    VAlign(valign_type),
    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.5/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

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

  • ikhal, version 0.11.3
  • Homebrew
  • Python 3.12.5
  • Macos arm64 (Darwin base.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64)
  • khal config
[calendars]
[[private]]
path = /Users/gachikuku/.local/share/khal/calendars/private
type = calendar

[locale]
timeformat = %H:%M
dateformat = %d/%m/%Y
longdateformat = %d/%m/%Y
datetimeformat = %d/%m/%Y %H:%M
longdatetimeformat = %d/%m/%Y %H:%M

[default]
default_calendar = private
  • The versions of your other python packages [e.g. the output of pip freeze]
certifi==2024.7.4
cffi==1.17.0
gpg==1.23.2
meson==1.5.1
notmuch==0.38.3
notmuch2==0.38.3
pycparser==2.22
TBB==0.2
wheel @ file:///opt/homebrew/Cellar/python%403.12/3.12.5/libexec/wheel-0.44.0-py3-none-any.whl#sha256=8d8a590e50bda8422000110e90bc730ebfcd8363d2de80793ac819b7f252e97d
@mschilli87
Copy link

Can confirm this happens to me, too.

@WhyNotHugo
Copy link
Member

The output of pip freeze looks incorrect to me. For example, urwid is missing, but we can see that urwid is installed in the stacktrace (and khal wouldn't run without it).

@WhyNotHugo
Copy link
Member

You can check which python is used by khal with head $(which khal). You can check which python is used by pip with head $(which pip).

@mschilli87
Copy link

So here are my data:

khal --version
khal, version 0.11.3
type -a khal | tail -1
khal is /opt/homebrew/bin/khal
head -1 /opt/homebrew/bin/khal
#!/opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python
/opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python -m pip freeze
atomicwrites @ file:///private/tmp/khal--atomicwrites-20240220-5298-re3anx/atomicwrites-1.4.1
certifi==2024.7.4
cffi==1.17.0
click @ file:///private/tmp/khal--click-20240220-5298-6t5kte/click-8.1.7
click-log @ file:///private/tmp/khal--click-log-20240220-5298-enotex/click-log-0.4.0
configobj @ file:///private/tmp/khal--configobj-20240220-5298-eakrr1/configobj-5.0.8
gpg==1.23.2
icalendar @ file:///private/tmp/khal--icalendar-20240220-5298-16081e/icalendar-5.0.11
isort @ file:///private/tmp/isort-20231213-5569-xd5jwh/isort-5.13.2
khal @ file:///private/tmp/khal-20240220-5298-jn2xq7/khal-0.11.3
notmuch==0.38.3
notmuch2==0.38.3
numpy==2.0.1
openvino==2024.2.0
openvino-telemetry==2023.2.1
packaging==24.0
pycparser==2.22
PyQt6==6.7.1
PyQt6-3D==6.7.0
PyQt6-Charts==6.7.0
PyQt6-DataVisualization==6.7.0
PyQt6-NetworkAuth==6.7.0
PyQt6-WebEngine==6.7.0
PyQt6_sip==13.8.0
python-dateutil @ file:///private/tmp/khal--python-dateutil-20240220-5298-jfvnja/python-dateutil-2.8.2
pytz @ file:///private/tmp/khal--pytz-20240220-5298-ryvb74/pytz-2024.1
pyxdg @ file:///private/tmp/khal--pyxdg-20240220-5298-j4zkce/pyxdg-0.28
setuptools==72.2.0
six @ file:///private/tmp/khal--six-20240220-5298-eb3pna/six-1.16.0
TBB==0.2
typing_extensions @ file:///private/tmp/khal--typing-extensions-20240220-5298-fa7krm/typing_extensions-4.9.0
tzlocal @ file:///private/tmp/khal--tzlocal-20240220-5298-zbmkn5/tzlocal-5.2
urwid @ file:///private/tmp/khal--urwid-20240220-5298-lodkaw/urwid-2.5.3
wcwidth @ file:///private/tmp/khal--wcwidth-20240220-5298-qbvmn1/wcwidth-0.2.13
wheel @ file:///opt/homebrew/Cellar/python%403.12/3.12.5/libexec/wheel-0.44.0-py3-none-any.whl#sha256=8d8a590e50bda8422000110e90bc730ebfcd8363d2de80793ac819b7f252e97d

@gachikuku
Copy link
Contributor Author

@WhyNotHugo Thanks for replying.
Nice blog by the way.

Here's mine data:

  • head $(which khal)

     #!/opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python
     # -*- coding: utf-8 -*-
     import re
     import sys
     from khal.cli import main_khal
     if __name__ == '__main__':
     	sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
     	sys.exit(main_khal())
    
  • head $(which pip)

     #!/opt/homebrew/opt/[email protected]/bin/python3.12
     # -*- coding: utf-8 -*-
     import re
     import sys
     from pip._internal.cli.main import main
     if __name__ == '__main__':
     	sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
     	sys.exit(main())
    
  • khal --version

     khal, version 0.11.3
    
  • type -a khal | tail -1

     khal is /opt/homebrew/bin/khal
    
  • head -1 /opt/homebrew/bin/khal

     #!/opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python
    
  • /opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python -m pip freeze

     atomicwrites @ file:///private/tmp/khal--atomicwrites-20240220-5298-re3anx/atomicwrites-1.4.1
     certifi==2024.7.4
     cffi==1.17.0
     click @ file:///private/tmp/khal--click-20240220-5298-6t5kte/click-8.1.7
     click-log @ file:///private/tmp/khal--click-log-20240220-5298-enotex/click-log-0.4.0
     configobj @ file:///private/tmp/khal--configobj-20240220-5298-eakrr1/configobj-5.0.8
     gpg==1.23.2
     icalendar @ file:///private/tmp/khal--icalendar-20240220-5298-16081e/icalendar-5.0.11
     khal @ file:///private/tmp/khal-20240220-5298-jn2xq7/khal-0.11.3
     meson==1.5.1
     notmuch==0.38.3
     notmuch2==0.38.3
     pycparser==2.22
     python-dateutil @ file:///private/tmp/khal--python-dateutil-20240220-5298-jfvnja/python-dateutil-2.8.2
     pytz @ file:///private/tmp/khal--pytz-20240220-5298-ryvb74/pytz-2024.1
     pyxdg @ file:///private/tmp/khal--pyxdg-20240220-5298-j4zkce/pyxdg-0.28
     six @ file:///private/tmp/khal--six-20240220-5298-eb3pna/six-1.16.0
     TBB==0.2
     typing_extensions @ file:///private/tmp/khal--typing-extensions-20240220-5298-fa7krm/typing_extensions-4.9.0
     tzlocal @ file:///private/tmp/khal--tzlocal-20240220-5298-zbmkn5/tzlocal-5.2
     urwid @ file:///private/tmp/khal--urwid-20240220-5298-lodkaw/urwid-2.5.3
     wcwidth @ file:///private/tmp/khal--wcwidth-20240220-5298-qbvmn1/wcwidth-0.2.13
     wheel @ file:///opt/homebrew/Cellar/python%403.12/3.12.5/libexec/wheel-0.44.0-py3-none-any.whl#sha256=8d8a590e50bda8422000110e90bc730ebfcd8363d2de80793ac819b7f252e97d
    

@geier
Copy link
Member

geier commented Aug 19, 2024 via email

@WhyNotHugo
Copy link
Member

I can reproduce with these dependency versions:

atomicwrites==1.4.1
certifi==2024.7.4
cffi==1.17.0
click==8.1.7
click-log==0.4.0
configobj==5.0.8
icalendar==5.0.11
pycparser==2.22
python-dateutil==2.8.2
pytz==2024.1
pyxdg==0.28
six==1.16.0
typing_extensions==4.9.0
tzlocal==5.2
urwid==2.5.3
wcwidth==0.2.13

@WhyNotHugo
Copy link
Member

I can't reproduce with these:

atomicwrites==1.4.1
click==8.1.7
click-log==0.4.0
configobj==5.0.8
icalendar==5.0.13
khal==0.11.3
python-dateutil==2.9.0.post0
pytz==2024.1
pyxdg==0.28
six==1.16.0
typing_extensions==4.12.2
tzlocal==5.2
urwid==2.6.15
wcwidth==0.2.13

@WhyNotHugo
Copy link
Member

Try upgrading urwid.

@gachikuku
Copy link
Contributor Author

It works!

After running /opt/homebrew/Cellar/khal/0.11.3/libexec/bin/python -m pip install --upgrade urwid

    Uninstalling urwid-2.5.3:
      Successfully uninstalled urwid-2.5.3
Successfully installed urwid-2.6.15

Thanks everyone.

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

4 participants