Dimitri John Ledkov added the comment:
The source code matches 3.4.2 tarball exactly.
There is no arp_getnode test that I can see.
316 @unittest.skipUnless(os.name == '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."""
348
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
354
355 import socket
356 ip_addr = socket.gethostbyname(socket.gethostname())
357
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
362
363 # This might work on HP-UX.
364 mac = _find_mac('lanscan', '-ai', ['lan0'], lambda i: 0)
365 if mac:
366 return mac
367
368 return None
And I do not see any try/except protections around it.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23170>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com