unpickleerror confusion
I was going through the example in the Zope Book (new riders) making slight modifications to the code. Trying to do the example of using a post method to create new dtml docs (using python p 84). Well, after creating the dtml-doc and method, and the python script, and running it, I get the ugly : ====================================== Zope Error Zope has encountered an error while publishing this resource. Error Type: UnpickleableError Error Value: Cannot pickle objects Traceback (innermost last): File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: LockableItem) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 175, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 240, in commit File /usr/local/www/Zope/lib/python/ZODB/Transaction.py, line 302, in commit File /usr/local/www/Zope/lib/python/ZODB/Connection.py, line 418, in commit (Info: (('OFS.DTMLDocument', 'DTMLDocument'), '\x00\x00\x00\x00\x00\x00\x19\xa4', '')) UnpickleableError: (see above) ========================= here's the python that is called to save the doc: ========py code============ id='Document_%d' % len(context.objectIds()) context.manage_addProduct['OFSP'].manage_addDTMLDocument(id, title=name, file=abstract) doc=getattr(context, id) doc.manage_addProperty('Manager', manager, 'string') doc.manage_addProperty('StartDate', startDate, 'string') doc.manage_addProperty('EndDate', endDate, 'string') doc.manage_addProperty('FundingSourse', fundingSource, 'string') doc.manage_addProperty('FundingAmount', fundingAmount, 'string') doc.manage_addProperty('KeyWords', keywords, string) Any pointers would be greatly appreciated. -- David Bear College of Public Programs/ASU 480-965-8257 ...the way is like water, going where nobody wants it to go
David Bear wrote:
I was going through the example in the Zope Book (new riders) making slight modifications to the code. Trying to do the example of using a post method to create new dtml docs (using python p 84).
Well, after creating the dtml-doc and method, and the python script, and running it, I get the ugly :
====================================== Zope Error Zope has encountered an error while publishing this resource. Error Type: UnpickleableError Error Value: Cannot pickle objects Traceback (innermost last): File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: LockableItem) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 175, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 240, in commit File /usr/local/www/Zope/lib/python/ZODB/Transaction.py, line 302, in commit File /usr/local/www/Zope/lib/python/ZODB/Connection.py, line 418, in commit (Info: (('OFS.DTMLDocument', 'DTMLDocument'), '\x00\x00\x00\x00\x00\x00\x19\xa4', '')) UnpickleableError: (see above)
=========================
here's the python that is called to save the doc:
========py code============
id='Document_%d' % len(context.objectIds()) context.manage_addProduct['OFSP'].manage_addDTMLDocument(id, title=name, file=abstract) doc=getattr(context, id) doc.manage_addProperty('Manager', manager, 'string') doc.manage_addProperty('StartDate', startDate, 'string') doc.manage_addProperty('EndDate', endDate, 'string') doc.manage_addProperty('FundingSourse', fundingSource, 'string') doc.manage_addProperty('FundingAmount', fundingAmount, 'string') doc.manage_addProperty('KeyWords', keywords, string)
maybe startDate is not a string but a object which can't be pickled. thomas
On Thursday, April 18, 2002, at 05:05 PM, David Bear wrote:
I was going through the example in the Zope Book (new riders) making slight modifications to the code. Trying to do the example of using a post method to create new dtml docs (using python p 84).
....
id='Document_%d' % len(context.objectIds()) context.manage_addProduct['OFSP'].manage_addDTMLDocument(id, title=name, file=abstract) doc=getattr(context, id) doc.manage_addProperty('Manager', manager, 'string') doc.manage_addProperty('StartDate', startDate, 'string') doc.manage_addProperty('EndDate', endDate, 'string') doc.manage_addProperty('FundingSourse', fundingSource, 'string') doc.manage_addProperty('FundingAmount', fundingAmount, 'string') doc.manage_addProperty('KeyWords', keywords, string)
Should that last "string" be quoted? -steve
Any pointers would be greatly appreciated.
-- David Bear College of Public Programs/ASU 480-965-8257 ...the way is like water, going where nobody wants it to go
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Fri, 19 Apr 2002, Steve Spicklemire wrote:
Date: Fri, 19 Apr 2002 05:17:44 -0500 From: Steve Spicklemire <steve@spvi.com> On Thursday, April 18, 2002, at 05:05 PM, David Bear wrote:
slight modifications to the code. Trying to do the example of using a post method to create new dtml docs (using python p 84).
....
doc.manage_addProperty('FundingAmount', fundingAmount, 'string') doc.manage_addProperty('KeyWords', keywords, string)
Should that last "string" be quoted?
thank you steve. That was IT!!!! -- David Bear College of Public Programs/ASU 480-965-8257 ...the way is like water, going where nobody wants it to go
participants (3)
-
David Bear -
Steve Spicklemire -
Thomas Guettler