UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 79: illegal multibyte sequence

import execjs
with open('xx.js', 'r', encoding='gbk',errors='ignore') as f:
js_text = f.read()
ctx = execjs.compile(js_text)
text='dfsd'
result = ctx.call('xx_text', text)
print(result)
这样的,老是报错,encoding你改啥都不管事,gbk,utf-8,ascii,gbxxx....都没用,最后找到解决办法是https://blog.csdn.net/suwenlai/article/details/93047182

UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 79: illegal multibyte sequence_第1张图片
image.png

,当时的确是提示 subprocess.py处报的错,记得注释,以后好改回来[ 可以import subprocess文件改..]

你可能感兴趣的:(UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 79: illegal multibyte sequence)