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

Runtime error: "AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?" - installed from AUR #27

Open
peter-lyons-kehl opened this issue Mar 10, 2024 · 2 comments

Comments

@peter-lyons-kehl
Copy link

Thank you Stuart @stuartlangridge for developing, and Jeffrey @jbouter for packaging on AUR.

Getting "AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?" on Manjaro (= pretty much stable Arch, current as of March 2024, stable kernel, GNOME 45.4, X11). Installed with Pacman from AUR (no errors/warnings reported during installation):
image

# as non-root user - but the same error when run as root, too
❯ hushboard 
Traceback (most recent call last):
  File "/usr/bin/hushboard", line 33, in <module>
    sys.exit(load_entry_point('hushboard==0.0.1', 'console_scripts', 'hushboard')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/hushboard", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.11/site-packages/hushboard/__main__.py", line 7, in <module>
    from . import pulsectl
  File "/usr/lib/python3.11/site-packages/hushboard/pulsectl.py", line 334, in <module>
    class Pulse(object):
  File "/usr/lib/python3.11/site-packages/hushboard/pulsectl.py", line 604, in Pulse
    card_profile_set_by_index = _pulse_method_call(
                                ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/hushboard/pulsectl.py", line 596, in _pulse_method_call
    func_args = list(inspect.getargspec(func or (lambda: None)))
                     ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

Background:

❯ which hushboard 
/usr/bin/hushboard

~ is 📦 v0.7.0 via  v20.4.0 via 🦀 v1.76.0-nightly 
❯ file /usr/bin/hushboard 
/usr/bin/hushboard: Python script, ASCII text executable

❯ vim /usr/bin/hushboard 

❯ head -n 2 /usr/bin/hushboard 
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'hushboard==0.0.1','console_scripts','hushboard'

❯ /usr/bin/python --version
Python 3.11.7

I'm not a Python developer. If you'd like me to investigate, please suggest steps to do, or even better, commands to run.

@stuartlangridge
Copy link
Owner

Huh. OK, the problem is that Python's inspect.getargspec was deprecated when I used it (which I didn't realise) and has now been dropped (in your 3.11, but not in my 3.10). So I'll need to work out how to reimplement that bit in Proper Modern Code. Good catch!

@rrthomas
Copy link

#30 fixes this.

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

3 participants