Description
Attempting to use a SSLSocket
with theasyncio.loop.sock_sendall
method and the other socket-level async functions raises the following error:
TypeError: Socket cannot be of type SSLSocket
This can be reproduced by the following if socket
is a SSLSocket
:
await asyncio.wait_for(loop.sock_sendall(socket, buf), timeout=timeout)
However, the ssl-nonblocking section of the docs says the following:
"See also: The asyncio module supports non-blocking SSL sockets and provides a higher level API. It polls for events using the selectors module and handles SSLWantWriteError, SSLWantReadError and BlockingIOError exceptions. It runs the SSL handshake asynchronously as well."
Is this section specifically referencing the streams API as the SSL-compatible asyncio API? The current wording is unclear and suggests to me that non-blocking SSLSocket
sockets are supported by asyncio, despite the error above. Is there a different section that specifies that SSLSocket
is not supported by the socket-level asyncio API?
Linked PRs
Metadata
Metadata
Assignees
Projects
Status