Senthil Kumaran <orsent...@gmail.com> added the comment:

Well, ignore my comment on order of ip addresses. It definitely does not matter 
in this case for test_urllib2.

However, readability does matter again as per my previous explanation, since 
http://localhost/ was being exercised in the test_file, 
gethostbyname('localhost') is much better than that return value's [2][0] 
element.

I overlooked one thing in your first message, namely gethostbyname and 
gethostbyname_ex()[2] returning completely different ips and turning out to be 
exclusive. This should not be the case. gethostbyname_ex()[2] should include 
the ip which was returned by gethostbyname. If it were the case, the test would 
not have failed as well.

And btw, both these are supposed have similar behavior (The default action is 
to query named(8), followed by /etc/hosts) only thing is gethostbyname_ex uses 
the reentrant c function call and is thread-safe.

(You may probably want to identify the problem for the difference in o/p there)

And for this bug report, I am still inclined to having 'localhost' for 
readability purposes or leaving it as such because the problem seems be 
elsewhere.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5625>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to