Skip to content

Read the NPU compat fixtures as UTF-8 - #18308

Merged
danielhanchen merged 1 commit into
mainfrom
ci/npu-compat-fixture-utf8
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/npu-compat-fixture-utf8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Read the NPU compat fixtures as UTF-8

tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding fails on main since #18050. It shows up on unrelated PRs as Repo tests (CPU, rest-2), for example #18104 and #17627:

E   AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding ...
E     Left contains one more item: 'studio/backend/tests/test_npu_compat.py:18: read_text()'

Cause

#18050 added two reads of the checked-in fixture fixtures/npu_compat/hf_configs.json that call .read_text() with no encoding:

  • studio/backend/tests/test_npu_compat.py:18
  • studio/backend/tests/test_export_npu_q4nx.py:677

Without an encoding, Python decodes with the platform default, which is the ANSI codepage on Windows. The lint fails that as soon as a fixture gains a non-ASCII byte.

Fix

Both reads now pass encoding = "utf-8". The fixture is JSON, so it is UTF-8 by definition. Nothing else changes.

The other bare .read_text() in test_npu_compat.py, at line 88, reads a file the test itself wrote into tmp_path. The lint deliberately leaves those alone, so it is unchanged.

Verification

  • tests/test_source_read_encoding.py: fails on main on both lines and passes with this change (16 passed).
  • tests/test_npu_compat.py and tests/test_export_npu_q4nx.py: 96 passed.
  • ruff is clean.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T11:20:49.266460Z b6cdb50 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. Breezy!

Reviewed commit: b6cdb50125

ℹ️ 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 eed2b9d into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/npu-compat-fixture-utf8 branch November 18, 2026 11:40
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