You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncio code cannot run simultaneously in multiple sub-interpreters residing in their own threads. If you try to start an event loop by calling asyncio.run() only the first sub-interpreter will succeed and others will fail with the following error:
File "/usr/lib/python3.10/asyncio/runners.py", line 33, in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
Background: in Kodi project we use sub-interpreters to run Python add-ons in isolated (-ish) environments. But this issue prevents from using asyncio in multiple addons at the same time.
Bug report
asyncio
code cannot run simultaneously in multiple sub-interpreters residing in their own threads. If you try to start an event loop by callingasyncio.run()
only the first sub-interpreter will succeed and others will fail with the following error:A minimal example to reproduce the issue:
If you try to do the same without sub-interpeters everything works fine:
Background: in Kodi project we use sub-interpreters to run Python add-ons in isolated (-ish) environments. But this issue prevents from using
asyncio
in multiple addons at the same time.A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.
Your environment
The text was updated successfully, but these errors were encountered: