[Piglit] [PATCH 15/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
Fri Apr 12 16:39:57 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 9f04c9c..ca5138c 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -56,7 +56,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