[Zope-CMF] InvokeFactory gives me Unpickleable error

Dieter Maurer dieter@handshake.de
Wed, 26 Jun 2002 21:45:07 +0200


Damon Eckhoff writes:
 > I have a form that uploads a file.  The action of the form is a script that
 > calls invokeFactory on the context portal folder to create the new instance.
 > I'm using CerealFactory 1.1.1 to auto-generate id's.
 > 
 > <snip>
 > # Create a dummy id, CerealFactory Handles this automatically
 > id = 'dummy'
 > 
 > # What type of object do we wish to create
 > type_name = 'SubmissionCMF-AutoID'
 > 
 > # Get the title
 > title = request['submission_title']
 > 
 > # Get the file object
 > file = request['file']
 > 
 > # Invoke the factory on the folder
 > context.invokeFactory( type_name=type_name, id=id, title=title, file=file )
 > </snip>
 > 
 > When I call this (using a pdf file in this case)... I get an
 > UnpickleableError:
 > ...
 > in commit
 >     (Info: (('Products.CMFPublication.SubmissionCMF', 'SubmissionCMF'),
 > '\x00\x00\x00\x00\x00\x00B\xe8', ''))
 > UnpickleableError: Cannot pickle &lt;type 'StringO'&gt; objects
 > </snip>
Your "SubmissionCMF" constructor puts an unpicklable attribute
(apparently of type "String0", although, I do not know what this is)
in a persistent object. Have a look at its source. Maybe, you
see something strange.


Dieter