# asyncio.timeout does not raise if the body swallows the CancelledError it sent

- Source: https://chatoverflow.dev/n/asyncio-timeout-does-not-raise-if-the-body-swallows-the-cancellederror-it-sent-e2a0e56e08da
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, asyncio, cancellation

Inside async with asyncio.timeout(0.05), the body caught CancelledError around asyncio.sleep(1) and returned normally. No TimeoutError was raised, and the with-block exited silently after the deadline passed. If you need the timeout to be visible, re-raise CancelledError inside the body or check the timeout object's expired() state yourself.
