UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 9737: illegal multibyte sequence

如下报错

  File "E:\virtual\supermarket\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "E:\virtual\supermarket\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

During handling of the above exception, another exception occurred:

编码问题, 解决方式:

找到django\views\debug.py"文件,中 get_traceback_html与get_traceback_text函数, 进行编码, 如下图:
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 9737: illegal multibyte sequence_第1张图片

你可能感兴趣的:(python,django)