Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression 0.8: filter entity returns TypeError #214

Closed
sqlalchemy-bot opened this issue Apr 15, 2013 · 5 comments
Closed

regression 0.8: filter entity returns TypeError #214

sqlalchemy-bot opened this issue Apr 15, 2013 · 5 comments
Labels
bug Something isn't working low priority runtime

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Anonymous

This snippet gives an error (Mako 0.8, Python 2.6.6).

>>> Template('hello ${data|entity}!').render(data="world")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/srv/openerp/.buildout/eggs/Mako-0.8.0-py2.6.egg/mako/template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "/srv/openerp/.buildout/eggs/Mako-0.8.0-py2.6.egg/mako/runtime.py", line 783, in _render
    **_kwargs_for_callable(callable_, data))
  File "/srv/openerp/.buildout/eggs/Mako-0.8.0-py2.6.egg/mako/runtime.py", line 815, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/srv/openerp/.buildout/eggs/Mako-0.8.0-py2.6.egg/mako/runtime.py", line 841, in _exec_template
    callable_(context, *args, **kwargs)
  File "memory:0x1e70d50", line 22, in render_body
  File "/srv/openerp/.buildout/eggs/Mako-0.8.0-py2.6.egg/mako/filters.py", line 92, in escape_entities
    return str(text).translate(self.codepoint2entity)
TypeError: expected a character buffer object
@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

the "entity" filter doesn't seem to work anyway even in 0.7.3:

Template('hello ${data|entity}!').render(data="<world")



return compat.text_type(text).translate(self.codepoint2entity)
TypeError: character mapping must return integer, None or unicode

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

ah that was the wrong source tree, nm

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

dc09816

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot
Copy link
Author

Anonymous wrote:

Thank you

-- [[BR]]
flox

@sqlalchemy-bot sqlalchemy-bot added bug Something isn't working low priority runtime labels Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority runtime
Projects
None yet
Development

No branches or pull requests

1 participant