[issue8857] socket.getaddrinfo needs tests

Stefan Krah report at bugs.python.org
Thu Jun 17 10:43:50 CEST 2010


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

> But why is that an attribute of a socket object?

Please pretend I did not write this. ;)


Anyway, getaddrinfo() on FreeBSD/Qemu gives this:

 >>> socket.getaddrinfo('localhost', 21)
[(2, 2, 17, '', ('127.0.0.1', 21)), (2, 1, 6, '', ('127.0.0.1', 21)), (2, 5, 132, '', ('127.0.0.1', 21)), (28, 2, 17, '', ('::1', 21, 0, 0)), (28, 1, 6, '', ('::1', 21, 0, 0)), (28, 5, 132, '', ('::1', 21, 0, 0))]
>>> socket.getaddrinfo('localhost', 22)
[(2, 2, 17, '', ('127.0.0.1', 22)), (2, 1, 6, '', ('127.0.0.1', 22)), (2, 5, 132, '', ('127.0.0.1', 22)), (28, 2, 17, '', ('::1', 22, 0, 0)), (28, 1, 6, '', ('::1', 22, 0, 0)), (28, 5, 132, '', ('::1', 22, 0, 0))]
>>> socket.getaddrinfo('localhost', 80)
[(2, 2, 17, '', ('127.0.0.1', 80)), (2, 1, 6, '', ('127.0.0.1', 80)), (2, 5, 132, '', ('127.0.0.1', 80)), (28, 2, 17, '', ('::1', 80, 0, 0)), (28, 1, 6, '', ('::1', 80, 0, 0)), (28, 5, 132, '', ('::1', 80, 0, 0))]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8857>
_______________________________________


More information about the Python-bugs-list mailing list