Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion Error on initialization #17

Closed
yasinkaraaslan opened this issue Aug 14, 2022 · 1 comment
Closed

Assertion Error on initialization #17

yasinkaraaslan opened this issue Aug 14, 2022 · 1 comment

Comments

@yasinkaraaslan
Copy link

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.eksisozluk.com:443
DEBUG:urllib3.connectionpool:https://api.eksisozluk.com:443 "POST /Token HTTP/1.1" 400 104
Traceback (most recent call last):
  File "D:\eksisozluk\main.py", line 3, in <module>
    client = EksiApi(username='<myUsername>', password='<myPassword>')  # or EksiApi(username, password)
  File "D:\eksisozluk\venv\lib\site-packages\eksisozluk\EksiSozluk.py", line 61, in __init__
    self.auth()
  File "D\eksisozluk\venv\lib\site-packages\eksisozluk\EksiSozluk.py", line 92, in auth
    self.token = self.login(self.username, self.password)
  File "D\eksisozluk\venv\lib\site-packages\eksisozluk\EksiSozluk.py", line 133, in login
    return EksiToken.from_dict(response.json())
  File "D:\eksisozluk\venv\lib\site-packages\eksisozluk\Models\Auth\EksiToken.py", line 31, in from_dict
    rank = int(from_str(obj.get("rank")))
  File "D:\eksisozluk\venv\lib\site-packages\eksisozluk\Models\__init__.py", line 20, in from_str
    assert isinstance(x, str)
AssertionError

I get this whenever I try to initialize the API with a username and a password. Anonymous initialization works just fine.

@yasinkaraaslan yasinkaraaslan changed the title Assertion Error Assertion Error on initialization Aug 14, 2022
@yasinkaraaslan
Copy link
Author

yasinkaraaslan commented Aug 14, 2022

ok, got it. You have to put your e-mail address in "username" parameter instead of your actual username.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant