XML export/import is cool! (Was Re: [Zope-dev] Deprecating XML export/import?)

Yoshinori Okuji yo at nexedi.com
Sat Mar 25 15:40:48 EST 2006


On Saturday 25 March 2006 15:56, Andreas Jung wrote:
> Zope 2.7 throws a BadPickleGet, 12 exception, Zope 2.8 throws
> BadPickleGet, 13 and Zope 2.9 raises the described UnicodeDecodeError.
> I don't expect that the import functionality works for even more complex
> objects. So I consider the whole functionality as totally broken. The
> generated XML might be useful to perform any processing outside Zope but
> using it for re-importing it into another Zope systems definitely does
> _not_  work. So if the functionality should remain in Zope then it should
> be fixed
> for Zope 2.10 lately.

Here is a quick patch for this problem (against 2.9.1). There were two 
different problems:

- the id attributes were not generated, because the conditional was reverse.

- unlike xmllib, expat always returns Unicode data, so simply concatenating 
binary values generates Unicode objects with non-ascii characters.

For the latter problem, I'm not sure if my patch is enough. But this patch 
works with a simple dtml export/import.

YO
-- 
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://wiki.erp5.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zope-2.9.1-ppml.patch
Type: text/x-diff
Size: 1495 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20060325/e0605c8b/Zope-2.9.1-ppml.bin


More information about the Zope-Dev mailing list