1 parent dddad46 commit ec0d490Copy full SHA for ec0d490
2 files changed
.github/workflows/release-check.yml
@@ -8,6 +8,9 @@ on:
8
jobs:
9
source-check:
10
runs-on: windows-latest
11
+ env:
12
+ PYTHONUTF8: "1"
13
+ PYTHONIOENCODING: "utf-8"
14
steps:
15
- name: Check out repository
16
uses: actions/checkout@v4
tools/release_check.py
@@ -12,6 +12,20 @@
import sys
from pathlib import Path
+
+def _configure_utf8_stdio() -> None:
17
+ for stream_name in ("stdout", "stderr"):
18
+ stream = getattr(sys, stream_name, None)
19
+ if stream is None or not hasattr(stream, "reconfigure"):
20
+ continue
21
+ try:
22
+ stream.reconfigure(encoding="utf-8", errors="replace")
23
+ except Exception:
24
+ pass
25
26
27
+_configure_utf8_stdio()
28
29
ROOT = Path(__file__).resolve().parents[1]
30
if str(ROOT) not in sys.path:
31
sys.path.insert(0, str(ROOT))
0 commit comments