fix: harden subprocess output decoding across lessons

This commit is contained in:
Haoran
2026-08-26 01:05:16 +08:00
parent 3e17b98504
commit cce031e632
34 changed files with 178 additions and 75 deletions

View File

@@ -273,7 +273,7 @@ def _run_bash(command: str) -> str:
try:
r = subprocess.run(
command, shell=True, cwd=WORKDIR,
capture_output=True, text=True, timeout=120,
capture_output=True, text=True, errors="replace", timeout=120,
)
out = (r.stdout + r.stderr).strip()
return out[:50000] if out else "(no output)"