]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Don't use universal_newlines=True in subprocess.Popen()
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 25 Sep 2014 14:06:31 +0000 (15:06 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 25 Sep 2014 15:29:56 +0000 (16:29 +0100)
For some versions of python this appears to cause corruption of the
output byte string by forcibly decoding with the wrong encoding.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
build.py

index f72f521d8c1bb2fc108c34a55734fde1b57a2de8..f7d2f9904ef8d35b411190b704975db19af0b192 100644 (file)
--- a/build.py
+++ b/build.py
@@ -165,11 +165,10 @@ def shell(command, dir):
     
     sub = subprocess.Popen(' '.join(command), cwd=dir,
                            stdout=subprocess.PIPE,
-                           stderr=subprocess.STDOUT, 
-                           universal_newlines=True)
+                           stderr=subprocess.STDOUT)
 
     for line in sub.stdout:
-        print(line.rstrip())
+        print(line.decode(sys.getdefaultencoding()).rstrip())
 
     sub.wait()