Buckets:
| """Console helpers shared by harness scripts.""" | |
| from __future__ import annotations | |
| import sys | |
| def configure_utf8_output() -> None: | |
| """Prefer UTF-8 output when stdout/stderr are text streams. | |
| Windows consoles and captured subprocess pipes may default to GBK/cp936, | |
| which cannot encode symbols used in status messages. Reconfiguring keeps | |
| the scripts portable without requiring callers to set PYTHONUTF8. | |
| """ | |
| for stream_name in ("stdout", "stderr"): | |
| stream = getattr(sys, stream_name, None) | |
| if hasattr(stream, "reconfigure"): | |
| stream.reconfigure(encoding="utf-8", errors="replace") | |
Xet Storage Details
- Size:
- 638 Bytes
- Xet hash:
- f69265aff023e080085a9aa05c40a5c5ce762eed2c8d7b70f0da2ce29e67b525
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.