fix: code_run encoding compat; wechat truncate long code blocks & limit msg count

This commit is contained in:
Liang Jiaqing
2026-03-29 17:43:06 +08:00
parent 52151853b3
commit 08ac18be6e
2 changed files with 16 additions and 2 deletions

View File

@@ -8,6 +8,9 @@ def _d(b):
except: return b.decode('gbk', 'replace')
def _run(*a, **k):
t = k.pop('text', 0) | k.pop('universal_newlines', 0)
enc = k.pop('encoding', None)
k.pop('errors', None)
if enc: t = 1
if t and isinstance(k.get('input'), str):
k['input'] = k['input'].encode()
r = _r(*a, **k)