Bug report
Bug description:
import asyncio
import socket
s = socket.socket()
await asyncio.get_running_loop().sock_connect(s,('127.0.0.1',80))
according to https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.sock_connect and
|
async def sock_connect(self, sock, address): |
|
"""Connect to a remote socket at address. |
|
|
|
This method is a coroutine. |
|
""" |
|
base_events._check_ssl_socket(sock) |
|
if self._debug and sock.gettimeout() != 0: |
|
raise ValueError("the socket must be non-blocking") |
|
|
|
if sock.family == socket.AF_INET or ( |
|
base_events._HAS_IPv6 and sock.family == socket.AF_INET6): |
|
resolved = await self._ensure_resolved( |
|
address, family=sock.family, type=sock.type, proto=sock.proto, |
|
loop=self, |
it should raise. however,
ProactorEventLoop doesn't follow the rule
should we fix this, any thoughts
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
Bug report
Bug description:
according to https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.sock_connect and
cpython/Lib/asyncio/selector_events.py
Lines 617 to 630 in 5d8a3e7
it should raise. however,
ProactorEventLoopdoesn't follow the ruleshould we fix this, any thoughts
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode #119519ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode (GH-119519) #119912ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode (GH-119519) #119913