Skip to content

Instantly share code, notes, and snippets.

@Lukasa Lukasa/fix.patch
Created Apr 24, 2017

What would you like to do?
Short read fix.
commit ebef3775f0ab40820f5a118b632d5e1f0c7d1121
Author: Cory Benfield <>
Date: Mon Apr 24 17:23:29 2017 +0100
Read short on EOF
diff --git a/urllib3/contrib/ b/urllib3/contrib/
index 84d213f..cd840a6 100644
--- a/urllib3/contrib/
+++ b/urllib3/contrib/
@@ -517,6 +517,10 @@ class WrappedSocket(object):
return data
def recv_into(self, buffer, nbytes=None):
+ # Read short on EOF.
+ if self._closed:
+ return 0
if nbytes is None:
nbytes = len(buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.