rhgrant10 / berserk

Python client for the lichess API
https://berserk.readthedocs.io
Other
142 stars 36 forks source link

TypeError using create_open meathod on raspian with Python 3.9 and lastest bersek version #53

Open BlackBeardUWU opened 2 years ago

BlackBeardUWU commented 2 years ago

Description

Trying yo to run this simple code on RPI4, but this error shows up: code:

import berserk

session = berserk.TokenSession("my key lol")
client = berserk.Client(session=session)
challenge = client.challenges.create_open(900, 10, "standard")
print(challenge)

error

  File "/home/blackbeard/Python/lichess.py", line 5, in <module>
    challenge = client.challenges.create_open(900, 10, "standard")
  File "/usr/local/lib/python3.9/dist-packages/berserk-0.10.0-py3.9.egg/berserk/clients.py", line 957, in create_open
  File "/usr/local/lib/python3.9/dist-packages/berserk-0.10.0-py3.9.egg/berserk/session.py", line 72, in post
  File "/usr/local/lib/python3.9/dist-packages/berserk-0.10.0-py3.9.egg/berserk/session.py", line 64, in request
  File "/usr/local/lib/python3.9/dist-packages/berserk-0.10.0-py3.9.egg/berserk/formats.py", line 35, in handle
  File "/usr/local/lib/python3.9/dist-packages/berserk-0.10.0-py3.9.egg/berserk/formats.py", line 76, in parse
  File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 542, in loads
    return cls(encoding=encoding, **kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding'