fix(integration): restore subprocess stdin=DEVNULL / utf-8 encoding guards and windows-footgun gates dropped by round-3 compaction

Repo scanners (check_subprocess_stdin, check-windows-footguns --all) flagged 21 sites where
the r3 single-line collapses lost stdin=DEVNULL, encoding='utf-8'/errors='replace', the
'# windows-footgun: ok' same-line marker, or the getattr(os, 'geteuid') gate. Each guard is
restored at the call site (real portability/hang fixes, not suppressions).
This commit is contained in:
Teknium
2026-09-03 02:46:19 -07:00
parent e1487be830
commit 23b9ffc4fa
19 changed files with 48 additions and 31 deletions
+2 -1
View File
@@ -208,7 +208,8 @@ def _stop_systemd_unit(unit_name: str) -> bool:
if binary is None:
return False
try:
result = subprocess.run([binary, "--user", "stop", unit_name], capture_output=True, timeout=15)
result = subprocess.run([binary, "--user", "stop", unit_name], capture_output=True, timeout=15,
stdin=subprocess.DEVNULL)
if result.returncode != 0:
stderr = (result.stderr or b"").decode(errors="replace").strip()
if any(marker in stderr.lower() for marker in ("not loaded", "not found", "does not exist")):