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

sysconfig.get_config_var("SO") deprecated and removed in python 3.11 #44

Open
donaldmunro opened this issue May 5, 2023 · 7 comments
Open

Comments

@donaldmunro
Copy link

donaldmunro commented May 5, 2023

sysconfig.get_config_var("SO") is used in init.py:

_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO")))

but returns None in python 3.11:

python --version
Python 3.11.3

python
Python 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> print(sysconfig.get_config_var("SO"))
None

leading to errors like:

Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 8, in <module>
    from mainUi import MainWindow
  File "/usr/lib/keyboard-center/mainUi.py", line 23, in <module>
    from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
  File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in <module>
    import uinput
  File "/usr/lib/python3.11/site-packages/uinput/__init__.py", line 86, in <module>
    _libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
                                                                                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

To fix change to

sysconfig.get_config_var("EXT_SUFFIX")
@ehfd
Copy link

ehfd commented Aug 4, 2023

https://github.com/selkies-project/python-uinput
We accept pull requests.

@rkmax
Copy link

rkmax commented Oct 19, 2023

@ehfd yeah the fix was merged in your fork but version 0.11.3 is not published. could you please provide me instructions of how to install your version instead this one

@ehfd
Copy link

ehfd commented Oct 19, 2023

setup.cfg: python-uinput @ git+https://github.com/selkies-project/[email protected]

pip3 install git+https://github.com/selkies-project/[email protected]

@rkmax

@Kuba314
Copy link

Kuba314 commented Jan 20, 2024

Btw I e-mailed the original author of the python-uinput project (this repo's owner) a month ago about this issue and they still haven't replied. What's weird is that the github account seems active.

@ehfd
Copy link

ehfd commented Jan 20, 2024

We have ultimately abandoned this codebase completely. Use python-evdev.

@gitanat
Copy link
Contributor

gitanat commented Feb 18, 2024

Merged in https://github.com/pyinput/python-uinput2 (with minor changes)

@tuomasjjrasanen
Copy link
Owner

I'm alive, see my comment: #49 (comment)

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

6 participants