Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #19942 -- Decoded errors coming from Popen commands

Thanks Aymeric Augustin for reporting the issue.
  • Loading branch information...
commit e4bf0f2c367ca77266900af3461e1ec440c8689d 1 parent 97afc49
Claude Paroz authored March 03, 2013

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  django/core/management/utils.py
9  django/core/management/utils.py
... ...
@@ -1,6 +1,8 @@
1 1
 import os
2 2
 from subprocess import PIPE, Popen
3 3
 
  4
+from django.utils.encoding import force_text, DEFAULT_LOCALE_ENCODING
  5
+
4 6
 
5 7
 def popen_wrapper(args):
6 8
     """
@@ -11,7 +13,12 @@ def popen_wrapper(args):
11 13
     p = Popen(args, shell=False, stdout=PIPE, stderr=PIPE,
12 14
               close_fds=os.name != 'nt', universal_newlines=True)
13 15
     output, errors = p.communicate()
14  
-    return output, errors, p.returncode
  16
+    return (
  17
+        output,
  18
+        force_text(errors, DEFAULT_LOCALE_ENCODING, strings_only=True),
  19
+        p.returncode
  20
+    )
  21
+
15 22
 
16 23
 def handle_extensions(extensions=('html',), ignored=('py',)):
17 24
     """

0 notes on commit e4bf0f2

Please sign in to comment.
Something went wrong with that request. Please try again.