in python 2.7 - the things we are sending can also be a 'memoryview' object
authorSeth Vidal <skvidal@fedoraproject.org>
Wed, 8 Sep 2010 19:03:48 +0000 (15:03 -0400)
committerSeth Vidal <skvidal@fedoraproject.org>
Wed, 8 Sep 2010 19:03:48 +0000 (15:03 -0400)
so if we get one of those -convert it using tobytes() as its internal object

certmaster/SSLConnection.py

index c266906..93fabb6 100644 (file)
@@ -97,6 +97,9 @@ class SSLConnection:
         if not con in write:
             raise socket.timeout((110, "Operation timed out."))
 
+        if hasattr(data, 'tobytes'):
+            data = data.tobytes()
+            
         starttime = time.time()
         origlen = len(data)
         sent = -1