[New-bugs-announce] [issue8858] socket.getaddrinfo returns wrong results for IPv6 addresses

Antoine Pitrou report at bugs.python.org
Sun May 30 19:04:39 CEST 2010


New submission from Antoine Pitrou <pitrou at free.fr>:

It seems socket.getaddrinfo gives wrong results for IPv6 address under py3k:

>>> pprint.pprint(socket.getaddrinfo("www.python.org", 0))
[(2, 1, 6, '', ('82.94.164.162', 0)),
 (2, 2, 17, '', ('82.94.164.162', 0)),
 (2, 3, 0, '', ('82.94.164.162', 0)),
 (10, 1, 6, '', (10, b'\x00\x00\x00\x00\x00\x00 \x01\x08\x88 \x00\x00\r')),
 (10, 2, 17, '', (10, b'\x00\x00\x00\x00\x00\x00 \x01\x08\x88 \x00\x00\r')),
 (10, 3, 0, '', (10, b'\x00\x00\x00\x00\x00\x00 \x01\x08\x88 \x00\x00\r'))]

The results given by 2.x make much more sense:
>>> pprint.pprint(socket.getaddrinfo("www.python.org", 0))
[(2, 1, 6, '', ('82.94.164.162', 0)),
 (2, 2, 17, '', ('82.94.164.162', 0)),
 (2, 3, 0, '', ('82.94.164.162', 0)),
 (10, 1, 6, '', ('2001:888:2000:d::a2', 0, 0, 0)),
 (10, 2, 17, '', ('2001:888:2000:d::a2', 0, 0, 0)),
 (10, 3, 0, '', ('2001:888:2000:d::a2', 0, 0, 0))]

----------
messages: 106768
nosy: pitrou
priority: high
severity: normal
status: open
title: socket.getaddrinfo returns wrong results for IPv6 addresses
type: behavior
versions: Python 3.1, Python 3.2

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


More information about the New-bugs-announce mailing list