Skip to content

fix(hyperframes): decode CLI output as UTF-8 on Windows - #990

Open
BasBoosa1 wants to merge 1 commit into
OpenMontageInc:mainfrom
BasBoosa1:fix/hyperframes-utf8-output
Open

BasBoosa1 wants to merge 1 commit into
OpenMontageInc:mainfrom
BasBoosa1:fix/hyperframes-utf8-output

Conversation

@BasBoosa1

Copy link
Copy Markdown

Problem

HyperFramesCompose._run_hf calls subprocess.run(..., text=True) without an encoding, so Python decodes the CLI's output with the locale codepage. On Windows that is usually cp1252, or cp1255 and similar on non-English locales. HyperFrames prints UTF-8 (box-drawing characters, emoji, non-Latin text in lint messages), so decoding raises UnicodeDecodeError inside subprocess's reader thread and the CLI output is lost.

Fix

Pass encoding="utf-8", errors="replace" to that subprocess.run call. Behaviour on POSIX systems with a UTF-8 locale is unchanged.

Test

Added test_run_hf_decodes_cli_output_as_utf8 in tests/tools/test_hyperframes_compose.py. It checks that _run_hf passes the explicit encoding. The whole file passes locally on Windows 11 (51 passed).

🤖 Generated with Claude Code

text=True without an encoding decodes with the locale codepage (cp1252 on
most Windows machines). HyperFrames prints UTF-8, which raised
UnicodeDecodeError in subprocess's reader thread and lost the CLI output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BasBoosa1
BasBoosa1 requested a review from calesthio as a code owner November 29, 2026 10:00
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