UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6: ordinal not in range(128)
程序员文章站
2022-06-14 15:22:13
...
python2 的pickle对象 用python3 进行load 出现问题
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x8b in position 6: ordinal not in range(128)
pickle.load()默认解码是以encoding=”ASCII”解码的,而我们要载入的文件并不是以”ASCII”形式存储的,所以要改变参数encoding=” ”
pickle.load(f,encoding='bytes')
上一篇: 编码问题:UnicodeEncodeError: 'gbk' codec can't encode character u'\xa0' in position 148:
下一篇: 全国程序员高考卷,开始答题!
推荐阅读
-
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xcb in position 260: ordinal not in range(128)
-
Python2.7更新pip:UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position 7: ordinal not in range(128)
-
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 0: invalid continuation byte
-
【python】pip安装报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 7: ordinal not i
-
NLP-UnicodeDecodeError: 'utf8' codec can't decode byte 0xe6 in position 0: invalid continuation byte
-
[解决]SyntaxError: ‘ascii‘ codec can‘t decode byte 0xe6 in position 4: ordinal not in range (128)
-
python爬虫-UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
-
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6: ordinal not in range(128)
-
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xcb in position 260: ordinal not in range(128)
-
python3 报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position...[报错篇]