tests/run-tests.py
changeset 24500 7b0a20cd8c95
parent 24332 9612b96730d7
child 24504 7046ecabd9a8
--- a/tests/run-tests.py	Sun Mar 29 19:06:23 2015 +0200
+++ b/tests/run-tests.py	Sun Mar 29 10:41:23 2015 -0700
@@ -1469,7 +1469,11 @@
                     t = doc.createElement('testcase')
                     t.setAttribute('name', tc)
                     t.setAttribute('time', '%.3f' % timesd[tc])
-                    cd = doc.createCDATASection(cdatasafe(err))
+                    # createCDATASection expects a unicode or it will convert
+                    # using default conversion rules, which will fail if
+                    # string isn't ASCII.
+                    err = cdatasafe(err).decode('utf-8', 'replace')
+                    cd = doc.createCDATASection(err)
                     t.appendChild(cd)
                     s.appendChild(t)
                 xuf.write(doc.toprettyxml(indent='  ', encoding='utf-8'))