[Zope] Re: Can't pickle objects in acquisition wrappers
Florent Guillaume
fg at nuxeo.com
Mon Dec 19 06:53:08 EST 2005
Keith Alperin wrote:
> I'm returning to Zope after about a year away and am working on a
> project that i have pieced together over about 4 years. I recently
> deployed this project (a family history web site) under a zope 2.7.x
> install (it used to run on a 2.4.x install) and now I can't seem to
> update any of my objects. when i try to save them, I get a TypeError:
> Can't pickle objects in acquisition wrappers. I was never more than a
> dabbler, so I can't really claim to fully grok what acquisition
> wrappers are, other than being a construct that allows me to refer to
> an object in a request without knowing exactly where it is (ie is it a
> request parameter, a member of my object etc). Googling for this
> message yields very little information and grepping the source code
> yields one nondescript (at least to me) line in _Acquisition.c . Does
> anyone understand what this error means? Does anyone have any ideas on
> how to tell what "acquisition wrapper" i'm saving? Is there a way for
> me to workaround this?
In your traceback you should have a call like p.dump(state).
Go edit this file it's in and replace it with code like:
try:
p.dump(state)
except TypeError, e:
raise TypeError(str(e)+': '+repr(state))
This will give you more info about what fails to be pickled.
Any part of the error where you see a full path (like <File 0x12345 at
/some/site/foo>) is with an acquisition wrapper. It shouldn't.
Or you can add a import pdb; pdb.set_trace() there if you know how to use PDB.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope
mailing list