Skip to content

Problems with urwid on macOS + Python 3.13.3 #24

Description

@Kimitri

urlscan fails to run on macOS with Python 3.13.3. I also tried running it on Python 3.12.10 (using pyenv and installing urlscan with pipx) but it didn't help. Here's the traceback:

Traceback (most recent call last):
  File "/usr/local/bin/urlscan", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urlscan/__main__.py", line 197, in main
    tui.main()
    ~~~~~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urlscan/urlchoose.py", line 292, in main
    self.loop.run()
    ~~~~~~~~~~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urwid/event_loop/main_loop.py", line 339, in run
    self._run()
    ~~~~~~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urwid/event_loop/main_loop.py", line 441, in _run
    self.event_loop.run()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urwid/event_loop/select_loop.py", line 182, in run
    self._loop()
    ~~~~~~~~~~^^
  File "/usr/local/Cellar/urlscan/1.0.7/libexec/lib/python3.13/site-packages/urwid/event_loop/select_loop.py", line 192, in _loop
    selector.register(fd, selectors.EVENT_READ, callback)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/selectors.py", line 505, in register
    self._selector.control([kev], 0, 0)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument

Things do seem to work a bit better when I add an if statement to check the fd variable before the selector.register is run but then the keyboard navigation does not work on the url selection. I'm not a pythonista so I'm not that well versed in debugging this code but I'll gladly help resolving this.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions