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 guandalino
Recipients benjamin.peterson, ezio.melotti, guandalino, orsenthil, terry.reedy
Date 2010-08-01.10:30:08
SpamBayes Score 8.75603e-05
Marked as misclassified No
Message-id <>
urllib2 tests fail when internet connection is not available.

$ cd ~/sandbox/2.7/lib/python2.7/test
$ python

other output, [cut]

ERROR: test_file (__main__.HandlerTests)
Traceback (most recent call last):
  File "", line 711, in test_file
    h.file_open, Request(url))
  File "/home/redt/sandbox/2.7/lib/python2.7/unittest/", line 456, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/redt/sandbox/2.7/lib/python2.7/", line 1269, in file_open
    return self.open_local_file(req)
  File "/home/redt/sandbox/2.7/lib/python2.7/", line 1301, in open_local_file
    (not port and socket.gethostbyname(host) in self.get_names()):
gaierror: [Errno -5] No address associated with hostname

Ran 34 tests in 0.414s

FAILED (errors=1)

The issue verifies using ubuntu 8.04 LTS having this /etc/hosts: localhost localhost.localdomain speedy

::1 localhost speedy ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts 

Note that when connected to internet all the tests pass.

Further details can be found in a thread I started 
on comp.lang.python.

I can't guarantee a quick answer but let me know if other info are required, I'll be glad to provide them asap. Thank you.
Date User Action Args
2010-08-01 10:30:13guandalinosetrecipients: + guandalino, terry.reedy, orsenthil, benjamin.peterson, ezio.melotti
2010-08-01 10:30:13guandalinosetmessageid: <>
2010-08-01 10:30:10guandalinolinkissue9446 messages
2010-08-01 10:30:08guandalinocreate