lczub / TestLink-API-Python-client

A Python client to use the TestLink API
105 stars 63 forks source link

example usage xmlrpc bug - not working for python3.10.11 #163

Open Fermi-4 opened 1 year ago

Fermi-4 commented 1 year ago

Run into error when following the usage docs:

Ran these in shell (with actual params):

set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink]
set TESTLINK_API_PYTHON_SERVER_URL=http://<url>/testlink/lib/api/xmlrpc.php

and getTestCase gives this error:

TypeError: ProxiedTransport.send_request() takes 4 positional arguments but 5 were given

Log:

tls.getTestCase(None, testcaseexternalid='gh-123')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fermi4/.local/share/hatch/env/virtual/opentest-automation/gQ7p0kJt/opentest-automation/lib/python3.10/site-packages/testlink/testlinkdecorators.py", line 112, in wrapperAddDevKey
    return methodAPI(self, *argsPositional, **argsOptional)
  File "/home/fermi4/.local/share/hatch/env/virtual/opentest-automation/gQ7p0kJt/opentest-automation/lib/python3.10/site-packages/testlink/testlinkdecorators.py", line 99, in wrapperWithArgs
    return self.callServerWithPosArgs(methodAPI.__name__, 
  File "/home/fermi4/.local/share/hatch/env/virtual/opentest-automation/gQ7p0kJt/opentest-automation/lib/python3.10/site-packages/testlink/testlinkapigeneric.py", line 1582, in callServerWithPosArgs
    response = self._callServer(methodNameAPI, argsOptional)
  File "/home/fermi4/.local/share/hatch/env/virtual/opentest-automation/gQ7p0kJt/opentest-automation/lib/python3.10/site-packages/testlink/testlinkapigeneric.py", line 2057, in _callServer
    response = getattr(self.server.tl, methodNameAPI)(argsAPI)
  File "/usr/local/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python3.10/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
  File "/usr/local/lib/python3.10/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.10/xmlrpc/client.py", line 1178, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
TypeError: ProxiedTransport.send_request() takes 4 positional arguments but 5 were given
>>> tls.getTestCase(None, testcaseexternalid='gh-123')

Python version:

Python 3.10.11 (main, Jul 11 2023, 22:22:36) [GCC 11.1.0] on linux
lczub commented 1 year ago

Hello Fermi-4,

thanks for this hint. Last tested py version was py39. Will check during next weeks , what to change for py310 compatibility.

Regards Luiko