其他分享
首页 > 其他分享> > Django2.2:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: il

Django2.2:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: il

作者:互联网

报错截图:

 

 解决方案:

打开django/views下的debug.py文件,转到line331行:

   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

就成功了。

参考链接:

https://www.cnblogs.com/loveprogramme/p/10726712.html

标签:templates,Django2.2,9737,html,500,Path,position,open,DIR
来源: https://www.cnblogs.com/leoych/p/14119806.html