错误:Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.
Failed calling sys.interactivehook
Traceback (most recent call last):
File “F:\Anaconda3\lib\site.py”, line 439, in register_readline
readline.read_history_file(history)
File “F:\Anaconda3\lib\site-packages\pyreadline\rlmain.py”, line 165, in read_history_file
self.mode._history.read_history_file(filename)
File “F:\Anaconda3\lib\site-packages\pyreadline\lineeditor\history.py”, line 82, in read_history_file
for line in open(filename, ‘r’):
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xaf in position 173: illegal multibyte sequence
解决方法:D:\Anaconda3\Lib\site-packages\pyreadline\lineeditor\history.py 第82行:
将:for line in open(filename, ‘r’)
改为:for line in open(filename, ‘rb’)
改后保存即可
相关文章
- 09-26python3 UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 30: illegal multibyte sequence
- 09-26python3 UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f9e0' in position 230: illegal multibyte sequence
- 09-26解决错误UnicodeDecodeError: 'gb2312' codec can't decode byte 0x8b in position 1: illegal
- 09-26UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 357: illegal multi
- 09-26UnicodeDecodeError gbk codec can't decode byte in position illegal multibyte sequence
- 09-26UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 190: illegal multi
- 09-26解决UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xad in position 129: illegal multibyte sequence
- 09-26UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 34: illegal multibyte sequence
- 09-26UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa7 in position 213: illegal multibyte sequence
- 09-26Django报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: ill.