fix(lint): encode remaining write_text calls in the tool_search livetest harness
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.
This commit is contained in:
parent
085c7da111
commit
0e2808729e
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue