Skip to content

gh-157044: Preserve asyncio call stacks through callable aiter() - #157202

Open
goutamadwant wants to merge 1 commit into
python:mainfrom
goutamadwant:gh-157044-aiter-call-graph
Open

gh-157044: Preserve asyncio call stacks through callable aiter()#157202
goutamadwant wants to merge 1 commit into
python:mainfrom
goutamadwant:gh-157044-aiter-call-graph

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Sep 9, 2026

Copy link
Copy Markdown

Fixes #157044.

Expose the callable iterator awaitable's wrapped object through a read-only aw_wrapped attribute and follow it when building asyncio call graphs. The wrapper contributes no frame. Release/acquire atomics protect concurrent publication and introspection.

Add regression coverage for both asyncio backends, nested callable iterators, frame limits, and the wrapped object's lifecycle. Iteration behavior is unchanged.

Validation:

  • Debug-build module run: 3,738 tests run, 80 skipped.
  • Focused reference-leak checks passed.
  • Patchcheck passed.
  • Free-threaded runtime tests were not run.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34464668 | 📁 Comparing ba728ed against main (1ac3bfa)

  🔍 Preview build  

2 files changed
± library/functions.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio.print_call_graph() loses the call stack at aiter(callable, stop_value)

1 participant