Ticket #6353: 6353.diff

File 6353.diff, 1.1 KB (added by Karen Tracey <kmtracey@…>, 17 years ago)
  • django/views/debug.py

     
    184184        'root_urlconf': settings.ROOT_URLCONF,
    185185        'request_path': request.path[1:], # Trim leading slash
    186186        'urlpatterns': tried,
    187         'reason': str(exception),
     187        'reason': smart_unicode(exception, errors='replace'),
    188188        'request': request,
    189189        'request_protocol': request.is_secure() and "https" or "http",
    190190        'settings': get_safe_settings(),
  • django/utils/encoding.py

     
    4949        if not isinstance(s, basestring,):
    5050            if hasattr(s, '__unicode__'):
    5151                s = unicode(s)
     52            elif isinstance(s, Exception):
     53                s = ' '.join([force_unicode(arg, encoding, strings_only, errors) for arg in s.args])
    5254            else:
    5355                s = unicode(str(s), encoding, errors)
    5456        elif not isinstance(s, unicode):
Back to Top