Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

error reporting improvement #81

Closed
runyaga opened this Issue Dec 20, 2011 · 4 comments

Comments

Projects
None yet
3 participants

runyaga commented Dec 20, 2011

Malthe says "You're trying to include a macro which is not a macro, but a string."

Traceback (most recent call last):
  File "...-12082011/src/ploud.zope/ploud/zope/publisher.py", line 206, in publish_module
    response = _publish(request, 'ploud_application_%s'%name)
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/ZPublisher/WSGIPublisher.py", line 195, in publish
    bind=1,
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/ZPublisher/mapply.py", line 77, in mapply
    if debug is not None: return debug(object,args,context)
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/ZPublisher/Publish.py", line 46, in call_object
    result=apply(object,args) # Type s<cr> to step into published object.
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "...-12082011/src/ploud.zope/ploud/zope/patches.py", line 82, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/Products/PageTemplates/ZopePageTemplate.py", line 334, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/Products/PageTemplates/ZopePageTemplate.py", line 431, in pt_render
    result = PageTemplate.pt_render(self, source, extra_context)
  File "...-12082011/eggs/Zope2-2.13.10-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 79, in pt_render
    showtal=showtal)
  File "...-12082011/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "...-12082011/eggs/five.pt-2.2.0-py2.7.egg/five/pt/engine.py", line 93, in __call__
    return self.template.render(**kwargs)
  File "...-12082011/eggs/z3c.pt-2.1.5-py2.7.egg/z3c/pt/pagetemplate.py", line 149, in render
    return base_renderer(**context)
  File "...-12082011/eggs/Chameleon-2.6.2-py2.7.egg/chameleon/zpt/template.py", line 247, in render
    return super(PageTemplate, self).render(**vars)
  File "...-12082011/eggs/Chameleon-2.6.2-py2.7.egg/chameleon/template.py", line 175, in render
    self._render(stream, econtext, rcontext)
  File "a4ad3b69425bdcc774d202c75459f236faf77643.py", line 609, in render
  File "d4a0fcc9eeb63c6c6fa3fb6170414fb74118c2f6.py", line 2040, in render_master
  File "d4a0fcc9eeb63c6c6fa3fb6170414fb74118c2f6.py", line 791, in render_content
  File "a4ad3b69425bdcc774d202c75459f236faf77643.py", line 597, in __fill_content_core
  File "a4ad3b69425bdcc774d202c75459f236faf77643.py", line 98, in render_content_core
AttributeError: 'unicode' object has no attribute 'include'

khink commented Nov 20, 2015

I was also bitten by this. Turns out we override a template containing a macro. Our overridden template didn't contain any macros anymore.

Owner

malthe commented Nov 20, 2015

Maybe you need to use something like load: your-template.pt – ?

khink commented Nov 23, 2015

It's solved for us. We undid the override. Another option would have been to create an empty macro.

I was just writing it here to give a pointer to people that might run into this in the future. Maybe a PR to update the Caveats section would have clearer.

Owner

malthe commented Dec 6, 2016

Fixed in a7811ec.

@malthe malthe closed this Dec 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment