a friend generates a pickle file for me. As he works on python 3 while I work on python 2, so he generated the file with
pickle.dump(some_file_to_be_pickled,open("path_to_that_file","wb+"),protocol=2)
While I tried to load it with
the_file = pickle.load(open("path_to_that_file","rb"))
However, I met the EOFError, which looks like:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/pickle.py", line 1378, in load
return Unpickler(file).load()
File "/usr/lib64/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib64/python2.7/pickle.py", line 880, in load_eof
raise EOFError
EOFError
My friend also tried to load this file on his computer with python 2 and he didn't have any problem doing that...
Any idea to fix this problem? By the way, I am using python 2.7.5 while he is using python 2.7.10 and python 3.5.