Issues

Issue #88 resolved

html_error_template fails if in the traceback there are non ascii characters

guest
created an issue

Attached is a script that reproduces the problem.

Comments (6)

  1. guest reporter

    This is the traceback that results when executing the attached script:

    Traceback (most recent call last): File "mako_error.py", line 10, in <module> body = template.render() File "/usr/local/lib/python2.5/site-packages/mako/template.py", line 121, in render return runtime._render(self, self.callable_, args, data) File "/usr/local/lib/python2.5/site-packages/mako/runtime.py", line 335, in _render _render_context(template, callable_, context, *args, _kwargs_for_callable(callable_, data)) File "/usr/local/lib/python2.5/site-packages/mako/runtime.py", line 352, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/usr/local/lib/python2.5/site-packages/mako/runtime.py", line 385, in _exec_template callable_(context, *args, kwargs) File "memory:0xb7dd4bacL", line 88, in render_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 12: ordinal not in range(128)

  2. Mike Bayer repo owner

    what solution do you prefer here ? "encoding" parameters that may be sent to html_error_template() ? or a liberal "encoding_errors" setting by default ?

  3. guest reporter
    • changed status to open

    The problem seems to be still here.

    I have attached another script that reproduces the problem. The problem also affect text_error_template.

    NOTE: I have incurred in this problem with SQLAlchemy + psycopg2; the exception was an IntegrityError after an insert, and one of the values contained non us-ascii characters.

  4. Log in to comment