背景:
使用pycharm进行程序调试时提示异常:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe5 in position 1023: unexpected end of data。
处理方案:
- 检查路径中是否存在中文,将中文修改为英文
- 修改报错的代码为
r = r.decode('utf-8','ignore')
,保存后重启pycharm
背景:
使用pycharm进行程序调试时提示异常:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe5 in position 1023: unexpected end of data。
处理方案:
r = r.decode('utf-8','ignore')
,保存后重启pycharm