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:
@@ -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")):
|
||||
|
||||
Reference in New Issue
Block a user