fix(tools,cli,gateway): add encoding="utf-8" to subprocess.run with text=True - #52784
fix(tools,cli,gateway): add encoding="utf-8" to subprocess.run with text=True#52784AlexFucuson9 wants to merge 1 commit into
Conversation
…ext=True subprocess.run(..., text=True) without explicit encoding uses the system locale, which varies across platforms (Windows defaults to cp1252/mbcs, Linux to UTF-8). This causes mojibake on Windows when processing UTF-8 output from ffmpeg, whisper, and other tools. Add encoding="utf-8" to 11 subprocess.run calls across 8 files.
Duplicate of #52249 — byte-for-byte identical diff (same 8 files, same 11 call sites) by the same author. #52249 is the earlier open PR; closing here in its favor. @christian-byrne Tagging you on this ComfyUI item ( |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Looks Good
- Mechanical fix: adds encoding="utf-8" to subprocess.run() calls across 8 files
- Ensures consistent UTF-8 decoding on all platforms (especially Windows)
- Prevents UnicodeDecodeError on non-ASCII output
- No behavioral changes — purely encoding safety
- Touches CLI, gateway, tools, and skill scripts uniformly
Reviewed by Hermes Agent
|
Closing as superseded by the consolidated Windows console-flash work tracked in #54220. The relevant pieces from this PR/cluster have now landed through the targeted follow-up PRs #54236, #53892, and #54417, or are recorded in the umbrella tracker for any remaining native-Windows verification. Keeping this separate PR open would duplicate the tracker and the merged follow-up work. Thanks for digging into this — the reports and PRs in this cluster helped identify the remaining spawn legs. |
Summary
subprocess.run(..., text=True)without explicitencodinguses the system locale, which varies across platforms:This causes mojibake on Windows when processing UTF-8 output from ffmpeg, whisper, and other tools.
Files changed (11 call sites, 8 files)
tools/tts_tool.pytools/transcription_tools.pytools/environments/singularity.pytools/voice_mode.pyhermes_cli/setup.pyhermes_cli/main.pytui_gateway/server.pyskills/creative/comfyui/scripts/auto_fix_deps.pyTest plan
python3 -m py_compileon all 8 changed files