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

Node can't start because Python 3.11 dropped inspect.getargspec #396

Open
xiaoyuejin opened this issue May 25, 2023 · 1 comment
Open

Node can't start because Python 3.11 dropped inspect.getargspec #396

xiaoyuejin opened this issue May 25, 2023 · 1 comment

Comments

@xiaoyuejin
Copy link

Just upgraded to Python 3.11 and got this error:

......\Lib\site-packages\labrad\decorators.py", line 111, in init
argspec = inspect.getargspec(self.func)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

Turned out Python 3.11 dropped inspect.getargspec completely, hence the error.

The current version of pylabrad in this repo has solved the problem by replacing inspect.getargspec with inspect.getfullargspec. However, this improvement happened after the latest release (0.98.2). So if someone uses python 3.11 and only pip install pylabrad, he will get the error and the node will fail to start.

So basically, a new release (0.98.21?) based on the current repo will solve the problem.

@xiaoyuejin
Copy link
Author

A new but similar issue:

Lib\site-packages\labrad\node_init_.py", line 644, in refreshServers
config = server_config.from_string(conf, f, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\LabRAD\WPy64-31221b3\python-3.12.2.amd64\Lib\site-packages\labrad\node\server_config.py", line 33, in from_string
scp.readfp(io.StringIO(conf))
^^^^^^^^^^
AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?

Fixed by replacing ConfigParser.readfp() with ConfigParser.read_file().

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

1 participant