tags:

views:

19

answers:

1

My program work fine on windows, with cpickle, and I am using binary mode, like 'wb', or 'rb'. When I ran my program on Linux, it still works fine.

But when I tried to unpickle the files obtained from the Linux platform on my windows platform, I got this wired message says: cPickle.UnpicklingError: invalid load key' '.

Can anyone please tell me why?

It seems that I could not unpickle anyfile from the Linux platform.

BTW, the two programs that I run are identical.

Thanks a million.

A: 

Looking at the code (http://svn.python.org/view/python/trunk/Modules/cPickle.c?revision=81029&view=markup), it looks like it was a parsing error (load key is a pickle format key). It sounds like the file has been altered.

How were the files transferred from Linux to Windows? If it was FTP, did you transfer in binary mode?

(You are using HIGHEST_PROTOCOL right?)

Jeremy Brown
Thanks a lot! It's the transfer mode. Binary mode really solved the problem!!
beryl83