You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read and write all text files as explicit UTF-8 #90
About 570 .read_text() calls and 220 .write_text() calls in harness/web_fetch, harness/lexbench and harness/web_search pass no encoding. Trajectory Replay has about 44 more (report_compaction.py, webarena_report_check.py, public_webarena/diagnostics.py, webarena_report.py), and Browser Use has a few (report_publish.py:241, report_package.py:66).
These calls read and write Chinese HTML and JSON with the locale encoding. They fail on Windows and under LC_ALL=C when PYTHONUTF8 is off. #84 is one instance of the same class of bug, in the risk-control compiler.
Proposal
Add encoding="utf-8" to every text I/O call with a mechanical codemod. Also cover open() in text mode.
Enforce with ruff PLW1514 (preview rule).
Add one regression test that runs a report build under PYTHONUTF8=0 LC_ALL=C.
Risk: low. Depends on: lint coverage stage 1. Related: #84.
Activity