[New-bugs-announce] [issue3162] ssl.SSLSocket implements methods that are overriden by socket.socket.__init__ and methods with incorrect names.

Simon Cross report at bugs.python.org
Sat Jun 21 19:13:40 CEST 2008


New submission from Simon Cross <hodgestar at gmail.com>:

It appears that ssl.SSLSocket attempts to override some of the methods
socket.socket delegates to the underlying _socket.socket methods.
However, this overriding fails because socket.socket.__init__ replaces
all the methods mentioned in _delegate_methods.

These methods are: recv, recvfrom, recv_into, recvfrom_into, send and
sendto.

ssl.SSLSocket implements recv and send. Neither of these overrides will
actually work.  ssl.SSLSocket also implements recv_from and send_to
which seem to be attempts to override recvfrom and sendto.

In the Py3k branch it looks like the overriding done by
socket.socket.__init__ is gone so that these methods are now potentially
overridable. This could potentially be emulated in trunk by checking for
the methods using hasattr(...) before overriding them.

I'm happy to create patches which fix the method names and clean up the
methods on both branches and add tests. I just want to check that I have
an accurate picture of what's needed before starting on them.

----------
components: Library (Lib)
messages: 68517
nosy: hodgestar
severity: normal
status: open
title: ssl.SSLSocket implements methods that are overriden by socket.socket.__init__ and methods with incorrect names.
versions: Python 2.6, Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3162>
_______________________________________


More information about the New-bugs-announce mailing list