Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
importasyncioimportsockets=socket.socket()awaitasyncio.get_running_loop().sock_connect(s,('127.0.0.1',80))
according tohttps://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.sock_connect and
cpython/Lib/asyncio/selector_events.py
Lines 617 to 630 in5d8a3e7
| asyncdefsock_connect(self,sock,address): | |
| """Connect to a remote socket at address. | |
| This method is a coroutine. | |
| """ | |
| base_events._check_ssl_socket(sock) | |
| ifself._debugandsock.gettimeout()!=0: | |
| raiseValueError("the socket must be non-blocking") | |
| ifsock.family==socket.AF_INETor ( | |
| base_events._HAS_IPv6andsock.family==socket.AF_INET6): | |
| resolved=awaitself._ensure_resolved( | |
| address,family=sock.family,type=sock.type,proto=sock.proto, | |
| loop=self, |
it should raise. however,
ProactorEventLoop doesn't follow the ruleshould we fix this, any thoughts
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
- gh-113892: Add a extra check to
ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode #119519 - [3.13] gh-113892: Add a extra check to
ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode (GH-119519) #119912 - [3.12] gh-113892: Add a extra check to
ProactorEventLoop.sock_connectto ensure that the given socket is in non-blocking mode (GH-119519) #119913
Metadata
Metadata
Assignees
Projects
Status
Done