Will It Vibe logoWill It Vibe?
PY-020Medium severity-8 points

Blocking subprocess call inside an async function

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.

What it detects

subprocess.run/call/check_call/check_output block the calling thread until the child process exits, stalling the event loop for its whole lifetime.

Why it matters

subprocess.run, subprocess.call, subprocess.check_call, and subprocess.check_output all block the calling thread until the child process exits, so calling any of them inside an async function blocks the event loop for the entire lifetime of that subprocess, exactly like time.sleep() or a blocking HTTP call would. A long-running migration, build step, or shell command invoked this way can stall every other coroutine on the loop for seconds or minutes.

How to fix it

Use asyncio's own subprocess API instead: await asyncio.create_subprocess_exec(...) (or create_subprocess_shell) and then await proc.wait() or await proc.communicate(). This runs the child process without blocking the event loop while it waits.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks