[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-29 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> socket.gethostbyname incorrectly parses ip ___ Python tracker _

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: > So it might be better to just use inet_pton() instead. But then it won't set the scope ID if the user doesn't provide it... -- ___ Python tracker __

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: Hum... Apparently, before this bug was fixed, glibc's getaddrinfo() would retrieve the list of interfaces at every call, even if AI_ADDRCONFIG was not set: http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fa3fc0fe5f452d0aa7e435d8f32e992958683819 Wh

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-21 Thread Charles-François Natali
New submission from Charles-François Natali: Currently, setipaddr() has this code to special-case numeric IPv4 addresses and avoid a name resolution: """ if (sscanf(name, "%d.%d.%d.%d%c", &d1, &d2, &d3, &d4, &ch) == 4 && 0 <= d1 && d1 <= 255 && 0 <= d2 && d2 <= 255 && 0 <= d