subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_once(cmd: str, cwd: Path, output_dir: Path, index: int) -> RunResult: start = time.time() proc = subprocess.run(cmd, cwd=str(cwd), shell=True, text=True, capture_output=True) duration_ms = int((time.time() - start) * 1000) stdout_path = output_dir / f"run_{index}.stdout.log" stderr_path = output_dir / f"run_{index}.stderr.log"- Confidence
- 97% confidence
- Finding
- proc = subprocess.run(cmd, cwd=str(cwd), shell=True, text=True, capture_output=True)
