cgrok / clashroyale

Async + Sync wrapper for royaleapi.com and the CR official API
MIT License
47 stars 19 forks source link

Missing positional argument 'timeout' #22

Closed ohkeenan closed 6 years ago

ohkeenan commented 6 years ago

python3.5 examples/async.py / sync.py / etc. Still runs but returns:

Traceback (most recent call last): File "async.py", line 32, in <module> loop.run_until_complete(main()) File "/usr/lib64/python3.5/asyncio/base_events.py", line 467, in run_until_complete return future.result() File "/usr/lib64/python3.5/asyncio/futures.py", line 294, in result raise self._exception File "/usr/lib64/python3.5/asyncio/tasks.py", line 240, in _step result = coro.send(None) File "async.py", line 16, in main await profile.refresh() File "/usr/lib/python3.5/site-packages/clashroyale/models.py", line 141, in _arefresh data, cached, ts = await self.client.request(self.url, refresh=True) TypeError: request() missing 1 required positional argument: 'timeout' Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f677eb19eb8> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f676fe42f60>, 144031.235123359)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f6772f005c0>

Sorry if this is expected

fourjr commented 6 years ago

Issue resolved in 3.4.10 https://github.com/cgrok/clashroyale/commit/bbc5fdfacb45e67db866a08256ed6e15b9a31ee5

ohkeenan commented 6 years ago

Still not clean for me maybe I'm doing something wrong

sync.py is giving this: Traceback (most recent call last): File "examples/sync.py", line 31, in <module> profile.refresh() File "/usr/lib/python3.6/site-packages/clashroyale/models.py", line 137, in refresh data, cached, ts = self.client.request(self.url, refresh=True) TypeError: request() missing 1 required positional argument: 'timeout'

and async.py: Traceback (most recent call last): File "examples/async.py", line 32, in <module> loop.run_until_complete(main()) File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete return future.result() File "examples/async.py", line 16, in main await profile.refresh() File "/usr/lib/python3.6/site-packages/clashroyale/models.py", line 141, in _arefresh data, cached, ts = await self.client.request(self.url, refresh=True) TypeError: request() missing 1 required positional argument: 'timeout' Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f72db7c76d8> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f72de1eada0>, 1321220.18729525)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f72da610400>

➜ pip3.6 list |grep clashroyale clashroyale 3.4.10

➜ git rev-parse --short HEAD bbc5fdf

They do run through though

fourjr commented 6 years ago

Will look into it.

fourjr commented 6 years ago

Issue resolved. Not live yet.

fourjr commented 6 years ago

Issue was related to BaseAttrDict.refresh()

fourjr commented 6 years ago

Resolved in 3.4.11 (the breaking update)

fourjr commented 6 years ago

Examples are re-done in 3.5.0