All pastes #104032 Raw Edit

Untitled

public text v1 · immutable
#104032 ·published 2006-07-28 16:08 UTC
rendered paste body
breed@maluca:~/jython/Release_2_1/jython$ python
Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> def foo():
...     print 'hi'
...
>>> foo()
hi
>>> pickle.dump(foo, open("f", "w"))
>>>
KeyboardInterrupt
>>> quit
'Use Ctrl-D (i.e. EOF) to exit.'
>>> exit
'Use Ctrl-D (i.e. EOF) to exit.'
>>>
breed@maluca:~/jython/Release_2_1/jython$ python
Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> foo=pickle.load(open("f"))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/pickle.py", line 1390, in load
    return Unpickler(file).load()
  File "/usr/lib/python2.4/pickle.py", line 872, in load
    dispatch[key](self)
  File "/usr/lib/python2.4/pickle.py", line 1104, in load_global
    klass = self.find_class(module, name)
  File "/usr/lib/python2.4/pickle.py", line 1140, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'foo'
>>> pickle.load(open("f"))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/pickle.py", line 1390, in load
    return Unpickler(file).load()
  File "/usr/lib/python2.4/pickle.py", line 872, in load
    dispatch[key](self)
  File "/usr/lib/python2.4/pickle.py", line 1104, in load_global
    klass = self.find_class(module, name)
  File "/usr/lib/python2.4/pickle.py", line 1140, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'foo'