#12302: Exception with utf8 message leads to DjangoUnicodeDecodeError
---------------------------+------------------------------------------------
Reporter: bjourne | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.1
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
The psycopg2 driver raises exceptions with i18n:ized messages. Django is
not able to diplay them and will raise a DjangoUnicodeDecodeError.
Example:
{{{
File "/var/lib/python-support/python2.6/django/views/debug.py", line 39,
in technical_500_response
html = reporter.get_traceback_html()
File "/var/lib/python-support/python2.6/django/views/debug.py", line 97,
in get_traceback_html
'exception_value': smart_unicode(self.exc_value, errors='replace'),
File "/var/lib/python-support/python2.6/django/utils/encoding.py", line
35, in smart_unicode
return force_unicode(s, encoding, strings_only, errors)
File "/var/lib/python-support/python2.6/django/utils/encoding.py", line
70, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
7: ordinal not in range(128). You passed in DataError('FEL: v\xc3\xa4rdet
f\xc3\xb6r l\xc3\xa5ngt f\xc3\xb6r typen character varying(511)\n',)
(<class 'psycopg2.DataError'>)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12302>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.