diff --git a/cron/scheduler.py b/cron/scheduler.py index 40937cf59714..c309c59c4e5a 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -2301,7 +2301,7 @@ def _run_job_script(script_path: str) -> tuple[bool, str]: result = subprocess.run( argv, capture_output=True, - text=True, encoding='utf-8', errors='replace', + text=True, timeout=script_timeout, cwd=str(path.parent), env=env, diff --git a/tests/test_windows_subprocess_no_window_flags.py b/tests/test_windows_subprocess_no_window_flags.py index 8ae181f654b6..0dcf29405ba4 100644 --- a/tests/test_windows_subprocess_no_window_flags.py +++ b/tests/test_windows_subprocess_no_window_flags.py @@ -508,6 +508,8 @@ def test_gateway_force_kill_hides_taskkill_window(monkeypatch): { "capture_output": True, "text": True, + "encoding": "utf-8", + "errors": "replace", "timeout": 10, "creationflags": _CREATE_NO_WINDOW, },