Ticket #4300: views_debug_py.diff

File views_debug_py.diff, 670 bytes (added by Thomas Güttler <hv@…>, 12 years ago)
  • django/views/debug.py

     
    122122            'function': '?',
    123123            'lineno': '?',
    124124        }]
     125
     126    # Exception values might contain unkown encodings.
     127    # Example: Postgres might return latin1 strings.
     128    try:
     129        exc_value=str(exc_value).decode("latin1")
     130    except UnicodeError:
     131        exc_value=str(exc_value).decode("utf8", "replace")
     132
    125133    t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template')
    126134    c = Context({
    127135        'exception_type': exc_type.__name__,
Back to Top