Skip to content

fix(scripts): add explicit utf-8 encodings - #37111

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/fix-plw1514-encoding-scripts
Closed

fix(scripts): add explicit utf-8 encodings#37111
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/fix-plw1514-encoding-scripts

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • add explicit encoding="utf-8" to text reads/writes in scripts/lint_diff.py
  • add explicit encoding="utf-8" to the compare path in scripts/profile-tui.py
  • add explicit encoding="utf-8" to duration cache reads/writes in scripts/run_tests_parallel.py

Verification

  • ruff check --select PLW1514 scripts/lint_diff.py scripts/profile-tui.py scripts/run_tests_parallel.py
  • python -m py_compile scripts/lint_diff.py scripts/profile-tui.py scripts/run_tests_parallel.py
  • git diff --check

Fixes #36649

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Appears to be a duplicate of #36828, which makes the same utf-8 encoding fix to the same script files (lint_diff.py, profile-tui.py, run_tests_parallel.py) for the same issue #36649. Flagging for dedup.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused cross-platform fix. Current main still contains the five bare text-I/O sites this PR changes: scripts/lint_diff.py:33,200, scripts/profile-tui.py:519, and scripts/run_tests_parallel.py:482,504. The proposed encoding="utf-8" arguments directly satisfy the active PLW1514 policy in pyproject.toml:375-386.

GitHub currently reports the branch as conflict-dirty, but the current target statements remain present, so salvaging this is a mechanical reapplication of the same five substitutions onto HEAD.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 13, 2026
@teknium1

teknium1 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closing — the sites this PR touched are already explicit-encoding on current main (PLW1514 ruff gate, enabled and enforced in lint CI). The class can't regress. Thanks for the sweep work.

@teknium1 teknium1 closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruff PLW1514 will fail on text file reads and writes without encoding

3 participants