[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Don't use universal_newlines=True in subprocess.Popen()



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@xxxxxxxxxx>
---
 build.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/build.py b/build.py
index c1d01b1..c03803a 100644
--- a/build.py
+++ b/build.py
@@ -93,11 +93,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()
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.