django报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

针对django2.2报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

 

 解决办法:

找到"E:\python_practice_ku\django_ttsx\lib\site-packages\django\views\debug.py"文件,找到331行:

with Path(CURRENT_DIR, 'templates', 'technical_500.html').open() as fh:

将其改为:

with Path(CURRENT_DIR, 'templates', 'technical_500.html').open(encoding='utf-8') as fh:

 

posted on 2020-02-04 18:05  cherry_ning  阅读(349)  评论(0)    收藏  举报

导航