fp12 / pychallonge_async

Python bindings for the CHALLONGE! API
http://challonge.com/api
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

include_matches doesn't work #4

Closed jacobSingh closed 7 years ago

jacobSingh commented 7 years ago

account.tournaments.show(t["id"], include_matches=1)

File "/Users/jacob/stuff/abg/ripper/abg/challonge.py", line 51, in flatten tournament = await self.account.tournaments.show(t["id"], include_matches=1) File "/Users/jacob/stuff/abg/src/pychallonge/challonge/tournaments.py", line 21, in show return await self._account.fetch_and_parse("GET", "tournaments/%s" % tournament, params) File "/Users/jacob/stuff/abg/src/pychallonge/challonge/account.py", line 71, in fetch_and_parse doc = ElementTree.fromstring(await self.fetch(method, uri, params_prefix, params)) File "/Users/jacob/stuff/abg/src/pychallonge/challonge/account.py", line 62, in fetch async with self._session.request(method, url, params=params, auth=aiohttp.BasicAuth(self._user, self._api_key)) as response: File "/Users/jacob/anaconda/envs/abg/lib/python3.5/site-packages/aiohttp/client.py", line 529, in aenter self._resp = yield from self._coro File "/Users/jacob/anaconda/envs/abg/lib/python3.5/site-packages/aiohttp/client.py", line 162, in _request proxy=proxy, proxy_auth=proxy_auth, timeout=timeout) File "/Users/jacob/anaconda/envs/abg/lib/python3.5/site-packages/aiohttp/client_reqrep.py", line 79, in init url2 = url.with_query(params) File "/Users/jacob/anaconda/envs/abg/lib/python3.5/site-packages/yarl/init.py", line 683, in with_query for k, v in query) File "/Users/jacob/anaconda/envs/abg/lib/python3.5/site-packages/yarl/init.py", line 683, in for k, v in query) File "yarl/_quoting.pyx", line 46, in yarl._quoting._quote (yarl/_quoting.c:1393)

PeterCat12 commented 7 years ago

I believe you have have to send the param value as a string. ex tournament_data = await account.tournaments.show( tournament=tournament_name, include_participants='1', include_matches='1') Works for me.

jacobSingh commented 7 years ago

That does work. I'm closing... but perhaps we should do something to make this more obvious.... It's obviously going to happen to others. THanks!

PeterCat12 commented 7 years ago

I agree. It actually did happen to me too :)

fp12 commented 7 years ago

You may have a recent version of aiohttp in which they broke this (and it won't be fixed). Please check this issue. That's why I recently changed the dependencies to: aiohttp>=1.0,<1.1 So you can still use non-strings in your requests! Cheers!