Skip to content
New issue

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

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

Already on GitHub? # to your account

html_error_template fails if in the traceback there are non ascii characters #88

Closed
sqlalchemy-bot opened this issue Jul 7, 2008 · 10 comments
Labels
bug Something isn't working low priority runtime
Milestone

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Anonymous

Attached is a script that reproduces the problem.


Attachments: bug_mako_html_error_template.py | mako_error.py

@sqlalchemy-bot
Copy link
Author

Anonymous wrote:

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)

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

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

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • removed labels: caching
  • added labels: runtime

@sqlalchemy-bot
Copy link
Author

Changes by Philip Jenvey (@pjenvey):

  • changed assignee from "zzzeek" to "pjenvey"

@sqlalchemy-bot
Copy link
Author

Philip Jenvey (@pjenvey) wrote:

fixed in 04a09d4

@sqlalchemy-bot
Copy link
Author

Changes by Philip Jenvey (@pjenvey):

  • changed status to closed

@sqlalchemy-bot
Copy link
Author

Anonymous wrote:

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.

@sqlalchemy-bot
Copy link
Author

Changes by Anonymous:

  • changed status to reopened

@sqlalchemy-bot
Copy link
Author

Philip Jenvey (@pjenvey) wrote:

that case should be fixed as of cd7fdd8

@sqlalchemy-bot
Copy link
Author

Changes by Philip Jenvey (@pjenvey):

  • set milestone to "0.3"
  • changed status to closed

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

No branches or pull requests

1 participant