Skip to content

Tests: read llama.py as UTF-8 in the vocab-parallel gloo test - #18743

Merged
danielhanchen merged 1 commit into
mainfrom
fix/tp-vocab-gloo-encoding
Nov 21, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/tp-vocab-gloo-encoding

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Repo tests (CPU, rest-2) fails on main since #18625 and on every PR based on it (for example #17742, #18032, #18610, #18740):

test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[3]
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_tp_vocab_parallel_gloo.py:307: open()'

Cause

#18625 added a source check to tests/test_tp_vocab_parallel_gloo.py that reads unsloth/models/llama.py with a bare open(...). On Windows that uses the locale code page, so it would raise UnicodeDecodeError once llama.py carries a non-ASCII byte. The guard is right; the new read is missing its encoding.

Fix

Pass encoding = "utf-8" to that open(). One line, test-only.

Verification

  • On main: tests/test_source_read_encoding.py -k checked_in_file_reads fails ([3], naming this line).
  • With this change: 16 passed, and tests/test_tp_vocab_parallel_gloo.py passes (11 passed).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-21T08:36:13.748580Z 8886695 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. Swish!

Reviewed commit: 8886695b2c

ℹ️ 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 c9670d8 into main Nov 21, 2026
@danielhanchen
danielhanchen deleted the fix/tp-vocab-gloo-encoding branch November 21, 2026 08:36
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