8000 asyncio dev docs claim that asyncio debug mode checks for unawaited coroutines · Issue #133515 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

asyncio dev docs claim that asyncio debug mode checks for unawaited coroutines #133515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
graingert opened this issue May 6, 2025 · 0 comments
Closed
Labels
docs Documentation in the Doc dir topic-asyncio

Comments

@graingert
Copy link
Contributor
graingert commented May 6, 2025

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

@graingert graingert added the docs Documentation in the Doc dir label May 6, 2025
@github-project-automation github-project-automation bot moved this to Todo in asyncio May 7, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 16, 2025
…honGH-134081)

(cherry picked from commit d94b1e9)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 16, 2025
…honGH-134081)

(cherry picked from commit d94b1e9)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
kumaraditya303 added a commit that referenced this issue May 16, 2025
…-134081) (#134093)

gh-133515: fix docs for unawaited coroutines in debug mode (GH-134081)
(cherry picked from commit d94b1e9)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
kumaraditya303 added a commit that referenced this issue May 16, 2025
…-134081) (#134094)

gh-133515: fix docs for unawaited coroutines in debug mode (GH-134081)
(cherry picked from commit d94b1e9)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-asyncio
Projects
Status: Done
Status: Todo
Development

No branches or pull requests

3 participants
0