From bbe09cc6414d1a195a8535eb302e07a10e02956a Mon Sep 17 00:00:00 2001 From: Fantix King Date: Wed, 14 Aug 2024 00:36:54 -0400 Subject: [PATCH] Fix for macOS It seems getaddrinfo('', ...) on macOS is equivalent to nodename='localhost'. This is inconsistent with libuv 1.48 which treats empty nodename as EINVAL. --- uvloop/dns.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uvloop/dns.pyx b/uvloop/dns.pyx index 3688e26f..6a26011f 100644 --- a/uvloop/dns.pyx +++ b/uvloop/dns.pyx @@ -348,6 +348,8 @@ cdef class AddrInfoRequest(UVRequest): if host is None: chost = NULL + elif host == b'' and sys.platform == 'darwin': + chost = 'localhost' else: chost = host