Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19942 -- Decoded errors coming from Popen commands

Thanks Aymeric Augustin for reporting the issue.
  • Loading branch information...
commit e4bf0f2c367ca77266900af3461e1ec440c8689d 1 parent 97afc49
@claudep claudep authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 django/core/management/utils.py
View
9 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',)):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.