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

Plugins not working with python 3.11 #524

Closed
mcschempp opened this issue May 9, 2023 · 5 comments
Closed

Plugins not working with python 3.11 #524

mcschempp opened this issue May 9, 2023 · 5 comments
Labels

Comments

@mcschempp
Copy link

Describe the bug
When using python 3.11, I get the following exception for all plugins:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/safeeyes/plugin_manager.py", line 86, in init
    self.__load_plugin(plugin)
  File "/usr/lib/python3.11/site-packages/safeeyes/plugin_manager.py", line 303, in __load_plugin
    self.__init_plugin(module, plugin_obj)
  File "/usr/lib/python3.11/site-packages/safeeyes/plugin_manager.py", line 324, in __init_plugin
    if utility.has_method(module, 'on_start'):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/safeeyes/utility.py", line 669, in has_method
    if len(inspect.getargspec(getattr(module, method_name)).args) == no_of_args:
           ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'

safeeyes.log

might be related to pyinvoke/invoke#833

To Reproduce
Steps to reproduce the behavior:

  1. open safeeyes/plugin_manager.py in an editor
  2. log the BaseException in line 87 with logging.exception

Expected behavior
the exception should not happe

Desktop (please complete the following information):

  • OS: Arch Linux
  • Desktop Env: i3
  • Version: 2.1.5
@mcschempp mcschempp added the bug label May 9, 2023
@mcschempp
Copy link
Author

I fixed this issue by applying the suggested workaround mentioned in pyinvoke/invoke#833 (comment)

I opened /usr/lib/python3.11/site-packages/safeeyes/utility.py and added

if not hasattr(inspect, 'getargspec'):
    inspect.getargspec = inspect.getfullargspec

after

import inspect

@BrunoBernardino
Copy link

BrunoBernardino commented Jun 7, 2023

I just had the same issue (Manjaro, so Arch-based), and the suggested workaround fixed it, thanks!

@hartwork
Copy link
Contributor

This seems to be a duplicate of #491 and #522 which are both fixed by #505 on Git master.

@hartwork
Copy link
Contributor

hartwork commented Aug 3, 2023

@slgobinath can this be closed as fixed in 2.1.6?

@slgobinath
Copy link
Owner

Yes it can be closed.
Thanks @hartwork

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

No branches or pull requests

4 participants