[ZCM] [ZC] 868/ 1 Request "ZTUtils tree support broken"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Thu, 27 Mar 2003 02:25:48 -0500


Issue #868 Update (Request) "ZTUtils tree support broken"
 Status Pending, Zope/bug+solution medium
To followup, visit:
  http://collector.zope.org/Zope/868

==============================================================
= Request - Entry #1 by d.maurer on Mar 27, 2003 2:25 am

ZTUtils tree support is broken in such a way that
the examples in "Products/PageTemplates/examples"
no longer work.

The bug is caused by a missing "return" in
"ZTUtils.Zope.filterChildren" in the standard
case. As a result, it returns "None" instead
of a sequence of children.
The solution is to provide the missing "return children".

A secondary error in "encode/decodeExpansion"
leads to the mysterious error message ("IndexError:
list index out of range").
"encodeExpansion" does not expect to receive
an empty sequence of nodes. It correctly
transforms it into an empty string but then
compresses it (when *compress*=1, the default)
to make it non-empty.
"decodeExpansion" cannot handle an empty state
string. Its caller would handle an empty state
but as it seems to be nonempty (my compressing)
the bad state is handed over to "decodeExpansion".
The solution is not to compress the state, when
it is empty.
==============================================================