Message5963
Logged In: YES
user_id=28658
I seem to be suffering from some unintentional consequences
of this fix. I do not think that the pickle should fail in
the follwing case. Wouldn't it be a better idea to just
check for a successful of the pickled class instead of
requiring the imported class to be stored at the same memory
location?
>>> import pickle, copy
>>> o = copy._EmptyClass()
>>> reload(copy)
<module 'copy' from '/usr/lib/python2.2/copy.pyc'>
>>> pickle.dumps(o, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/pickle.py", line 978, in dumps
Pickler(file, bin).dump(object)
File "/usr/lib/python2.2/pickle.py", line 115, in dump
self.save(object)
File "/usr/lib/python2.2/pickle.py", line 225, in save
f(self, object)
File "/usr/lib/python2.2/pickle.py", line 477, in save_inst
save(cls)
File "/usr/lib/python2.2/pickle.py", line 225, in save
f(self, object)
File "/usr/lib/python2.2/pickle.py", line 524, in save_global
raise PicklingError(
pickle.PicklingError: Can't pickle <class copy._EmptyClass
at 0x819493c>: it's not the same object as copy._EmptyClass
|
|
| Date |
User |
Action |
Args |
| 2007-08-23 13:55:46 | admin | link | issue451547 messages |
| 2007-08-23 13:55:46 | admin | create | |
|