Function signature is completely wrong. instead of two arguments (name and port) you have to use one argument -- tuple. For ipv4 it would be 2-element tuple (ip and port). For IPv6 it would be 4-element tuple, where the last element is a scope-id. It is essential for Link-local IPv6.
Looks like the bug is two fold: the documentation is wrong, because we do take a tuple, and the code is wrong because we only look at the first 2 elements.
https://pycares.readthedocs.io/en/latest/channel.html#pycares.Channel.getnameinfo
Function signature is completely wrong. instead of two arguments (name and port) you have to use one argument -- tuple. For ipv4 it would be 2-element tuple (ip and port). For IPv6 it would be 4-element tuple, where the last element is a scope-id. It is essential for Link-local IPv6.
See Python's native
socket.getnameinfo()
.note
wlp2s0
. It is interface number 3 on my PC.