diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index 503cff220f..dfff57de12 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -11,6 +11,7 @@ import socket from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import run, get_internal_wsgi_application from django.utils import autoreload +from django.utils.encoding import get_system_encoding from django.utils import six naiveip_re = re.compile(r"""^(?: @@ -101,7 +102,7 @@ class Command(BaseCommand): self.validate(display_num_errors=True) 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" 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 `_). + +* Prevented ``UnicodeDecodeError`` in ``runserver`` with non-UTF-8 and + non-English locale (`#23265 `_).