Skip to content

Commit

Permalink
Fixed #19942 -- Decoded errors coming from Popen commands
Browse files Browse the repository at this point in the history
Thanks Aymeric Augustin for reporting the issue.
  • Loading branch information
claudep committed Mar 3, 2013
1 parent 97afc49 commit e4bf0f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion django/core/management/utils.py
Original file line number Diff line number Diff line change
@@ -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):
"""
Expand All @@ -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',)):
"""
Expand Down

0 comments on commit e4bf0f2

Please sign in to comment.