[issue32199] uuid.getnode() should return the MAC address on Android

Xavier de Gaye report at bugs.python.org
Wed Dec 6 02:06:23 EST 2017


Xavier de Gaye <xdegaye at gmail.com> added the comment:

Whatever the change made to fix this issue, it is not possible to add a test case for this change.

So following the suggestion made by Barry in PR 4696, we can add (in another issue) a new keyword parameter to getnode() named 'methods' whose value may be None (the default, meaning try all the known methods) or a tuple containing a subset of the following methods ('unix', 'ifconfig', 'ip', 'arp', 'lanscan', 'netstat',  'random') that would raise an exception if the value cannot be obtained using one of the requested method tried in the requested order. This would also improve the documentation on the methods getnode() is using. Then if we decide to make the change for 'ip link' in the current issue, one can add a test case that would first test for the avaibility of the ip command and if the command exists would fail if getnode(methods=('ip',)) raises an exception.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32199>
_______________________________________


More information about the Python-bugs-list mailing list