Skip to content

'function' object has no attribute 'NEEDS_APPLICATION_ID' #80

@buergi

Description

@buergi

Trying to follow the Getting started but keep getting this error

>>> init('myusername', store=True)
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    init('myusername', store=True)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myusername/venv/lib/python3.13/site-packages/trakt/core.py", line 69, in init
    return init_auth(AUTH_METHOD, *args, **kwargs)
  File "/home/myusername/venv/lib/python3.13/site-packages/trakt/auth/__init__.py", line 69, in init_auth
    client_id, client_secret = get_client_info(adapter.NEEDS_APPLICATION_ID, config)
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'NEEDS_APPLICATION_ID'

The problem is that adapter is a function pointer which simply does not have the NEEDS_APPLICATION_ID property, defined in the BaseAdapter class.

The only way I got a working authentication and was able to use the API was using

init('myusername', client_id=my_client_id, client_secret=my_client_secret)

by appending the store=True option to the last call I was able to get a correctly filled ~/.pytrakt.json but I am unable to reload it without requiring to repeat the authorization process.
Even after replacing the adapter.NEEDS_APPLICATION_ID above with False it seems the stored config data is not read but a re-auth is requested every time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions