From 0e2808729e20e09dfe3581b15ab1018f839ff636 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sun, 26 Jul 2026 08:37:14 -0700 Subject: [PATCH] fix(lint): encode remaining write_text calls in the tool_search livetest harness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Windows-footgun check is red on current main, not just on this branch: a2c42be93c added `encoding="utf-8"` to one `write_text` in this file and missed the other two. Line 190 is what the checker reports. Line 211 has the same defect but the call is split across lines, so the single-line regex never flagged it — fixing only the reported site would have left the same bug in the file and re-armed it for the next reader. Both now pass an explicit encoding, matching line 68. --- scripts/tool_search_livetest2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tool_search_livetest2.py b/scripts/tool_search_livetest2.py index b81f91f91afd0..dd9b9dd0faa0f 100644 --- a/scripts/tool_search_livetest2.py +++ b/scripts/tool_search_livetest2.py @@ -187,7 +187,7 @@ def run_one(scenario: Dict[str, Any], mode: str, rep: int, out_dir: Path) -> Dic "final_response": base._redact_secrets(final_response)[:500], } out_path = out_dir / f"{scenario['id']}__{'enabled' if enabled else 'disabled'}__rep{rep}.json" - out_path.write_text(json.dumps(rec, indent=1)) + out_path.write_text(json.dumps(rec, indent=1), encoding="utf-8") shutil.rmtree(Path(os.environ["HERMES_HOME"]).parent, ignore_errors=True) return rec @@ -210,7 +210,7 @@ def main(): summary_name = os.environ.get("TS_BENCH_SUMMARY", "_bench_summary.json") (out_dir / summary_name).write_text(json.dumps( [{k: v for k, v in r.items() if k not in ("per_call_usage", "bridge_calls", "final_response")} for r in rows], - indent=1)) + indent=1), encoding="utf-8") print("done ->", out_dir / summary_name)