[issue5625] test_urllib2 fails - urlopen error file not on local host

Senthil Kumaran report at bugs.python.org
Wed Dec 15 14:40:27 CET 2010


Senthil Kumaran <orsenthil at gmail.com> added the comment:

+            localaddr = socket.gethostbyname_ex(socket.gethostname())[2][0]

May not be a generic solution, because in another system the other ip
could be first in the list.  Because the failure was in the test_file,
which was basically exercising file://'localhost' in the url, I
suggested that you replace with 'localhost'. I think, the solution is
okay, even thought localhost has been exercised in another test.

----------
Added file: http://bugs.python.org/file20051/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5625>
_______________________________________
-------------- next part --------------
<span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">+            localaddr = socket.gethostbyname_ex(socket.gethostname())[2][0]</pre>

<pre style="word-wrap: break-word; white-space: pre-wrap; ">May not be a generic solution, because in another system the other ip could be first in the list.  Because the failure was in the test_file, which was basically exercising file://&#39;localhost&#39; in the url, I suggested that you replace with &#39;localhost&#39;. I think, the solution is okay, even thought localhost has been exercised in another test.</pre>

</span>


More information about the Python-bugs-list mailing list