Forum: Building VoltDB Clients

Post: Bug in Python Client VoltResponse.__str__

Bug in Python Client VoltResponse.__str__
solarmist
Dec 17, 2012
There a bug the VoltResponse class if you have a request that's timed out there is no data in the instance's table object, so the __str__ method throws a TypeError exception.

I have a patch for the python client on github, but it looks like you can't submit patches to your client from there.

https://github.com/solarmist/voltdb-client-python/commit/86e5ad84f8b240c78bff1ea44781b441da20a4bf

Or here's the diff.
@@ -961,7 +961,10 @@ def deserialize(self, fser):
             self.tables.append(table.readFromSerializer())
 
     def __str__(self):
-        tablestr = "

".join([str(i) for i in self.tables])
+        tablestr = ''
+        if self.tables is not None:
+            tablestr = "

".join([str(i) for i in self.tables])
+
         if self.exception is None:
             return "Status: %d
Information: %s
%s" % (self.status,
                                                         self.statusString,
jpiekos
Dec 28, 2012
Thanks for posting - would you consider signing the VoltDB contributor license agreement (posted here: http://voltdb.com/contributor-license-agreement.php) so that we can accept your submission?

Thanks,

John Piekos