Opened 17 years ago
Last modified 17 years ago
#4990 closed
HttpResponse.__unicode__ — at Initial Version
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I got this exception:
UnicodeEncodeError at /.../
'ascii' codec can't encode character u'\xe4' in position 33614: ordinal not in range(128)
# /home/modarch/wfbauantraege/wfba/middleware.py in process_exception
# Send Debug Traceback as Email to us
- html=smart_unicode(django.views.debug.technical_500_response(request, *sys.exc_info()), errors="replace") ...
# /home/modarch/python/lib64/python2.4/site-packages/django/utils/encoding.py in smart_unicode
- return force_unicode(s, encoding, strings_only, errors) ...
# /home/modarch/python/lib64/python2.4/site-packages/django/utils/encoding.py in force_unicode
- return s
- if not isinstance(s, basestring,):
- if hasattr(s, 'unicode'):
- s = unicode(s)
- else:
- s = unicode(str(s), encoding, errors) ...
s is a django.http.HttpResponseServerError object.
This patch gives HttpResponse a unicode method.