为什么打开.pkl文件显示此unicode错误?

时间:2019-04-29 12:53:54

标签: python python-3.x pickle python-unicode

我正在尝试打开此.pkl文件。我不断收到此错误

UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 772: character maps to <undefined>

这是我的代码:

import pickle

with open(r"C:\Users\ADMIN\Desktop\Abhishek\STATS Data\test_data_1.pkl ", 'r') as f:
    data = pickle.load(f)
print(data)


尝试将编码指定为encoding = "utf-8"会引发这种情况:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

怎么了?

0 个答案:

没有答案