Control: the time-skip check and tune engine reads also tolerate non-UTF-8 output (#4675)

This commit is contained in:
Niko1221 committed 2026-10-30 19:12:42 +01:00
1 parent dd63f88fdd
commit 1ead709790
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -160,10 +160,10 @@ def _run_shell(command: str, cwd: str, timeout: float, env: dict[str, str]) -> "
so a hung check would block here until it ended on its own. On Windows the whole tree is killed.
"""
if os.name != "nt":
return subprocess.run(command, shell=True, cwd=cwd, capture_output=True, text=True,
return subprocess.run(command, shell=True, cwd=cwd, capture_output=True, text=True, errors="replace",
timeout=timeout, env=env)
with subprocess.Popen(command, shell=True, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, env=env) as process:
text=True, errors="replace", env=env) as process:
try:
out, err = process.communicate(timeout=timeout)
except subprocess.TimeoutExpired:
+1 -1
View File
@@ -435,7 +435,7 @@ class EngineHarness:
self._proc = lifeline.popen(
self._argv(), "engine", cwd=str(self.cwd), env=self.env,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, bufsize=1)
text=True, errors="replace", bufsize=1)
except OSError as e:
raise MeasurementError(f"the engine could not be started: {e}") from e