Skip to content

Studio: decode the Rosetta sysctl probe as UTF-8 - #14419

Merged
danielhanchen merged 1 commit into
mainfrom
fix/rosetta-sysctl-encoding
Oct 21, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/rosetta-sysctl-encoding

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

studio/backend/tests/test_text_io_encoding.py::test_text_io_names_its_encoding fails on main, so the (Python 3.13, rest) backend shard is red on every PR built on top of #14374 (for example #14391):

AssertionError: Text I/O without an explicit encoding falls back to locale.getencoding(), ...
  hardware.py:165: subprocess(text = True) without encoding

#14374 added _running_under_rosetta(), which runs sysctl -n hw.optional.arm64 with text = True and no encoding. The guard is right. Every other subprocess call in hardware.py names its encoding, and a bare text = True decodes with the locale codec (ASCII under a C or POSIX locale).

Fix

Pass encoding = "utf-8", errors = "replace", as the other probes in this file do. The probe only reads 0 or 1, so behaviour is unchanged.

Verification

  • studio/backend/tests/test_text_io_encoding.py: fails on main (the line above); with this change, 857 passed.
  • test_chat_only_reason.py, test_export_capability.py and test_video_capability.py, which exercise the Rosetta check: 64 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T00:27:59.102183Z 9279ab1 Manual request
🔒 Security Review 🔄 Running since 2026-10-21T00:26:40.144366Z 9279ab1 PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 9279ab1930

ℹ️ 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 ba37af2 into main Oct 21, 2026
@danielhanchen
danielhanchen deleted the fix/rosetta-sysctl-encoding branch October 21, 2026 00: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