Title: test_uuid test_ifconfig_getnode fails with Temporary failure in name resolution
Type: compile error Stage: resolved
Components: Installation Versions: Python 3.4
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray, xnox
Priority: normal Keywords:

Created on 2015-01-05 17:12 by xnox, last changed 2015-01-05 18:24 by r.david.murray. This issue is now closed.

Messages (5)
msg233467 - (view) Author: Dimitri John Ledkov (xnox) * Date: 2015-01-05 17:12
Building 3.4.2, running testsuite on linux,
test_uuid test_ifconfig_getnode fails as following:

[365/388] test_uuid
Warning -- sys.path was modified by test_site
test test_uuid failed -- Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.4.2/Lib/test/", line 318, in test_ifconfig_getnode
    node = uuid._ifconfig_getnode()
  File "/builddir/build/BUILD/Python-3.4.2/Lib/", line 356, in _ifconfig_getnode
    ip_addr = socket.gethostbyname(socket.gethostname())
socket.gaierror: [Errno -3] Temporary failure in name resolution

Note that "Use of the 'network' resource not enabled"
msg233469 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-01-05 17:30
That traceback doesn't match the source, nor has _ifconfig_getnode been modified for quite some time.  A line like your traceback says is in _ifconfig_getnode actually appears in _arp_getnode.  The arp_getnode test would presumably have the same problem, since it is also not protected by either; however, that call to socket in, which is the only such call in the file, is protected by a try/except for OSError, so no error should be bubbling up from it.

Can you investigate further, please?
msg233471 - (view) Author: Dimitri John Ledkov (xnox) * Date: 2015-01-05 17:38
The source code matches 3.4.2 tarball exactly.

There is no arp_getnode test that I can see.

316    @unittest.skipUnless( == 'posix', 'requires Posix')
317    def test_ifconfig_getnode(self):
318        node = uuid._ifconfig_getnode()
319        if node is not None:
320            self.check_node(node, 'ifconfig')

346def _ifconfig_getnode():
347    """Get the hardware address on Unix by running ifconfig."""
349    # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.                                                                                                                                
350    for args in ('', '-a', '-av'):
351        mac = _find_mac('ifconfig', args, ['hwaddr', 'ether'], lambda i: i+1)
352        if mac:
353            return mac
355    import socket
356    ip_addr = socket.gethostbyname(socket.gethostname())
358    # Try getting the MAC addr from arp based on our IP address (Solaris).                                                                                                                                
359    mac = _find_mac('arp', '-an', [ip_addr], lambda i: -1)
360    if mac:
361        return mac
363    # This might work on HP-UX.                                                                                                                                                                           
364    mac = _find_mac('lanscan', '-ai', ['lan0'], lambda i: 0)
365    if mac:
366        return mac
368    return None

And I do not see any try/except protections around it.
msg233472 - (view) Author: Dimitri John Ledkov (xnox) * Date: 2015-01-05 17:53
I guess this is related to however I get a test-suite fail / exception there with 3.4.2 on Linux.
msg233474 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-01-05 18:24
Ah, I see what happened.  Serhiy split _ifconfig_getnode, so when I did an hg annotate it looked like _ifconfig_getnode was untouched, but in fact it had been split to create the _arp_getnode function.

So, this report is out of date, this has already been fixed in 3.4.
Date User Action Args
2015-01-05 18:24:30r.david.murraysetstatus: open -> closed
resolution: out of date
messages: + msg233474

stage: resolved
2015-01-05 17:53:08xnoxsetmessages: + msg233472
2015-01-05 17:38:11xnoxsetmessages: + msg233471
2015-01-05 17:30:54r.david.murraysetnosy: + r.david.murray
messages: + msg233469
2015-01-05 17:12:35xnoxcreate