[zope2-tracker] [Bug 854060] [NEW] macros not traversable with Zope 2.13.9 and zope.pagetemplate 3.6.*

Erich Seifert 854060 at bugs.launchpad.net
Mon Sep 19 12:40:58 EST 2011


Public bug reported:

I have updated an existing Zope 2.13.7 instance to Zope-2.13.9 and
zope.pagetemplate 3.6.1 package. After the update page templates that
used macros didn't work any more. Errors show that the "macros"
attribute isn't traversable.

For example, a zope page template containing XHTML and a METAL macro
like 'metal:use-macro="here/standard_template.pt/macros/page"' fails
with

Zope Error
Zope has encountered an error while publishing this resource.
Error Type: NotFound
Error Value: macros
...

Page templates without macros render correctly.

Here's the stack trace from the event.log:

2011-09-14T18:00:00 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/SimpleItem.py", line 241, in
raise_standardErrorMessage
    v = s(**kwargs)
  File "/usr/lib64/zope-2.13/lib/python-2.7/Shared/DC/Scripts/Bindings.py",
line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/usr/lib64/zope-2.13/lib/python-2.7/Shared/DC/Scripts/Bindings.py",
line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/ZopePageTemplate.py",
line 334, in _exec
    result = self.pt_render(extra_context=bound_names)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/ZopePageTemplate.py",
line 431, in pt_render
    result = PageTemplate.pt_render(self, source, extra_context)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/PageTemplate.py",
line 79, in pt_render
    showtal=showtal)
  File "/usr/lib64/python2.7/site-packages/zope/pagetemplate/pagetemplate.py",
line 131, in pt_render
  File "/usr/lib64/python2.7/site-packages/zope/pagetemplate/pagetemplate.py",
line 240, in __call__
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
266, in __call__
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
338, in interpret
    s = s[:76] + "...\n"
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
862, in do_useMacro
    def do_useMacro(self, (macroName, macroExpr, compiledSlots, block),
  File "/usr/lib64/python2.7/site-packages/zope/tales/tales.py", line 696, in
evaluate
    return expression(self)
  File "/usr/lib64/python2.7/site-packages/zope/tales/expressions.py", line
217, in __call__
    return self._eval(econtext)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/Expressions.py",
line 147, in _eval
    ob = self._subexprs[-1](econtext)
  File "/usr/lib64/python2.7/site-packages/zope/tales/expressions.py", line
124, in _eval
    ob = self._traverser(ob, element, econtext)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/Expressions.py",
line 74, in boboAwareZopeTraverse
    object = object.restrictedTraverse(name)
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/Traversable.py", line 316, in
restrictedTraverse
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/Traversable.py", line 299, in
unrestrictedTraverse
NotFound: macros

After going back to zope.pagetemplate 3.5.2 all pages render correctly.

The issue has been discussed already on the Gentoo bug tracker:
https://bugs.gentoo.org/show_bug.cgi?id=382977

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/854060

Title:
  macros not traversable with Zope 2.13.9 and zope.pagetemplate 3.6.*

To manage notifications about this bug go to:
https://bugs.launchpad.net/zope2/+bug/854060/+subscriptions


More information about the zope2-tracker mailing list