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.

classification
Title: loop.sock_connect doesn't resolve the address parameter on Windows
Type: behavior Stage:
Components: asyncio Versions: Python 3.11, Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: YAtOff, asvetlov, kumaraditya, yselivanov
Priority: normal Keywords:

Created on 2021-10-20 07:57 by YAtOff, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg404398 - (view) Author: Yavor Atov (YAtOff) Date: 2021-10-20 07:57
From https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.sock_connect :

Changed in version 3.5.2: address no longer needs to be resolved. sock_connect will try to check if the address is already resolved by calling socket.inet_pton(). If not, loop.getaddrinfo() will be used to resolve the address.

This used to be true in Python 3.7, but in the newer versions, no resolution is done. It could be seen in the source code - the loop implementation is changed and the new one doesn't resolve the address.

https://github.com/python/cpython/blob/085ccb0f177988065dbe9ef4c5cda434560066bc/Lib/asyncio/proactor_events.py#L703

https://github.com/python/cpython/blob/085ccb0f177988065dbe9ef4c5cda434560066bc/Lib/asyncio/windows_events.py#L576
msg414107 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2022-02-26 14:18
Can you provide a minimal reproducer otherwise it is hard to know if there is any bug.
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89696
2022-02-26 14:18:58kumaradityasetnosy: + kumaraditya
messages: + msg414107
2021-10-20 07:57:12YAtOffcreate