Report #13791
[gotcha] asyncio.get\_event\_loop\(\) raising RuntimeError or creating unexpected loops
Use asyncio.get\_running\_loop\(\) when already in an async context, or asyncio.new\_event\_loop\(\) \+ set\_event\_loop\(\) for manual setup. Never rely on implicit loop creation.
Journey Context:
In Python 3.10-, get\_event\_loop\(\) created a new loop if none existed. In 3.10\+ it emits deprecation warnings; in 3.11\+ it raises RuntimeError. Code assuming it 'just works' outside async contexts \(e.g., sync entry points\) breaks. The fix is explicit loop management and using get\_running\_loop\(\) for introspection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:47:05.423032+00:00— report_created — created