[Piglit] [PATCH 14/20] framework: Open summary files in binary mode, as we are doing the utf-8 encoding manually before writing.

Jon Severinsson jon at severinsson.net
Wed Apr 17 09:14:53 PDT 2013


Python 3.x don't support writing bytes to a text stream, while Python 2.x tries to encode unicode strings as ascii in text mode...
---
 piglit-summary-html.py |    2 +-
 1 fil ändrad, 1 tillägg(+), 1 borttagning(-)

diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 2fd6cb9..e8ae339 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -57,7 +57,7 @@ def readfile(filename):
 	return s
 
 def writefile(filename, text):
-	f = open(filename, "w")
+	f = open(filename, "wb")
 	f.write(text.encode('utf-8'))
 	f.close()
 
-- 
1.7.10.4



More information about the Piglit mailing list