1、报错:

  File "D:\Python\Python37-32\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

2、解决:

  打开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

就成功了。

 

针对django2.2报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: ill....的更多相关文章

  1. 【python】python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte sequence

    python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte ...

  2. python读取txt文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x8e in position 8: illegal multibyte sequence

    python读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x8e in position 8: illegal multibyte ...

  3. 安装mysql-python报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal not in range(128)

    安装mysql-python报错: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal n ...

  4. python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib

    python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multib ...

  5. django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: ordinal not in range(128)

    django startproject xxx:报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: o ...

  6. python 网络爬虫报错“UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position”解决方案

    Python3.x爬虫, 发现报错“UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1:invalid sta ...

  7. python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence

    python读取文件时提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal m ...

  8. saltstack--关于报错“UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 6: ordinal not in range(128)”

    [root@linux-node1 桌面]# salt-key [ERROR ] 'ascii' codec can't decode byte 0xe6 in position 6: ordinal ...

  9. python3运行调用htmltestrunner时,报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0

    之前解决过一次,又忘了,这次写下来了..百度没有的,跟我环境有关! 环境:自动化运行环境python3.6.5 上期说到了,写了一个bat来运行runallcase.py. 但是双击运行却报错:Uni ...

随机推荐

  1. 关注的Elasticsearch大牛博客

    1.http://wangnan.tech/ 2.https://elasticsearch.cn/people/wood 3.https://www.jianshu.com/u/244399b1d7 ...

  2. maven(二):创建一个可用的maven项目,完整过程

    环境:eclipse4.5 (内置maven插件) 创建maven项目 文件菜单--新建--其他-- maven project 下一步 选择web 结构 group id:  指项目在maven本地 ...

  3. C++中cin.clear()的用法

    我们谈谈cin.clear的作用,第一次看到这东西,很多人以为就是清空cin里面的数据流,而实际上却与此相差很远,首先我们看看以下代码: #include <iostream>  usin ...

  4. PL/SQL 删除主键 ORA-02443: 无法删除约束条件-不存在的约束条件

    在PL/SQL developer中删除一个表的主键,然后把另外一个字段设置成主键,删除的过程中报错:ORA-02443 我遇到这个问题出现的背景是: alter table saleqtya dro ...

  5. Qt实现同步(阻塞式)http get等网络访问操作

    Qt的网络操作类是异步(非阻塞的),但有时想做一些阻塞的事情就不方便了,可用如下几行代码轻松实现: QByteArray MyNetworkAccess::get(const QString & ...

  6. January 08th, 2018 Week 02nd Monday

    To be yourself in a world that is constantly trying to make you something else is the greatest accom ...

  7. 关于前缀和,A - Hamming Distance Sum

    前缀和思想 Genos needs your help. He was asked to solve the following programming problem by Saitama: The ...

  8. exit status 3221225477 npm run dev 报错

    Fatal error in , line 0 # Check failed: U_SUCCESS(status). # # # #FailureMessage Object: 000000B5882 ...

  9. Difference Between InnoDb and MyISAM(个人觉着是好文章,简单易懂,推荐看)

    原文地址:http://acmeextension.com/difference-between-innodb-and-myisam/ MyISAM and InnoDB are the most c ...

  10. nginx跟apache访问方法

    ifconfig 在浏览器中输入ip即可访问 centos安装nginx环境 1:进入 cd /usr/local/src  //下载文件放到这个目录中 2:wget http://nginx.org ...