首页 > TAG信息列表 > 9737

Django报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: ill.

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: ill.... Django2.2 安装后,使用runserver进行开发,出错时错误信息只显示于控制台命令行,而在前端页面只显示一行 “A server error occurred. Please contact the administrator.” 排错很不方便,仔细查看

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal mult

Django2.2 安装后,使用runserver进行开发,出错时错误信息只显示于控制台命令行,而在前端页面只显示一行 “A server error occurred. Please contact the administrator.” 排错很不方便,仔细查看控制台的错误信息,提示 UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa6 in

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=&q