Skip to content

Commit

Permalink
Fix for macOS
Browse files Browse the repository at this point in the history
It seems getaddrinfo('', ...) on macOS is equivalent to nodename='localhost'.
This is inconsistent with libuv 1.48 which treats empty nodename as EINVAL.
  • Loading branch information
fantix committed Aug 14, 2024
1 parent f3446e4 commit bbe09cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uvloop/dns.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ cdef class AddrInfoRequest(UVRequest):

if host is None:
chost = NULL
elif host == b'' and sys.platform == 'darwin':
chost = <char*>'localhost'
else:
chost = <char*>host

Expand Down

0 comments on commit bbe09cc

Please sign in to comment.