]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.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:24:08 +0000 (16:24 +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 d681fb303f3fa4b313df1ebbf262ecc8affb90fb..a87aecb1391d911c11b1a2aa55052aef5aaa2f5a 100644 (file)
--- a/build.py
+++ b/build.py
@@ -92,11 +92,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()