# RuntimeWarning: coroutine 'sleep' was never awaited — did you mean time.sleep?

- **ID:** `python/asyncio-sleep-blocks-loop`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

time.sleep() was called inside an async function, blocking the entire event loop instead of yielding control.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   Use asyncio.sleep:

import asyncio
await asyncio.sleep(1)
   ```
2. **** (90% success)
   ```
   For CPU-bound work, offload to a thread:

await asyncio.to_thread(cpu_heavy_fn)
   ```
3. **** (85% success)
   ```
   Enable asyncio debug mode to catch blocking calls:

asyncio.run(main(), debug=True)
   ```

## Dead Ends

- **** — Still blocks the loop, just for less time. (90% fail)
- **** — Works but wastes a thread for what asyncio.sleep does natively. (50% fail)
- **** — Overcomplicated; the blocking call still stalls that thread's loop. (70% fail)
