[Zope-dev] PageTemplate XML mode bugs

Fred Drake fdrake at gmail.com
Tue Oct 5 11:27:34 EDT 2004


On Tue, 05 Oct 2004 12:47:33 +0200, yuppie <y.2004_ at wcm-solutions.de> wrote:
> There are two annoying bugs that make the XML mode unusable for many tasks:
> 
> - <http://collector.zope.org/Zope/1101> (i18n namespace broken)
> 
> - <http://collector.zope.org/Zope/1474> (XML files opened in binary mode)
> 
> I would volunteer to work on these issues, but for that it would be
> useful to know:
> 
> 1.) Does anybody feel responsible for the TAL or PageTemplates module?

I try to pay attention to TAL and PageTemplates issues, but don't
always have time to deal with them, or answers regarding what *should*
be done.  Many of the issues have to do with the expectations of
others not aligning with my own.  ;-)

> 2.) What was the motivation for the original code?
> 
> #1101 looks like someone just forgot to remove a debug assert in
> TALParser.py. The Zope3 version doesn't have that assert statement. Or
> was there a reason to disable i18n for XML mode?

That's what it looks like.  The assert isn't in the Zope 3 version of
the code.  I suspect it can be safely removed.  I've made a note of
this in the tracker issue.

> #1474 is a change backported from Zope3. It was reverted for HTML mode
> for apparently the same reason why the XML mode is still broken. I guess
> the motivation was to preserve CDATA, but I don't know that for sure.

This report isn't clear.  Please update the issue and explain what the
problem is; glancing at the code on the Zope 2 and Zope 3 trunks, the
only thing that looks suspicious to me is that re-opening an HTML file
doesn't use Python's universal newline support.

HTML is always text, so should be treated that way on input.  XML may
contain textual content, but should always be handed to the XML parser
as a raw byte stream to allow the proper decoding machinery a shot at
doing the right thing.


  -Fred

-- 
Fred L. Drake, Jr.    <fdrake at gmail.com>
Zope Corporation


More information about the Zope-Dev mailing list