Bug report
Bug description:
The two-argument form of aiter() hides everything the callable is waiting on. The awaitable it produces exposes nothing about the coroutine it wraps, so the walk stops there
Repro:
import asyncio
async def deep():
await asyncio.Event().wait()
async def produce():
await deep()
return 1
async def worker():
async for _ in aiter(produce, None):
pass
async def main():
t = asyncio.create_task(worker(), name='worker')
await asyncio.sleep(0.05)
asyncio.print_call_graph(t)
t.cancel()
asyncio.run(main())
Expected:
* Task(name='worker', id=0x105e7cb90)
+ Call stack:
| File '/Users/timofeiivankov/cpython/Lib/asyncio/locks.py', line 210, in async Event.wait()
| File '/Users/timofeiivankov/cpython/repro.py', line 4, in async deep()
| File '/Users/timofeiivankov/cpython/repro.py', line 7, in async produce()
| File '/Users/timofeiivankov/cpython/repro.py', line 11, in async worker()
Actual:
* Task(name='worker', id=0x105adcb90)
+ Call stack:
| File '/Users/timofeiivankov/cpython/repro.py', line 11, in async worker()
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Bug report
Bug description:
The two-argument form of
aiter()hides everything the callable is waiting on. The awaitable it produces exposes nothing about the coroutine it wraps, so the walk stops thereRepro:
Expected:
Actual:
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS