Closed yakMM closed 1 year ago
Thanks for the report - this is a known issue with current implementation details of aiohttp and asyncio: https://docs.aiohttp.org/en/stable/client_advanced.html#graceful-shutdown
So while technically not related to this project, I'll look into adding a brief sleep as part of the client close()
method to avoid confusion for users.
Fixed upstream in Python 3.11. For previous versions, a janky workaround has been in 2bc89d7.
Not really relevant for real use, but might be impactful for new users as it's a basic example from the README
Reproduction steps:
Config: Python 3.10.4, auraxium 0.2.2, windows 10.
Running the following script as main.py from the github README:
Expected result:
The script is working, data from the api is properly displayed => OK
Unexpected result:
RuntimeError raised during the cleanup phase:
Workaround:
Adding
asyncio.sleep(2)
at the end of themain
function fixes the problem, I assume the connection is not closed properly before the loop is closed.