Fixed #23265 -- Used system-specific encoding in runserver
Thanks SpaceFox for the report.
This commit is contained in:
parent
b42e5ca058
commit
055d95fce0
|
@ -12,6 +12,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 import six
|
from django.utils import six
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ class Command(BaseCommand):
|
||||||
pass
|
pass
|
||||||
now = datetime.now().strftime('%B %d, %Y - %X')
|
now = datetime.now().strftime('%B %d, %Y - %X')
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
now = now.decode('utf-8')
|
now = now.decode(get_system_encoding())
|
||||||
self.stdout.write((
|
self.stdout.write((
|
||||||
"%(started_at)s\n"
|
"%(started_at)s\n"
|
||||||
"Django version %(version)s, using settings %(settings)r\n"
|
"Django version %(version)s, using settings %(settings)r\n"
|
||||||
|
|
|
@ -33,3 +33,6 @@ Bugfixes
|
||||||
|
|
||||||
* Restored bug fix for sending unicode email with Python 2.6.5 and below
|
* Restored bug fix for sending unicode email with Python 2.6.5 and below
|
||||||
(`#19107 <https://code.djangoproject.com/ticket/19107>`_).
|
(`#19107 <https://code.djangoproject.com/ticket/19107>`_).
|
||||||
|
|
||||||
|
* Prevented ``UnicodeDecodeError`` in ``runserver`` with non-UTF-8 and
|
||||||
|
non-English locale (`#23265 <https://code.djangoproject.com/ticket/23265>`_).
|
||||||
|
|
Loading…
Reference in New Issue