Hi all,

I have been trying out ``zope.xmlpickle`` as a alternative to
XMLExportImport in Zope2. Seems to do the job just fine. Grab Zope
2.9.3 and install zope.xmlpickle by hand using something of the form:

 % cd /opt/Zope-2.9/lib/python/zope
 % svn checkout svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/xmlpickle

Then using zopectl debug:

 >>> from zope.xmlpickle import dumps

Picking on something simple to start with:

 >>> xml = dumps(app.acl_users.aq_base)
 >>> print xml
 <?xml version="1.0" encoding="utf-8" ?>
       <global name="__newobj__" module="copy_reg"/>
         <global name="SiteErrorLog"
         <item key="_ignored_exceptions">
         <item key="copy_to_zlog">
         <item key="keep_entries">

That looks okay. But I strike problems with ``Missing.Value`` when
trying this on something that includes a catalog. The simplest way
to recreate the problem::

 >>> import Missing
 >>> dumps(Missing.Value())
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/opt/Zope-2.9/lib/python/zope/xmlpickle/xmlpickle.py", line
146, in dumps
     p = _dumpsUsing_PicklerThatSortsDictItems(ob, 1)
   File "/opt/Zope-2.9/lib/python/zope/xmlpickle/xmlpickle.py", line
73, in _dumpsUsing_PicklerThatSortsDictItems
     _PicklerThatSortsDictItems(file, bin).dump(object)
line 231, in dump
line 324, in save
     self.save_global(obj, rv)
line 753, in save_global
     module = whichmodule(obj, name)
line 825, in whichmodule
     if func in classmap:
 TypeError: unhashable type

Meanwhile, dumps seems to work quite happy with many other examples
that I tried. Including all the content of a plone site minus a couple
of the catalogs. And ``zope.xmlpickle.loads`` seems to do the right thing too.

Any suggestions on getting a successful dumps of a Missing.Value?

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to