SyntaxError: duplicate argument 'interfaces' in function definition

Open Beginner friendly
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start with corellium_api/models/partial_update_interconnect_request.py at the init definition around line 50, then compare the generated model with the 0.4.1 client or the repository version referenced in the report. Confirm that the package imports successfully and that CorelliumApi can be instantiated without the duplicate-argument SyntaxError.

Written by the indexing model from the issue text.

Description

Description

Corellium SDK version installed via pip: corellium-api==0.4.2

I followed the instructions in the README file. This is my code that is reproducing the error:

from __future__ import print_function

import asyncio
import corellium_api

HOST = "https://***.corellium.com/api" # redacted
USERNAME = "testuser"
PASSWORD = "testpass"
configuration = corellium_api.Configuration(
    host=HOST,
    username=USERNAME,
    password=PASSWORD,
)

async def main():
    async with corellium_api.ApiClient(configuration) as api_client:
        # Create an instance of the API class
        client = corellium_api.CorelliumApi(api_client)

        project = await client.v1_get_project(
            project_id="<some-project-id>"
        )

if __name__ == "__main__":
    asyncio.run(main())

When running the code above, this produces a SyntaxError:

Traceback (most recent call last):
  File "PythonVenvs/corellium-sdk/main.py", line 4, in <module>
    import corellium_api
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/__init__.py", line 20, in <module>
    from corellium_api.api.corellium_api import CorelliumApi
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/api/__init__.py", line 6, in <module>
    from corellium_api.api.corellium_api import CorelliumApi
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/api/corellium_api.py", line 20, in <module>
    from corellium_api.api_client import ApiClient
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/api_client.py", line 28, in <module>
    import corellium_api.models
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/models/__init__.py", line 121, in <module>
    from corellium_api.models.partial_update_interconnect_request import PartialUpdateInterconnectRequest
  File "PythonVenvs/corellium-sdk/venv/lib/python3.11/site-packages/corellium_api/models/partial_update_interconnect_request.py", line 50
    def __init__(self, name=None, interfaces=None, interfaces=None, local_vars_configuration=None):  # noqa: E501
                                                   ^^^^^^^^^^
SyntaxError: duplicate argument 'interfaces' in function definition

Looking at the file here in this repo yields the same results for duplicate interfaces being passed (referenced here). As a result, this does not allow me to even instantiate the client because it fails immediately when trying to instantiate CorelliumApi.

When I use the previous client here, it works without issues.

This also doesn't appear to happen on corellium-api==0.4.1.

Dominant language
Python
Stars
15
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from corellium/python-api-client

All issues in corellium/python-api-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.