durusmail: durus-users: Pickling/exporting objects
Pickling/exporting objects
2005-03-02
2005-03-02
2005-03-02
2005-03-02
2005-03-02
2005-03-02
2005-03-02
2005-03-03
2005-03-03
2005-03-03
2005-03-03
2005-03-03
2005-03-04
2005-03-04
2005-03-04
2005-03-04
2005-03-04
2005-03-04
2005-03-05
Pickling/exporting objects
A.M. Kuchling
2005-03-03
On Thu, Mar 03, 2005 at 02:55:42PM -0500, Neil Schemenauer wrote:
> I can think of no reason why it can't work.  I'm pretty sure it
> works with ZODB.  Do you get an error when you try it?

Yes, I get an error.  Test program:

import pickle
from durus.persistent import Persistent

class C (Persistent):
    pass

c = C()
s = pickle.dumps(c)

Traceback:

amk@telestra:~/src/Tools/mbv-loader$ python t5.py
Traceback (most recent call last):
  File "t5.py", line 9, in ?
    s = pickle.dumps(c)
  File "/usr/lib/python2.3/pickle.py", line 1386, in dumps
    Pickler(file, protocol, bin).dump(obj)
  File "/usr/lib/python2.3/pickle.py", line 231, in dump
    self.save(obj)
  File "/usr/lib/python2.3/pickle.py", line 338, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python2.3/pickle.py", line 415, in save_reduce
    save(args)
  File "/usr/lib/python2.3/pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.3/pickle.py", line 576, in save_tuple
    save(element)
  File "/usr/lib/python2.3/pickle.py", line 313, in save
    rv = reduce(self.proto)
  File "/usr/lib/python2.3/copy_reg.py", line 69, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle PersistentBase objects
amk@telestra:~/src/Tools/mbv-loader$

--amk

reply