I posted the whole problem to the list earlier but had no takers. So I'm trying to break it down and figure it out that way. Does anyone know what causes unpickleable errors? I've got a dtml-method which gets called from another dtml-method/form where a user enter's data. (namely a file to upload, and a check box indicating whether or not they 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. However, as it is, I get an Unpickleable Error (see traceback below). I'm not sure what difference it makes, but the file I'm supposedly uploading is a MSWord Document. Does anyone have ideas? Thanks! -Andy Error Type: UnpickleableError Error Value: Cannot pickle objects ---------- Traceback (innermost last): File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: asdf) File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 169, in publish File /usr/local/Zope/lib/python/ZODB/Transaction.py, line 237, in commit File /usr/local/Zope/lib/python/ZODB/Connection.py, line 325, in commit (Info: (('*sznqgGH9XT1HaHOlGQ5Zsg==', 'SmartDTML'), '\000\000\000\000\000\000\002h', '')) UnpickleableError: (see above) IMPORTANT NOTICE: If you are not using HushMail, this message could have been read easily by the many people who have access to your open personal email messages. Get your FREE, totally secure email address at http://www.hushmail.com.
auto44082@hushmail.com wrote:
I posted the whole problem to the list earlier but had no takers. So I'm trying to break it down and figure it out that way.
Does anyone know what causes unpickleable errors?
Trying to pickle (serialize into a storable format) an unplickable object, such as a fuction.
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. -Michel
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
Toby Dickenson wrote:
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>
Ah, you are correct! Python file objects are not pickleable (for everyone's sake, this is not the same kind of file objects as Zope File Objects, but rather the python kind). For the sake of correctness, the code should be: <dtml-call "manage_changeProperties(upload_file=REQUEST['new_file'].read())"> As for the case of changing PropertyManager we'll have to think about that (so yes, please file it in the collector). -Michel
I am getting a Unpickling Error. I am not sure it is a PTK-specific thing, as it seems to happen to PTK-Base dobjects, but nothing in the traceback seems to indicate PTKness. I am trying to import and export things from the same machine. Case number one: Portals. They don't seem to export without this error: --------------------------- <STRONG>Error Type: UnpicklingError</STRONG><BR> <STRONG>Error Value: invalid load key, '-'.</STRONG><BR> .... <!-- Traceback (innermost last): File /home/web/Vhosts/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/web/Vhosts/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/web/Vhosts/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/web/Vhosts/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/web/Vhosts/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_importObject) File /home/web/Vhosts/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_importObject) File /home/web/Vhosts/lib/python/OFS/ObjectManager.py, line 478, in manage_importObject (Object: ElementWithAttributes) File /home/web/Vhosts/lib/python/ZODB/ExportImport.py, line 284, in importFile UnpicklingError: (see above) --> ---------------------------- Case Number two: This also happens when I try to export a new test version of a PTK Aware version of the KnowledgeKit (freshly created), although it seems to be a '.' instead of a '-'. IMO, Portals, and objects that subclass Portal Classes need to be exportable _and_ importable. Bill -- In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900
participants (4)
-
auto44082ï¼ hushmail.com -
Bill Anderson -
Michel Pelletier -
Toby Dickenson