This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spiv
Recipients spiv
Date 2010-09-01.02:32:21
SpamBayes Score 1.152245e-12
Marked as misclassified No
Message-id <1283308344.48.0.527543460928.issue9729@psf.upfronthosting.co.za>
In-reply-to
Content
ython 2.6.6 (r266:84292, Aug 24 2010, 21:47:18) 
[GCC 4.4.5 20100816 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket, ssl
>>> s = socket.socket()
>>> wrapped = ssl.wrap_socket(s)
>>> wrapped.recv(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/ssl.py", line 217, in recv
    return socket.recv(self, buflen, flags)
TypeError: 'member_descriptor' object is not callable


What I expected was a more helpful error, like the unwrapped socket gives:

>> s.recv(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.error: [Errno 107] Transport endpoint is not connected


The full list of affected methods are all the _delegate_methods from socket.py:

_delegate_methods = ("recv", "recvfrom", "recv_into", "recvfrom_into",
                     "send", "sendto")

The cause is that the SSLSocket subclass is trying to upcall to the _socketobject base class, but the base does not have methods for those, just __slots__ for the instance to fill in with bound methods.
History
Date User Action Args
2010-09-01 02:32:24spivsetrecipients: + spiv
2010-09-01 02:32:24spivsetmessageid: <1283308344.48.0.527543460928.issue9729@psf.upfronthosting.co.za>
2010-09-01 02:32:22spivlinkissue9729 messages
2010-09-01 02:32:21spivcreate