python-ivi / python-vxi11

Provides a VXI-11 driver for controlling instruments over Ethernet
MIT License
161 stars 72 forks source link

Python3.13: ModuleNotFoundError: No module named 'xdrlib' #49

Open Bastian-Krause opened 1 month ago

Bastian-Krause commented 1 month ago

python-vxi11 uses xdrlib: https://github.com/python-ivi/python-vxi11/blob/cc4671da699f1f379137dc40ffc4a302d72e6f55/vxi11/rpc.py#L22 https://github.com/python-ivi/python-vxi11/blob/cc4671da699f1f379137dc40ffc4a302d72e6f55/vxi11/rpc.py#L65 https://github.com/python-ivi/python-vxi11/blob/cc4671da699f1f379137dc40ffc4a302d72e6f55/vxi11/rpc.py#L100

The xdrlib module documentation in the Python standard library reads:

Deprecated since version 3.11, will be removed in version 3.13: The xdrlib module is deprecated (see PEP 594 for details).

Python 3.13 is expected on 2024-10-07.

heevasti commented 1 month ago

Importing the vxi11 now indeed fails with ModuleNotFoundError over the xdrlib. Could this be updated to use e.g. the https://pypi.org/project/xdrlib3/ which is a fork, for Python versions >=3.7? Only change needed would be in the import to change it import xdrlib3 as xdrlib. The second fork that is also available, https://pypi.org/project/py-xdrlib/, (version 4.0.2) can also be used. This is even easier if introduced in the project dependencies as the import statement can then stay the same. But the Python version requirement is set for some reason to be >=3.11. This can give compatibility problems with other dependencies to older packages.