Issue #5238: Calling makefile() on an SSL object would prevent the
underlying socket from being closed until all objects get truely destroyed.
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 4f291f4..9e88073 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -324,7 +324,9 @@
from the socket module."""
self._makefile_refs += 1
- return _fileobject(self, mode, bufsize)
+ # close=True so as to decrement the reference count when done with
+ # the file-like object.
+ return _fileobject(self, mode, bufsize, close=True)