Hash: SHA1

Andreas Jung wrote:

> --On 24. März 2006 11:07:06 -0500 Jim Fulton <[EMAIL PROTECTED]> wrote:
>>> - it was broken multiple times in the past, it still has problems
>> How so?
> The import functionality seem to be broken since at least Zope 2.7.
> I created a DTML method exported it and _tried_ to reimport it.
> Zope 2.7 throws a BadPickleGet, 12 exception,

I just exported the stock 'standard_error_message' as XML and
re-imported it successfully in a brand new Zope-2_7-branch instance.

> Zope 2.8 throws> BadPickleGet, 13

Likewise, my import succeeded in a Zope-2_8-instance, both with the XML
file exported from 2.7 and with one created from 2.8.

> Zope 2.9 raises the described UnicodeDecodeError.

My Zope-2_9-branch instance was successfully able to import the XML file
from 2.7, but raises a UnicodeDecode error on the file it produces, as
well as the one created from 2.8.  The stack trace here makes it seem as
though Python 2.4.2's expat parser is at fault:  it is introducing
non-ASCII characters into the stream where none exist in the source:

(Pdb) u
- -> r=p.Parse(data)
(Pdb) print [x for x in data if ord(x) > 127]
(Pdb) d
- -> ("(N)", string_intern(self, name)))
(Pdb) d
- -> top = end[tag](self, tag, top)
(Pdb) print [type(x) for x in top]
[<type 'unicode'>, <type 'dict'>, <type 'unicode'>, <type 'str'>]
(Pdb) print [x for x in top[-1] if ord(x) > 127]
(Pdb) print [chr(ord(x)) for x in top[-1][10:25]]
['U', '\x03', 'r', 'a', 'w', 'T', '\xcb', '\x04', '\x00', '\x00', '<',
'd', 't', 'm', 'l']

That output seems to me to indicate that the start of the CDATA section
is the problem.

> 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.

I've just tried again, running with Python 2.4.3c1, because several of
the changelog entries for the release suggest that unicode / encoding /
expat stuff may have been fixed:  the decode error is still present.

- --
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


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