mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.7.x] Fixed #23946 -- Fixed runserver crash when socket error contains Unicode chars.
Backport of bba545345f46f09245799f7ae0a22177a84eba71 from master
This commit is contained in:
parent
ccc30ffe57
commit
2d0d6cadd4
@ -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 import connections, DEFAULT_DB_ALIAS
|
||||||
from django.db.migrations.executor import MigrationExecutor
|
from django.db.migrations.executor import MigrationExecutor
|
||||||
from django.utils import autoreload
|
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.utils import six
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ class Command(BaseCommand):
|
|||||||
try:
|
try:
|
||||||
error_text = ERRORS[e.errno]
|
error_text = ERRORS[e.errno]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
error_text = str(e)
|
error_text = smart_text(e)
|
||||||
self.stderr.write("Error: %s" % error_text)
|
self.stderr.write("Error: %s" % error_text)
|
||||||
# Need to use an OS exit because sys.exit doesn't work in a thread
|
# Need to use an OS exit because sys.exit doesn't work in a thread
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
|
@ -98,3 +98,6 @@ Bugfixes
|
|||||||
* Fixed a regression in ``contrib.admin`` add/change views which caused some
|
* Fixed a regression in ``contrib.admin`` add/change views which caused some
|
||||||
``ModelAdmin`` methods to receive the incorrect ``obj`` value
|
``ModelAdmin`` methods to receive the incorrect ``obj`` value
|
||||||
(:ticket:`23934`).
|
(:ticket:`23934`).
|
||||||
|
|
||||||
|
* Fixed ``runserver`` crash when socket error message contained Unicode
|
||||||
|
characters (:ticket:`23946`).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user