This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients ariel, ariel-wikimedia, neologix, r.david.murray
Date 2014-01-28.21:52:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390945924.06.0.654797720837.issue20418@psf.upfronthosting.co.za>
In-reply-to
Content
The culprint isn't Python, but the libc:
"""
$ ./python  -c "import socket; print(socket.getaddrinfo('836937931829', 80, socket.AF_INET, 0, socket.SOL_TCP))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
socket.gaierror: [Errno -2] Name or service not known
"""

But with AF_UNSPEC:
"""
$ ./python  -c "import socket; print(socket.getaddrinfo('836937931829', 80, socket.AF_UNSPEC, 0, socket.SOL_TCP))"
[(2, 1, 6, '', ('172.17.10.54', 80))]
"""

And gdb confirms that the arguments are correctly passed to the libc:
"""
$ gdb --args ./python  -c "import socket; print(socket.getaddrinfo('836937931829', 80, socket.AF_INET, 0, socket.SOL_TCP))"
Breakpoint 1, __GI_getaddrinfo (name=0xb7cc9c84 "836937931829", service=0xbffff24e "80", hints=0xbffff278, pai=0xbffff274) at ../sysdeps/posix/getaddrinfo.c:2379
(gdb) p *hints
$4 = {ai_flags = 0, ai_family = 2, ai_socktype = 0, ai_protocol = 6, ai_addrlen = 0, ai_addr = 0x0, ai_canonname = 0x0, ai_next = 0x0}
"""

You can also check directly with getaddrinfo(3).
History
Date User Action Args
2014-01-28 21:52:04neologixsetrecipients: + neologix, r.david.murray, ariel-wikimedia, ariel
2014-01-28 21:52:04neologixsetmessageid: <1390945924.06.0.654797720837.issue20418@psf.upfronthosting.co.za>
2014-01-28 21:52:04neologixlinkissue20418 messages
2014-01-28 21:52:03neologixcreate