报错内容:
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa1 in position 26: illegal multibyte sequence
具体:
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\tools\Python3.6\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "D:\tools\Python3.6\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "D:\tools\Python3.6\lib\subprocess.py", line 1083, in _readerthread
buffer.append(fh.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 26: illegal multibyte sequence
Traceback (most recent call last):
File "D:/zjf_workspace/003、自己测试用的/002加密和验证码破解/02-js加密破解/022、梦幻西游藏宝阁/执行.py", line 11, in <module>
result = ct.call('decode_desc', _0x1c0cdf)
File "D:\tools\Python3.6\lib\site-packages\execjs\_abstract_runtime_context.py", line 37, in call
return self._call(name, *args)
File "D:\tools\Python3.6\lib\site-packages\execjs\_external_runtime.py", line 92, in _call
return self._eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args))
File "D:\tools\Python3.6\lib\site-packages\execjs\_external_runtime.py", line 78, in _eval
return self.exec_(code)
File "D:\tools\Python3.6\lib\site-packages\execjs\_abstract_runtime_context.py", line 18, in exec_
return self._exec_(source)
File "D:\tools\Python3.6\lib\site-packages\execjs\_external_runtime.py", line 87, in _exec_
output = self._exec_with_pipe(source)
File "D:\tools\Python3.6\lib\site-packages\execjs\_external_runtime.py", line 103, in _exec_with_pipe
stdoutdata, stderrdata = p.communicate(input=input)
File "D:\tools\Python3.6\lib\subprocess.py", line 863, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "D:\tools\Python3.6\lib\subprocess.py", line 1133, in _communicate
stdout = stdout[0]
IndexError: list index out of range
解决步骤
1、进去错误这个D:\tools\Python3.6\lib\subprocess.py文件
2、搜索:encoding=
这个搜索方式,是我找了好一会才懂,所以记录下来,大家可以参考下。
3、修改编码格式为utf-8
注意事项:
建议备份一行,毕竟修改的是模块的源码,万一弄错了好改回来。敲代码最忌不懂,乱改还不保留,这样很招人烦的,尤其团队合作时
至此修改完毕,可以尝试运行了