harden execute_js_rich + fix GBK encoding crash on pyw

This commit is contained in:
Liang Jiaqing
2026-02-13 15:54:52 +08:00
parent 8d3582e3b7
commit 4163341bb3
3 changed files with 26 additions and 19 deletions

View File

@@ -1,7 +1,8 @@
import os, sys, threading, queue
import time, json, re
import os, sys, threading, queue, time, json, re
if sys.stdout is None: sys.stdout = open(os.devnull, "w")
elif hasattr(sys.stdout, 'reconfigure'): sys.stdout.reconfigure(errors='replace')
if sys.stderr is None: sys.stderr = open(os.devnull, "w")
elif hasattr(sys.stderr, 'reconfigure'): sys.stderr.reconfigure(errors='replace')
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from sidercall import SiderLLMSession, LLMSession, ToolClient, ClaudeSession