Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/asyncio/selector_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ async def sock_connect(self, sock, address):
if self._debug and sock.gettimeout() != 0:
raise ValueError("the socket must be non-blocking")

if not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX:
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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix :meth:`asyncio.loop.sock_connect` to only resolve names for :const:`socket.AF_INET` or
:const:`socket.AF_INET6` families. Resolution may not make sense for other families,
like :const:`socket.AF_BLUETOOTH` and :const:`socket.AF_UNIX`.