UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1023: unexpected end of data

发布时间 2023-07-21 11:54:25作者: emanlee

 

Connected to pydev debugger (build 213.6461.77)
Traceback (most recent call last):
  File "PyCharm Community Edition 2021.3.1\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 303, in _on_run
    r = r.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1023: unexpected end of data

 

 

解决方案:

1、检查一下项目路径中是否含有中文路径,如果有,那就把中文部分的路径修改为英文。

2、找到报错的那一行代码,r = r.decode('utf-8'),然后将这行代码改成 r = r.decode('utf-8','ignore'),保存代码,重启pycharm。


 

https://zhuanlan.zhihu.com/p/183911230