]> xenbits.xensource.com Git - pvdrivers/win/xennet.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:20:52 +0000 (16:20 +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 95122bd8fe2b2decac31bd295c5dfa1c6524102c..a2a295fac5a841bde4674d6c9d49ffbce7ed93b4 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()