Message115286
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. |
|
Date |
User |
Action |
Args |
2010-09-01 02:32:24 | spiv | set | recipients:
+ spiv |
2010-09-01 02:32:24 | spiv | set | messageid: <1283308344.48.0.527543460928.issue9729@psf.upfronthosting.co.za> |
2010-09-01 02:32:22 | spiv | link | issue9729 messages |
2010-09-01 02:32:21 | spiv | create | |
|