Force JSONRPC error message to Unicode to deal with faulty JSON parser in Python 2.7
authorForrest Voight <forrest.voight@gmail.com>
Sun, 11 Mar 2012 16:11:29 +0000 (12:11 -0400)
committerForrest Voight <forrest.voight@gmail.com>
Sun, 11 Mar 2012 16:11:29 +0000 (12:11 -0400)
p2pool/util/jsonrpc.py

index 6cbd2c8..f223f37 100644 (file)
@@ -64,7 +64,7 @@ class Proxy(object):
         if resp['id'] != id_:
             raise ValueError('invalid id')
         if 'error' in resp and resp['error'] is not None:
-            raise Error(**resp['error'])
+            raise Error(**unicode(resp['error']))
         defer.returnValue(resp['result'])
     
     def __getattr__(self, attr):