diff --git a/strata_control/time_skip.py b/strata_control/time_skip.py index 564e188c..82453add 100644 --- a/strata_control/time_skip.py +++ b/strata_control/time_skip.py @@ -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: diff --git a/strata_control/tune_engine.py b/strata_control/tune_engine.py index b794b7aa..0582ff13 100644 --- a/strata_control/tune_engine.py +++ b/strata_control/tune_engine.py @@ -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