fix(scripts): force UTF-8 stdout in publish_update — stop false exit-1
Final Polish-char print crashed with UnicodeEncodeError on Windows cp1252 stdout AFTER a successful publish, making exit code 1 misleading. Reconfigure stdout/stderr to UTF-8 up front. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
ffb80c7b60
commit
576a424615
1 changed files with 9 additions and 0 deletions
|
|
@ -23,6 +23,15 @@ import os
|
|||
import subprocess
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
# Windows console domyślnie cp1252 → polskie znaki w finalnych printach rzucały
|
||||
# UnicodeEncodeError PO udanym publishu (exit 1 mylił "czy się udało"). Wymuś UTF-8.
|
||||
if hasattr(sys.stdout, "reconfigure"):
|
||||
try:
|
||||
sys.stdout.reconfigure(encoding="utf-8")
|
||||
sys.stderr.reconfigure(encoding="utf-8")
|
||||
except Exception:
|
||||
pass
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue