Skip to content

Finish explicit UTF-8 in hash-bound sources and subprocess pipes #162

Closed as not planned

Description

@lanyue-llk

Problem

The explicit UTF-8 change left two kinds of locale-dependent text handling in place.

Hash-bound sources. Editing these moves a hash that frozen evidence compares with current source, so 38 calls in 14 files stay implicit. tests/test_explicit_utf8_io.py lists each file, its reason and its call count:

Binding Files
Web Fetch scoring_source_sha256 src/lexbench_webfetch/scoring.py
after_sha256 in code-migration.json src/lexbench_webfetch/cli.py, scoring_regressions.py
Search scoring_source_sha256 and collection_implementation src/lexbench_websearch/qualification.py, relevance.py, rubric.py
collection_implementation src/harness/web_search/runner.py
Resource protocol orchestrator_sha256 src/harness/lexbench/resource_matrix.py, resource_profiles.py
Public reproduction copy src/harness/lexbench/charts.py
Visual receipts src/harness/reporting/visual.py, trajectory_replay/webarena_report_visual.py, web_search/visual.py
Frozen native route baseline src/harness/web_fetch/native_projection.py

Subprocess pipes. subprocess calls with text=True and no encoding still decode with the locale. That is about 240 calls, 49 of them in src/. The guard does not cover them, because a child process may really write in the locale encoding, so each call needs its own decision.

Proposal

  • Add encoding="utf-8" to each hash-bound file when its binding next changes for another reason, such as a new scorer revision or a new resource protocol, then remove its guard entry.
  • Decide the subprocess encoding per call, then extend the guard.

Related: #90, #84. Part of the refactor roadmap: #87

Activity

  1. added
    refactor
    on Nov 3, 2026
  2. lanyue-llk commented on Nov 4, 2026

    @lanyue-llk
    ContributorAuthor

    charts.py was fixed in #211. The remaining implicit calls are in hash-bound sources, and tests/test_explicit_utf8_io.py counts them, so the exemption cannot grow unseen. There is no demonstrated failure in the text=True calls. Closed during the issue cleanup after rechecking against main. Reopen if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions