Description
Documentation
asyncio-dev docs claim:
asyncio checks for coroutines that were not awaited and logs them; this mitigates the “forgotten await” pitfall.
and the docs that points to claim:
When a coroutine function is called, but not awaited (e.g. coro() instead of await coro()) or the coroutine is not scheduled with asyncio.create_task(), asyncio will emit a RuntimeWarning:
this isn't true, python will produce warnings when coroutines are not awaited regardless of the dev mode of asyncio. The flag to set is -Werror
and then replace sys.unraisablehook
to detect these
I think this is a hold-over from when asyncio had generator based coroutines.
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Status
Activity
gh-133515: fix docs for unawaited coroutines in debug mode (#134081)
pythongh-133515: fix docs for unawaited coroutines in debug mode (pyt…
[3.14] gh-133515: fix docs for unawaited coroutines in debug mode (GH…
[3.13] gh-133515: fix docs for unawaited coroutines in debug mode (GH…
2 remaining items