#12849: django's development server raises an encoding exception when trying to
colorize non-ascii text
---------------------------------------+------------------------------------
Reporter: jype | Owner: nobody
Status: new | Milestone:
Component: django-admin.py runserver | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 1 |
---------------------------------------+------------------------------------
Utf-8 should not be hardcoded, but I don't know where to read terminal's
charset from. I suppose utf-8 is acceptable as a fallback nowadays.
{{{
--- django/utils/termcolors.py (revision 12416)
+++ django/utils/termcolors.py (working copy)
@@ -38,7 +38,7 @@
print colorize('and so should this')
print 'this should not be red'
"""
- text = str(text)
+ text = unicode(text).encode('utf-8')
code_list = []
if text == '' and len(opts) == 1 and opts[0] == 'reset':
return '\x1b[%sm' % RESET
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12849>
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.