Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_pickle.UnpicklingError: pickle data was truncated

l'm using python3.6/ . l pickled my file using protocol=pickle.HIGHEST_PROTOCOL

when l load it as follow :

with open('data.sav', 'rb') as handle:
      data = pickle.load(handle)

l get the following error :

  File "<stdin>", line 2, in <module>
_pickle.UnpicklingError: pickle data was truncated

What is wrong ?

like image 441
Joseph Avatar asked Jan 29 '18 17:01

Joseph


1 Answers

It's been a while and maybe you have already found a solution.

In my case, the issue was due to the pickle file being corrupted. You could try to check the file's integrity with sha256sum, md5sum or something similar.

Hope it helps.

like image 132
ryuzakyl Avatar answered Nov 12 '22 00:11

ryuzakyl