[Python-modules-team] Bug#594146: namebench: benchmark stops with UnicodeDecodeError

Miguel Landaeta miguel at miguel.cc
Wed Aug 25 17:03:51 UTC 2010


tags 594146 + patch
thanks

Hi Konrad,

I don't know if this is a correct way to solve this problem,
but this patch should avoid the crash:

--- reporter.py.orig	2010-08-25 12:19:55.000000000 -0430
+++ reporter.py	2010-08-25 12:26:43.000000000 -0430
@@ -419,7 +419,7 @@
 
   def CreateJsonData(self):
     sharing_data = self._CreateSharingData()
-    return simplejson.dumps(sharing_data)
+    return simplejson.dumps(unicode(sharing_data, 'utf-8', 'replace'))
 
   def _ResponseToCountTtlText(self, response):
     """For a given DNS response, parse the most important details out.
 

Cheers,

-- 
Miguel Landaeta, miguel at miguel.cc
secure email with PGP 0x7D8967E9 available at http://keyserver.pgp.com/
"Faith means not wanting to know what is true." -- Nietzsche





More information about the Python-modules-team mailing list