[llvm-commits] [zorg] r130130 - /zorg/trunk/lnt/lnt/testing/__init__.py

Daniel Dunbar daniel at zuster.org
Mon Apr 25 09:53:11 PDT 2011


Author: ddunbar
Date: Mon Apr 25 11:53:11 2011
New Revision: 130130

URL: http://llvm.org/viewvc/llvm-project?rev=130130&view=rev
Log:
lnt.testing.report: Override the default encoding to avoid the potential for
UTF-8 encoding errors to break report rendering.

Modified:
    zorg/trunk/lnt/lnt/testing/__init__.py

Modified: zorg/trunk/lnt/lnt/testing/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/testing/__init__.py?rev=130130&r1=130129&r2=130130&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/testing/__init__.py (original)
+++ zorg/trunk/lnt/lnt/testing/__init__.py Mon Apr 25 11:53:11 2011
@@ -43,10 +43,13 @@
             assert isinstance(t, TestSamples)
 
     def render(self, indent=4):
+        # Note that we specifically override the encoding to avoid the
+        # possibility of encoding errors. Clients which care about the text
+        # encoding should supply unicode string objects.
         return json.dumps({ 'Machine' : self.machine.render(),
                             'Run' : self.run.render(),
                             'Tests' : [t.render() for t in self.tests] },
-                          sort_keys=True, indent=indent)
+                          sort_keys=True, indent=indent, encoding='latin-1')
 
 class Machine:
     """Information on the machine the test was run on.





More information about the llvm-commits mailing list