Pickle can't import class from __console__

Justin Sheehy dworkin at ccs.neu.edu
Wed Feb 9 10:54:29 EST 2000


"Warren Postma" <embed at geocities.com> writes:

> >>> zz = pickle.load(open('foo.pickle','r'))
> Traceback (innermost last):
>   File "<pyshell#38>", line 1, in ?
>     zz = pickle.load(open('foo.pickle','r'))
>   File "c:\Python\Lib\pickle.py", line 826, in load
>     return Unpickler(file).load()
>   File "c:\Python\Lib\pickle.py", line 495, in load
>     dispatch[key](self)
>   File "c:\Python\Lib\pickle.py", line 612, in load_inst
>     klass = self.find_class(module, name)
>   File "c:\Python\Lib\pickle.py", line 669, in find_class
>     raise SystemError, \
> SystemError: Failed to import class foo from module __console__

Did you read the pickle documentation, especially the part following
the sentence "There are some restrictions on the pickling of class
instances."?

The first few times I used pickle, I was bitten by some of those
restrictions.

-Justin

 




More information about the Python-list mailing list