Skip to content

Tests: read _gpu_init.py as UTF-8 in the torchao-too-new test - #15957

Merged
danielhanchen merged 1 commit into
mainfrom
tests-torchao-read-utf8
Oct 29, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-torchao-read-utf8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, rest) is red on main since #15850:

tests/test_source_read_encoding.py
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 character
  'tests/test_torchao_too_new_for_torch.py:139: read_text()'

#15850 added test_it_runs_after_the_torchao_shims_and_before_unsloth_zoo, which reads unsloth/_gpu_init.py with read_text(). The guard is right: on Windows that read uses the locale codec (cp1252) and breaks once the file gains a non-ASCII character. The fix is the test's, not the guard's.

What changed

GPU_INIT.read_text(encoding = "utf-8").

Verification

  • Base (main at 0edfda6e1e): tests/test_source_read_encoding.py 1 failed, 15 passed.
  • Head: tests/test_source_read_encoding.py and tests/test_torchao_too_new_for_torch.py 32 passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T12:31:09.098278Z 19c960e 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. You're on a roll.

Reviewed commit: 19c960e331

ℹ️ 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 49582cd into main Oct 29, 2026
0 of 16 checks passed
@danielhanchen
danielhanchen deleted the tests-torchao-read-utf8 branch October 29, 2026 12:32
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