成功解决UnicodeDecodeError: 'gbk' codec can't decode byte 0xba in position 2: illegal multibyte sequence

成功解决UnicodeDecodeError: 'gbk' codec can't decode byte 0xba in position 2: illegal multibyte sequence


解决问题

UnicodeDecodeError: 'gbk' codec can't decode byte 0xba in position 2: illegal multibyte sequence

解决思路

编码格式不对,改为utf-8格式打开

解决方法


open(class_file_name, 'r') 
改为
open(class_file_name, 'r', encoding='utf-8')

(0)

相关推荐