fix: use utf-8 for harness codex prompts
This commit is contained in:
+2
-1
@@ -375,7 +375,8 @@ class StepExecutor:
|
|||||||
prompt = preamble + step_file.read_text(encoding="utf-8")
|
prompt = preamble + step_file.read_text(encoding="utf-8")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[self._codex_command(), "exec", "--dangerously-bypass-approvals-and-sandbox", "--json", "-"],
|
[self._codex_command(), "exec", "--dangerously-bypass-approvals-and-sandbox", "--json", "-"],
|
||||||
cwd=self._root, capture_output=True, text=True, input=prompt, timeout=1800,
|
cwd=self._root, capture_output=True, text=True, input=prompt,
|
||||||
|
encoding="utf-8", errors="replace", timeout=1800,
|
||||||
)
|
)
|
||||||
|
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ class ExecuteRunnerSafetyTests(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(kwargs["input"], long_preamble + "# Step 1\n")
|
self.assertEqual(kwargs["input"], long_preamble + "# Step 1\n")
|
||||||
self.assertEqual(kwargs["cwd"], str(root))
|
self.assertEqual(kwargs["cwd"], str(root))
|
||||||
|
self.assertEqual(kwargs["encoding"], "utf-8")
|
||||||
|
self.assertEqual(kwargs["errors"], "replace")
|
||||||
|
|
||||||
def test_codex_command_prefers_windows_cmd_or_exe_shim(self):
|
def test_codex_command_prefers_windows_cmd_or_exe_shim(self):
|
||||||
execute = load_execute()
|
execute = load_execute()
|
||||||
|
|||||||
Reference in New Issue
Block a user