#23946: Runserver socket error in unicode fails to print error message
-------------------------------------+-------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Keywords: unicode, runserver,
Severity: Normal | management command
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
In `django.core.management.commands.runserver.Command#inner_run`, when
catching socket error, can be a unicode problem.
For example, after `error_text = str(e)` there can be an unicode text, so
this line will raise `UnicodeDecodeError` and will not exit runserver
command:
{{{
self.stderr.write("Error: %s" % error_text)
}}}
Simple solution:
{{{
self.stderr.write("Error: %s" % error_text.decode('utf-8'))
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23946>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.bddaa5bf6f58c51880e1616b59c9f27e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.