[issue5238] ssl makefile never closes socket

2009-05-08 Thread Constantine Sapuntzakis
Constantine Sapuntzakis added the comment: Here is the workaround I'm using until the code gets fixed: import ssl # Work around python bug #5328 def SSLSocket_makefile_fixed(self, mode='r', bufsize=-1): from socket import _fileobject self._makefile_refs += 1 ret

[issue5238] ssl makefile never closes socket

2009-04-30 Thread Constantine Sapuntzakis
Constantine Sapuntzakis added the comment: I ran into this problem when trying to use wrapsocket with httplib.py and came up with the same fix. The problem turns out to be even simpler than a ref counting issue. In the current tree, the _fileobject constructor is called without the close