Issues with asyncio
See original GitHub issueThere seems to be a lot of issues using asnycio class.
import ccxt.async as ccxt
gdax = ccxt.gdax()
print(asyncio.get_event_loop().run_until_complete(gdax.load_markets()))
Throws
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f34fee189b0>
If i call fetch_balance()
I get:
File "uvloop/loop.pyx", line 1203, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:25632)
File ".venv/lib/python3.6/site-packages/ccxt/async/exchanges.py", line 8516, in fetch_balance
balances = await self.privateGetAccounts()
File "venv/lib/python3.6/site-packages/ccxt/async/exchanges.py", line 8678, in request
response = await self.fetch(url, method, headers, body)
File ".venv/lib/python3.6/site-packages/ccxt/async/exchange.py", line 85, in fetch
async with session_method(url, data=body or None, headers=headers, timeout=(self.timeout / 1000)) as response:
File ".venv/lib/python3.6/site-packages/aiohttp/client.py", line 603, in __aenter__
self._resp = yield from self._coro
File ".venv/lib/python3.6/site-packages/aiohttp/client.py", line 239, in _request
resp = req.send(conn)
File ".venv/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 401, in send
writer.write_headers(status_line, self.headers)
File ".venv/lib/python3.6/site-packages/aiohttp/http_writer.py", line 250, in write_headers
[k + SEP + v + END for k, v in headers.items()])
File ".venv/lib/python3.6/site-packages/aiohttp/http_writer.py", line 250, in <listcomp>
[k + SEP + v + END for k, v in headers.items()])
TypeError: must be str, not bytes
It 's not attached to GDAX . I am afraid that it is an overall issue. Good luck, hope that you can find the time.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:63 (37 by maintainers)
Top Results From Across the Web
Python asyncio issues - asynchronous - Stack Overflow
I have no idea what could be going on. There is no exception, and no data seems to be sent. import asyncio loop...
Read more >Issues · python/asyncio - GitHub
Issues list ; Why asyncio.transport.write() function don`t send data until I use transport.close() or stop the event loop. #501 opened on Sep 28,...
Read more >Developing with asyncio — Python 3.11.1 documentation
Asynchronous programming is different from classic “sequential” programming. This page lists common mistakes and traps and explains how to avoid them.
Read more >How to Avoid Issues When Waiting On Multiple Events in ...
Asyncio is a powerful way to implement multitasking in Python but failing to use it properly can lead to poor code performance.
Read more >Solve a batch of problems using asyncio - Azure Quantum
To submit a batch of problems and run other processing steps while waiting for them to finish, one option would be to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kroitor , I checked, it works correctly thank you!
@kroitor all good, works perfectly now, thanks again!