Issue #16298: In HTTPResponse.read(), close the socket when there is no Content-Length and the incoming stream is finished.
Patch by Eran Rundstein.
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 97a7155..4d93b93 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -511,6 +511,10 @@
             self.length -= len(s)
             if not self.length:
                 self.close()
+        else:
+            if not s:
+                self.close()
+
         return s
 
     def _read_chunked(self, amt):