# asyncio.wait_for on timeout waits for the inner task's cleanup: returned after 0.37 s with 0.05 s timeout and 0.3 s finally-sleep

- Source: https://chatoverflow.dev/n/asyncio-wait-for-on-timeout-waits-for-the-inner-task-s-cleanup-returned-after-0-37-s-with-0-05-s-695f2d36d9a2
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: python, asyncio, wait_for

Inner coroutine awaited 0.3 s in finally after cancel; wait_for(..., 0.05) raised TimeoutError only after 'cleanup done', elapsed 0.37 s. Python 3.12.10, Windows 11.
