From 5f2511c7d4ee10f7c648c1c99e623fdd2a5f065c Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 7 May 2026 10:07:22 +0000 Subject: [PATCH] CI(windows): force UTF-8 stdio so hf download / Studio CLI don't crash on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows defaults to cp1252 ("charmap"); the hf-hub CLI prints a success checkmark "✓" (U+2713) and the bare hf download in the "Prime HF_HOME" step dies with: Error: Invalid value. 'charmap' codec can't encode character '✓' in position 5: character maps to Set PYTHONIOENCODING=utf-8 and PYTHONUTF8=1 at the job level for all four Windows Studio workflows. Same env vars work on Linux/Mac as no-ops, so we don't need OS-conditional handling. --- .github/workflows/studio-windows-api-smoke.yml | 4 ++++ .../workflows/studio-windows-inference-smoke.yml | 15 +++++++++++++++ .github/workflows/studio-windows-ui-smoke.yml | 6 ++++++ .github/workflows/studio-windows-update-smoke.yml | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml index 32e901c083..4ed1f93274 100644 --- a/.github/workflows/studio-windows-api-smoke.yml +++ b/.github/workflows/studio-windows-api-smoke.yml @@ -46,6 +46,10 @@ jobs: GGUF_FILE: gemma-3-270m-it-UD-Q4_K_XL.gguf STUDIO_PORT: '18895' HF_HOME: ${{ github.workspace }}/hf-cache + # Force UTF-8 for stdio (Windows defaults to cp1252; hf + # download prints a "✓" checkmark and crashes otherwise). + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml index 839411c68a..e50dcfe6a9 100644 --- a/.github/workflows/studio-windows-inference-smoke.yml +++ b/.github/workflows/studio-windows-inference-smoke.yml @@ -55,6 +55,11 @@ jobs: GGUF_FILE: gemma-3-270m-it-UD-Q4_K_XL.gguf STUDIO_PORT: '18888' HF_HOME: ${{ github.workspace }}/hf-cache + # Force UTF-8 for stdio (Windows defaults to cp1252; hf + # download / Studio CLI print "✓" checkmarks and crash + # otherwise). + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 @@ -271,6 +276,11 @@ jobs: GGUF_FILE: Qwen3.5-2B-UD-Q4_K_XL.gguf STUDIO_PORT: '18898' HF_HOME: ${{ github.workspace }}/hf-cache + # Force UTF-8 for stdio (Windows defaults to cp1252; hf + # download / Studio CLI print "✓" checkmarks and crash + # otherwise). + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 @@ -576,6 +586,11 @@ jobs: MMPROJ_FILE: mmproj-F16.gguf STUDIO_PORT: '18899' HF_HOME: ${{ github.workspace }}/hf-cache + # Force UTF-8 for stdio (Windows defaults to cp1252; hf + # download / Studio CLI print "✓" checkmarks and crash + # otherwise). + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml index a48222bac5..f2a497ef7e 100644 --- a/.github/workflows/studio-windows-ui-smoke.yml +++ b/.github/workflows/studio-windows-ui-smoke.yml @@ -49,6 +49,12 @@ jobs: GGUF_FILE: gemma-3-270m-it-UD-Q4_K_XL.gguf STUDIO_PORT: '18896' HF_HOME: ${{ github.workspace }}/hf-cache + # Force UTF-8 for stdio so Python tools (hf download, Studio + # CLI, etc.) can print Unicode characters like the success + # checkmark "✓". Windows defaults to cp1252 / charmap and + # any tool that prints "OK ✓" hits a UnicodeEncodeError. + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 diff --git a/.github/workflows/studio-windows-update-smoke.yml b/.github/workflows/studio-windows-update-smoke.yml index 408eecf8c5..991b64aeec 100644 --- a/.github/workflows/studio-windows-update-smoke.yml +++ b/.github/workflows/studio-windows-update-smoke.yml @@ -50,6 +50,12 @@ jobs: defaults: run: shell: bash + env: + # Force UTF-8 for stdio (Windows defaults to cp1252; hf + # download / Studio CLI print "✓" checkmarks and crash + # otherwise). + PYTHONIOENCODING: utf-8 + PYTHONUTF8: '1' steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1