{
"id": "py-async-blocking-call",
"language": "python",
"group": "performance",
"listingTitle": "Keep blocking Python APIs out of async functions",
"title": "Keep blocking Python APIs out of async functions",
"mvvm": false,
"defaultSeverity": "warn",
"legacyGroup": "performance",
"why": "A synchronous sleep, HTTP request, or subprocess call blocks the event-loop thread and delays unrelated coroutines.",
"suggestion": "Use the library's async API or move unavoidable blocking work to asyncio.to_thread.",
"version": 2,
"semanticMaturity": "token",
"securityKind": "none",
"taxonomy": [
"performance"
],
"requirements": [
"sourceText"
],
"packs": [
"python",
"fastapi"
],
"implementation": "src/languages/python/rules.rs",
"languages": [
"python"
],
"frameworks": [],
"languageVersions": [],
"limitations": [
"Only direct time.sleep, requests.get, requests.post, and subprocess.run calls inside async def bodies are recognized.",
"Aliases, wrappers, executor offloading on surrounding lines, and third-party blocking APIs are not inferred."
]
}