summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Sokolovskiy <sokandpal@yandex.ru>2014-12-02 16:12:33 +0200
committerTim Graham <timograham@gmail.com>2014-12-02 12:01:51 -0500
commitbba545345f46f09245799f7ae0a22177a84eba71 (patch)
treef874953629a9e4ac66524abd8b8d875d445d26bf
parent0623f4dea46eefba46efde6c6528f7d813ef4391 (diff)
Fixed #23946 -- Fixed runserver crash when socket error contains Unicode chars.
-rw-r--r--django/core/management/commands/runserver.py4
-rw-r--r--docs/releases/1.7.2.txt3
2 files changed, 5 insertions, 2 deletions
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index 28b52e31ac..f29204bd1d 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -12,7 +12,7 @@ from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.db import connections, DEFAULT_DB_ALIAS
from django.db.migrations.executor import MigrationExecutor
from django.utils import autoreload
-from django.utils.encoding import get_system_encoding
+from django.utils.encoding import get_system_encoding, smart_text
from django.utils import six
from django.core.exceptions import ImproperlyConfigured
@@ -148,7 +148,7 @@ class Command(BaseCommand):
try:
error_text = ERRORS[e.errno]
except KeyError:
- error_text = str(e)
+ error_text = smart_text(e)
self.stderr.write("Error: %s" % error_text)
# Need to use an OS exit because sys.exit doesn't work in a thread
os._exit(1)
diff --git a/docs/releases/1.7.2.txt b/docs/releases/1.7.2.txt
index 85ebd1a6dc..39e89a25d1 100644
--- a/docs/releases/1.7.2.txt
+++ b/docs/releases/1.7.2.txt
@@ -98,3 +98,6 @@ Bugfixes
* Fixed a regression in ``contrib.admin`` add/change views which caused some
``ModelAdmin`` methods to receive the incorrect ``obj`` value
(:ticket:`23934`).
+
+* Fixed ``runserver`` crash when socket error message contained Unicode
+ characters (:ticket:`23946`).