"TypeError: __init__() got an unexpected keyword argument 'headers'" Error when importing TCMS from tcms_api

Viewed 3233

I'm running Python 3.8.3

From the following code, from tcms_api import TCMS throws an error.

    from tcms_api import TCMS

    rpc_client = TCMS()

    test_case = rpc_client.TestCase.create({
        'summary': 'My testing',
        'product': 2,
        'category': 2,
        'priority': 1,
        'is_automated': True,
        'text': 'my first test case',
        'case_status': 2,  # CONFIRMED
    })

Error:

Traceback (most recent call last):
  File "C:/Users/bokro/PycharmProjects/tcms/Test.py", line 1, in <module>
    from tcms_api import TCMS
  File "C:\Users\bokro\AppData\Local\Programs\Python\Python38\lib\site-packages\tcms_api\__init__.py", line 81, in <module>
    from tcms_api.xmlrpc import TCMSXmlrpc, TCMSKerbXmlrpc
  File "C:\Users\bokro\AppData\Local\Programs\Python\Python38\lib\site-packages\tcms_api\xmlrpc.py", line 130, in <module>
    class TCMSKerbXmlrpc(TCMSXmlrpc):
  File "C:\Users\bokro\AppData\Local\Programs\Python\Python38\lib\site-packages\tcms_api\xmlrpc.py", line 137, in TCMSKerbXmlrpc
    transport = KerbTransport()
  File "C:\Users\bokro\AppData\Local\Programs\Python\Python38\lib\xmlrpc\client.py", line 1351, in __init__
    super().__init__(use_datetime=use_datetime,
TypeError: __init__() got an unexpected keyword argument 'headers'

Process finished with exit code 1

I have endlessly looked everywhere online and haven't been able to find anybody with the same issue. I am wondering if anybody has experienced this problem or knows how to solve it. Any help with this would be greatly appreciated.

SOLUTION: For anybody experiencing the same issue, I have solved it by downgrading to Python 3.6. The API does not seem to be compatible with 3.8. Hope this helped someone.

1 Answers

SOLUTION: For anybody experiencing the same issue, I have solved it by downgrading to Python 3.6. The API does not seem to be compatible with 3.8. Hope this helped someone.

Glad to see you were able to resolve this. In particular the transport classes, KerbTransport() as it seems in your case, inherit from standard networking transport classes in Python which change from version to version.

tcms-api is currently developed and tested only on Python 3.6.

Related