[Zope-CMF] InvokeFactory gives me Unpickleable error

Damon Eckhoff eckhoffd@missouri.edu
Tue, 25 Jun 2002 11:44:54 -0500


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:

<snip>
Traceback (innermost last):
  File /usr/local/zope/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line
150, in publish_module
  File /usr/local/zope/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line
114, in publish
  File /usr/local/zope/Zope-2.5.0/lib/python/Zope/__init__.py, line 158, in
zpublisher_exception_hook
    (Object: submissions)
  File /usr/local/zope/Zope-2.5.0/lib/python/ZPublisher/Publish.py, line
102, in publish
  File /usr/local/zope/Zope-2.5.0/lib/python/Zope/__init__.py, line 172, in
commit
  File /usr/local/zope/Zope-2.5.0/lib/python/ZODB/Transaction.py, line 233,
in commit
  File /usr/local/zope/Zope-2.5.0/lib/python/ZODB/Connection.py, line 345,
in commit
    (Info: (('Products.CMFPublication.SubmissionCMF', 'SubmissionCMF'),
'\x00\x00\x00\x00\x00\x00B\xe8', ''))
UnpickleableError: Cannot pickle &lt;type 'StringO'&gt; objects
</snip>

I can call invokeFactory successfully if I omit the file argument, and the
file pickle error only seems to happen when I call invokeFactory, ie. I can
store files in my objects using set/getter methods with no trouble.

I appreciate any and all help,

Damon.