summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-03-03 19:58:13 +0100
committerClaude Paroz <claude@2xlibre.net>2013-03-03 20:00:44 +0100
commite4bf0f2c367ca77266900af3461e1ec440c8689d (patch)
tree00413c4b8782c6b6f6010cc64caa06d207a07d2b
parent97afc49bb0cca34cb83b371c5f83d74cb3974b91 (diff)
Fixed #19942 -- Decoded errors coming from Popen commands
Thanks Aymeric Augustin for reporting the issue.
-rw-r--r--django/core/management/utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/core/management/utils.py b/django/core/management/utils.py
index 769f9723c1..de6e57f097 100644
--- a/django/core/management/utils.py
+++ b/django/core/management/utils.py
@@ -1,6 +1,8 @@
import os
from subprocess import PIPE, Popen
+from django.utils.encoding import force_text, DEFAULT_LOCALE_ENCODING
+
def popen_wrapper(args):
"""
@@ -11,7 +13,12 @@ def popen_wrapper(args):
p = Popen(args, shell=False, stdout=PIPE, stderr=PIPE,
close_fds=os.name != 'nt', universal_newlines=True)
output, errors = p.communicate()
- return output, errors, p.returncode
+ return (
+ output,
+ force_text(errors, DEFAULT_LOCALE_ENCODING, strings_only=True),
+ p.returncode
+ )
+
def handle_extensions(extensions=('html',), ignored=('py',)):
"""