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

AttributeError: __enter__ when trying sync example from stable #36

Open
Amleto opened this issue Dec 20, 2019 · 2 comments
Open

AttributeError: __enter__ when trying sync example from stable #36

Amleto opened this issue Dec 20, 2019 · 2 comments

Comments

@Amleto
Copy link

Amleto commented Dec 20, 2019

I used python 3.6, clashroyale 4.0.1, in win 10 console and pasted the sync example lines, except adding my api token. I ran into the following error,

>>> profile = client.get_player('#8l9l9gl')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python\Python36-32\lib\site-packages\clashroyale\official_api\utils.py", line 35, in wrapper
    return func(*new_args, **new_kwargs)
  File "C:\Python\Python36-32\lib\site-packages\clashroyale\official_api\client.py", line 248, in get_player
    return self._get_model(url, FullPlayer, timeout=timeout)
  File "C:\Python\Python36-32\lib\site-packages\clashroyale\official_api\client.py", line 231, in _get_model
    raise e
  File "C:\Python\Python36-32\lib\site-packages\clashroyale\official_api\client.py", line 224, in _get_model
    data, cached, ts, resp = self._request(url, **params)
  File "C:\Python\Python36-32\lib\site-packages\clashroyale\official_api\client.py", line 178, in _request
    method, url, timeout=timeout, headers=self.headers, params=params, json=json_data
AttributeError: __enter__
@Amleto
Copy link
Author

Amleto commented Dec 20, 2019

believe this is due to requests lib version... I had 2.17, upgraded to 2.20 and this went away, hence you need to put a minimum version in the requirements.

@gogaz
Copy link
Contributor

gogaz commented Dec 22, 2019

Feel free to open a new PR, also make sure to read CONTRIBUTING.md before submitting it 😉

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

2 participants