Antoine Pitrou pit...@free.fr added the comment:
The makefile issue is fixed in r80428 (trunk) and r80431 (2.6). Also ported the
additional test to py3k and 3.1.
The other issue pointed out by Marcin Bachry doesn't seem fixable without
breaking backwards compatibility, for applications which
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +giampaolo.rodola
versions: +Python 3.2 -Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5238
___
Jonathan Hayward jonathan.hayw...@pobox.com added the comment:
Constantine Sapuntzakis wrote:
import ssl
# Work around python bug #5328
def SSLSocket_makefile_fixed(self, mode='r', bufsize=-1):
from socket import _fileobject
self._makefile_refs += 1
return _fileobject(self,
Changes by Antoine Pitrou pit...@free.fr:
Removed file: http://bugs.python.org/file13935/unnamed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5238
___
Antoine Pitrou pit...@free.fr added the comment:
Bill, can you check if it's a real bug? Unclosed sockets are pretty bad.
--
nosy: +pitrou
priority: - high
versions: +Python 2.7, Python 3.0, Python 3.1
___
Python tracker rep...@bugs.python.org
Jonathan Hayward jonathan.hayw...@pobox.com added the comment:
Is there a workaround to close a TLS socket and its underlying socket?
I was making something to use https for a simple operation, and it the
browser acted as if the socket never closed. If I followed the close of
the ssl socket by
Constantine Sapuntzakis csapu...@gmail.com 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
Constantine Sapuntzakis csapu...@gmail.com 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
Bill Janssen bill.jans...@gmail.com added the comment:
I'd recommend running the whole suite of tests here. The issue is
mainly with httplib, as I recall it, which closes the socket before it
finishes reading from it.
___
Python tracker
David Christian d...@rpath.com added the comment:
I actually discovered this issue when using httplib over ssl. Closing
the httplib connection was not closing the socket - the socket would
only be closed after garbage collection, due to this bug. That's what
caused me to investigate and find
Changes by Benjamin Peterson benja...@python.org:
--
assignee: - janssen
nosy: +janssen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5238
___
New submission from David Christian d...@rpath.com:
The ssl.py makefile function returns a socket._fileobject object with a
reference to itself, and also increments the makefile_refs variable.
However, the _fileobject is created with the parameter close=False,
which means that when you call
Changes by David Christian d...@rpath.com:
--
components: +Library (Lib)
keywords: +patch
type: - resource usage
Added file: http://bugs.python.org/file13061/ssl.py.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5238
13 matches
Mail list logo