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
[Zope] unpickleerror confusion
by David Bear other posts by this author
Apr 18 2002 10:05PM messages near this date
Re: [Zope] import threading.Lock --> unpickleable | Re: [Zope] 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_ho
ok
    (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



_______________________________________________
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