From 69a3ebf71b8a449ea5327c262aff717995021167 Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Fri, 14 Aug 2026 00:27:13 +0300 Subject: [PATCH] Fix UnicodeDecodeError when decoding GBK output Handle invalid multibyte sequences by adding an error handler to the decode call, preventing crashes on non-GBK compatible bytes. --- autocshell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autocshell.py b/autocshell.py index 80e56b1..722a9a6 100644 --- a/autocshell.py +++ b/autocshell.py @@ -151,7 +151,7 @@ def Checkdisk(path): # send data stdoutput = stdoutput+"\n"+os.getcwd()+">" - stdoutput = stdoutput.decode('gbk').encode('utf-8') + stdoutput = stdoutput.decode('gbk', 'ignore').encode('utf-8') Send(s, stdoutput) # loop ends here