I've tried to read and load pickle files in Python3.
import pickle as pickle
pickleFileName = 'data/fingerDataSet' + '.pickle'
pickleFile = open(pickleFileName, 'rb')
data = pickle.load(pickleFile)
pickleFile.close()
but in line data = pickle.load(pickleFile) I'm getting strange error UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 5: ordinal not in range(128)
1 Answer 1
Pickle is not intended to work across different Python versions. What is likely in this case is that the original data was in a Python 2 str, which contains bytes, and the Python3 version is trying to read it as text, performing an implicit decode.
What you should do there is to unpickle your data in a Python 2 environment, and save it in a way that is not dependente on the Python version (if it is an image, use the PIL library to write a PNG file, for example)
0xc0is the letter À. So the problem should be in the file