pydim doesn't work correctly in python 3.10
Hello! I've been using pydim with Python 3.8 and it works fine. When trying to use it with python 3.10, it doesn't work. I tried to have a look at the source code but I couldn't find any obvious reasons why.
To reproduce the problem, you can use this script:
#!/usr/bin/env python3
import time
import pydim
def callback(data0, data1):
print(data0)
print(data1)
def main():
pydim.dis_set_dns_node('dipnsgpn1.cern.ch,dipnsgpn2.cern.ch')
pydim.dis_set_dns_port(2506)
pydim.dic_info_service('dip/acc/LHC/RunControl/BeamMode/DipData', callback)
while True:
time.sleep(60)
if __name__=="__main__":
main()
In python 3.8 I get this output (expected, maybe except for the warning):
$ ./reproduce_error.py
./reproduce_error.py:13: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
pydim.dic_info_service('dip/acc/LHC/RunControl/BeamMode/DipData', callback)
b'\x00\xc8!\x94#f\xd1\x17\x00\x00\x00\x00\x00\x00\x00\x00'
NO BEAM
In python 3.10 I get:
$ ./reproduce_error.py
Traceback (most recent call last):
File "/home/lphe/Documents/telescope-daq/scripts/./reproduce_error.py", line 19, in <module>
main()
File "/home/lphe/Documents/telescope-daq/scripts/./reproduce_error.py", line 13, in main
pydim.dic_info_service('dip/acc/LHC/RunControl/BeamMode/DipData', callback)
TypeError: Invalid parameters. Expected:string name , string format , int service_type , int timeout , PyObject* callbackFunction, int tag , PyObject* default_value
Thank you in advance!