django中,'gbk' codec can't decode byte 0xa6 in position 9737 illegal multibyte sequence问题

django中,‘gbk’ codec can’t decode byte 0xa6 in position 9737: illegal multibyte sequence问题

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kr4Ogw7o-1588921597285)(C:\Users\hq0749a\Desktop\问题图片集\微信图片_20200508110731.jpg)]
跳转到下方路径中
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-URRjDMqZ-1588921597299)(C:\Users\hq0749a\AppData\Roaming\Typora\typora-user-images\1588920590797.png)]

大概331行:
with Path(CURRENT_DIR, ‘templates’, ‘technical_500.html’).open() as fh
改成:
as fh
改成:
with Path(CURRENT_DIR, ‘templates’, ‘technical_500.html’).open(encoding=“utf-8”) as fh

猜你喜欢

转载自blog.csdn.net/weixin_45609519/article/details/105997625