Skip to content

Instantly share code, notes, and snippets.

@evnm
Created October 14, 2015 21:37
Show Gist options
  • Save evnm/af92092c6a7776e08339 to your computer and use it in GitHub Desktop.
Save evnm/af92092c6a7776e08339 to your computer and use it in GitHub Desktop.
diff --git a/urllib3/contrib/pyopenssl.py b/urllib3/contrib/pyopenssl.py
index c20ae46..2023fe4 100644
--- a/urllib3/contrib/pyopenssl.py
+++ b/urllib3/contrib/pyopenssl.py
@@ -202,6 +202,9 @@ class WrappedSocket(object):
def _send_until_done(self, data):
while True:
+ if has_memoryview and isinstance(data, memoryview):
+ data = data.tobytes()
+
try:
return self.connection.send(data)
except OpenSSL.SSL.WantWriteError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment