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

Nyx incompatible with Python 3.11+ (getargspec error) #63

Open
Rijndael1998 opened this issue May 19, 2023 · 4 comments
Open

Nyx incompatible with Python 3.11+ (getargspec error) #63

Rijndael1998 opened this issue May 19, 2023 · 4 comments

Comments

@Rijndael1998
Copy link

When you run nyx and then scroll on any page, it crashes.

Log:

Traceback (most recent call last):
  File "/usr/bin/nyx", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/nyx/__init__.py", line 176, in main
    nyx.starter.main()
  File "/usr/lib/python3.11/site-packages/stem/util/conf.py", line 289, in wrapped
    return func(*args, config = config, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nyx/starter.py", line 128, in main
    nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
  File "/usr/lib/python3.11/site-packages/nyx/curses.py", line 219, in start
    curses.wrapper(_wrapper)
  File "/usr/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nyx/curses.py", line 217, in _wrapper
    function()
  File "/usr/lib/python3.11/site-packages/nyx/__init__.py", line 243, in draw_loop
    keybinding.handle(key)
  File "/usr/lib/python3.11/site-packages/nyx/panel/__init__.py", line 81, in handle
    if inspect.getargspec(self._action).args == ['key']:
       ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
@atagar atagar changed the title Scrolling crashes Nyx Nyx incompatible with Python 3.11+ May 19, 2023
@atagar atagar changed the title Nyx incompatible with Python 3.11+ Nyx incompatible with Python 3.11+ (getargspec error) May 19, 2023
@atagar
Copy link
Collaborator

atagar commented May 19, 2023

Thanks Rijndael! The issue is that Python 3.11 removed the inspect.getargspec() function which broke our compatibility with it.

I left Tor a couple years ago. Nyx is presently unmaintained so this is unlikely to be fixed. If the project gets a new maintainer this should be relatively easy to correct.

@mzivic7
Copy link

mzivic7 commented May 22, 2023

Here is a quick fix until new nyx version is out:
Just replace all inspect.getargspec() with inspect.getfullargspec()

Have installed nyx and run this command as sudo:
find /usr/lib/python3.11/site-packages/nyx -type f -exec sed -i 's/getargspec/getfullargspec/g' {} \;
It will do replacement on all files automatically.

Note that python version in command (/usr/lib/python3.11/) will change in future.

@0ire
Copy link

0ire commented Jul 19, 2023

If installed from an apt repository (ubuntu/debian) it is located in /usr/local/bin/nyx.

sed -i 's/getargspec/getfullargspec/g' /usr/local/bin/nyx
find /usr/local/lib/python3.11/dist-packages/nyx -type f -exec sed -i 's/getargspec/getfullargspec/g' {} \;

is the debian version of patch by @mzivic7

I am willing to take over the maintenance of nyx

edit: On latest debian, this error makes nyx crash at startup.

@mzivic7
Copy link

mzivic7 commented Jul 23, 2023

I am on arch linux, and have no debian-based linux to test, i had no idea that pacman installs nyx to different directory.

So, for debian-based, patch is:
find /usr/local/bin/nyx -type f -exec sed -i 's/getargspec/getfullargspec/g' {} \;

Anyway in this commit to nyx, this bug is fixed, just someone needs to release new version.

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