Pickle problem while loading a class instance.

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Apr 9 18:13:27 EDT 2010


En Fri, 09 Apr 2010 18:42:23 -0300, gerardob <gberbeglia at gmail.com>  
escribió:

> I tried both things:
>
> 1- moved all the code to C:/Python26/lib/site-packages
> 2- Modified the PYTHONPATH in the windows registry.
>
> However, i stil have exactly the same error on the screen.
>
> Any other suggestions?

Did you follow the advice below?

> Peter Otten wrote:
>>
>>> file = open("prueba.txt", 'w')
>>
>> Remember to open the file in binary mode.

You have to re-create your pickle file, open it in binary mode 'wb'  
("prueba.txt" is not a good name - it's not a text file).
Any old pickle file created in text mode won't be readable.

-- 
Gabriel Genellina




More information about the Python-list mailing list