fix: SSL certificate issue and Windows terminal encoding

This commit is contained in:
2026-07-05 01:17:13 +08:00
parent 8a646be06c
commit 30a1c1af57
2 changed files with 26 additions and 1 deletions
+5
View File
@@ -1,10 +1,15 @@
"""命令行工具入口."""
from pathlib import Path
import sys
import io
import typer
import uvicorn
# Windows 终端默认用 GBK, 无法输出 emoji, 强制 UTF-8
if sys.stdout.encoding != "utf-8":
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
# 确保 src 在路径中
sys.path.insert(0, str(Path(__file__).parent.parent))