ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zope-List
zope-List
Re: [Zope] unpickleerror confusion
by Thomas Guettler other posts by this author
Apr 19 2002 6:17AM messages near this date
[Zope] unpickleerror confusion | [Zope] metaflow versus dcworkflow
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




_______________________________________________
Zope maillist  -  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 )
Thread:
David Bear
Thomas Guettler

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved