[Zope-dev] unpickleable error
Toby Dickenson
tdickenson@geminidataloggers.com
Wed, 08 Mar 2000 13:07:42 +0000
On Tue, 07 Mar 2000 02:53:45 -0800, Michel Pelletier
>> want the file converted). All my dtml method does is change data in a few
>> already-defined properties. I've commented out my dtml statements and put
>> them back in one at a time, to see if I can isolate the one which is causing
>> the error. Here it is:
>>
>> <dtml-call "manage_changeProperties(upload_file=REQUEST['new_file'],)">
>>
>> "new_file" is the name of an input field of type "file" in the form the
>> dtml method containing the line above was called from. If i replace the
>> line above with the following:
>>
>> <dtml-call "manage_changeProperties(upload_file='This is a test',)">
>>
>> things work fine.
>
>what gets assigned to 'upload_file' is probably not pickleable. What
>that is I don't know, you will have to find out what kind of object is
>getting assigned or is trying to store itself as a property. This is
>just a guess, there is not enough information to pin it down exactly.
Ive run into this several times, and you've prompted me to look into
why.
I think manage_changeProperties and manage_editProperties should be
using self._updateProperty rather than self._setPropValue.
self._updateProperty performs type checking on the property values. In
this case you property would probably get the value
<file object at 0x12345678>
or something similar, which gives a good hint about what you did
wrong.
(Note, all of that is untested. YMMB0)
Ill add this to the collector.
Toby Dickenson
tdickenson@geminidataloggers.com