summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-08-14 11:56:25 +0200
committerClaude Paroz <claude@2xlibre.net>2014-08-14 12:08:06 +0200
commit055d95fce0668e11f2dae48d2439f378349d2524 (patch)
tree0efd2eef637a11c2c843b63556959e398e9eea95
parentb42e5ca058178d67027bf66d37d00ade635b4c26 (diff)
Fixed #23265 -- Used system-specific encoding in runserver
Thanks SpaceFox for the report.
-rw-r--r--django/core/management/commands/runserver.py3
-rw-r--r--docs/releases/1.6.6.txt3
2 files changed, 5 insertions, 1 deletions
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index 5211c25b8e..9bdb1dde34 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -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.migrations.executor import MigrationExecutor
from django.utils import autoreload
+from django.utils.encoding import get_system_encoding
from django.utils import six
from django.core.exceptions import ImproperlyConfigured
@@ -106,7 +107,7 @@ class Command(BaseCommand):
pass
now = datetime.now().strftime('%B %d, %Y - %X')
if six.PY2:
- now = now.decode('utf-8')
+ now = now.decode(get_system_encoding())
self.stdout.write((
"%(started_at)s\n"
"Django version %(version)s, using settings %(settings)r\n"
diff --git a/docs/releases/1.6.6.txt b/docs/releases/1.6.6.txt
index 92c330dbca..3c1344e173 100644
--- a/docs/releases/1.6.6.txt
+++ b/docs/releases/1.6.6.txt
@@ -33,3 +33,6 @@ Bugfixes
* Restored bug fix for sending unicode email with Python 2.6.5 and below
(`#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>`_).