I’m trying to load an object (of a custom class Area) from a file using pickler. I’m using python 3.1.
The file was made with pickle.dump(area, f)
I get the following error, and I would like help trying to understand and fix it.
File "editIO.py", line 12, in load
area = pickle.load(f)
File "C:\Python31\lib\pickle.py", line 1356, in load
encoding=encoding, errors=errors).load()
UnicodeDecodeError: 'gbk' codec can't decode bytes in position 0-1: illegal multibyte sequence
It’s hard to say without you showing your code, but it looks like you opened the file in text mode with a “gbk” encoding. It should probably be opened in binary mode. If that doesn’t happen, make a small code example that fails, and paste it in here.