Skip to content

Run report test: read _cpu_init.py as utf-8 (source read encoding guard red on main) - #18850

Merged
danielhanchen merged 1 commit into
mainfrom
fix/run-report-test-utf8
Nov 22, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/run-report-test-utf8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, rest-2) is red on main since #18807:

tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[0]
AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding,
so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8":
['tests/test_run_report.py:307: read_text()']

#18807 added test_cpu_memory_report_wired_on_cpu_route, which reads unsloth/_cpu_init.py with a bare read_text(). The guard is right: on Windows that decodes with the locale code page, so the test breaks as soon as the file gains a non-ASCII character.

Fix

read_text(encoding = "utf-8").

Testing

  • tests/test_source_read_encoding.py: fails on main with the site above, passes with this change.
  • tests/test_run_report.py::test_cpu_memory_report_wired_on_cpu_route: passes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T06:20:26.089321Z 903461c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 903461c021

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 0b67682 into main Nov 22, 2026
@danielhanchen
danielhanchen deleted the fix/run-report-test-utf8 branch November 22, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant