diff options
| author | Andriy Sokolovskiy <sokandpal@yandex.ru> | 2014-12-02 16:12:33 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-02 12:02:18 -0500 |
| commit | 2d0d6cadd41a132950e28fd08a99f72c085e0a42 (patch) | |
| tree | 3e4873d0eeb0a7dee3a62bfc08afd243b1ef3d3d /django | |
| parent | ccc30ffe57e5f1e4dbda371b8a1d00c19a3150aa (diff) | |
[1.7.x] Fixed #23946 -- Fixed runserver crash when socket error contains Unicode chars.
Backport of bba545345f46f09245799f7ae0a22177a84eba71 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/runserver.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index e371d64099..6246b5094c 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -13,7 +13,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 @@ -142,7 +142,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) |
