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

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Serhiy and Barry for your comments and reviews :-) -- ___ Python tracker ___

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

2017-12-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: LGTM, and thanks! -- ___ Python tracker ___ ___

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

2017-12-07 Thread Xavier de Gaye
Change by Xavier de Gaye : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: New changeset 03031fbc7d44106d652756462db34eae67de9568 by xdegaye (Miss Islington (bot)) in branch '3.6': bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link list' (GH-4696) (#4747)

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

2017-12-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4650 ___ Python tracker ___

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

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: New changeset 961dbe0548e26394b7716d41423c61b1e2e58ef7 by xdegaye in branch 'master': bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link list' (GH-4696)

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

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: On archlinux it is easy to know precisely what patches are applied to iproute2 and how it is built (see https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/iproute2). The attached two files, archlinux-ip_link.strace and

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

2017-12-07 Thread Xavier de Gaye
Change by Xavier de Gaye : Added file: https://bugs.python.org/file47326/archlinux-ip_link.strace ___ Python tracker ___

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

2017-12-06 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: > Maybe we should just close this issue as 'wont fix' then. I would be okay with any of these resolutions: * Close as `wont fix` * Just call `ip link` (without list) * Add a new getter such that both `ip link` and `ip link list` are called.

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

2017-12-06 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Dec 6, 2017, at 02:06, Xavier de Gaye wrote: > > Whatever the change made to fix this issue, it is not possible to add a test > case for this change. Even with say, exception raising mocks for the getters? > So

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

2017-12-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: Attached ip_link.strace and ip_link_list.strace, the output of strace for the 'ip link' and 'ip link list' commands. At the end of the process, both commands create an PF_NETLINK socket to receive from the kernel link information through

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

2017-12-06 Thread Xavier de Gaye
Change by Xavier de Gaye : Added file: https://bugs.python.org/file47322/ip_link.strace ___ Python tracker ___

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

2017-12-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: It is also possible that rather than an oversight in Android, it is a side effect of SELinux on the implementation of iproute2 if the 'ip link list' command does a little bit more than the 'ip link' command and if this 'little bit more' is

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

2017-12-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: Oops, the second failed command is 'ip link list' of course. -- ___ Python tracker ___

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

2017-12-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: 'adb logcat' is a tool that monitors many kind of events on Android. Both ip commands prints a SElinux record on logcat: Upon the successfull 'ip link' command, logcat prints: 12-06 09:17:24.119 2460 2460 W ip : type=1400

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

2017-12-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: You may be right Serhiy. Those tests have been run on the emulator at API 24 (Android 7.0 Nougat, the first API version where SELinux is run in enforced mode) where 'ip link list' fails, but on my device (a Samsung API 21, Android 5.1

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

2017-12-05 Thread Xavier de Gaye
Xavier de Gaye 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'

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

2017-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if "ip link list" was intentionally prohibited "for security reasons", and "ip link" works just due to oversight? Xavier, could you please inspect the sources of the ip command on Android? Is it the standard iproute2 with

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

2017-12-05 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Dec 5, 2017, at 16:28, Xavier de Gaye wrote: > > The result of various 'ip' commands on Android, the last 'ip link list' > command is run as root and succeeds (did not think about trying that before): > >

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

2017-12-05 Thread Xavier de Gaye
Xavier de Gaye added the comment: The result of various 'ip' commands on Android, the last 'ip link list' command is run as root and succeeds (did not think about trying that before): generic_x86_64:/data/local/tmp/python $ ip link list request send failed: Permission

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

2017-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why the 'ip link list' command fails on Android at first place? Does Android use its own independent implementation? Or its version is based on the fork of very old version of iproute2 that didn't supported the list command (if

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

2017-12-05 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Over in the PR I suggested: Here's another thought: what if you just added another getter that calls ip link list and placed that after one that calls ip link. Wouldn't that accomplish both goals? Then if ip link fails, we fall back to the

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

2017-12-04 Thread Xavier de Gaye
Change by Xavier de Gaye : -- keywords: +patch pull_requests: +4609 stage: needs patch -> patch review ___ Python tracker ___

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

2017-12-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +easy nosy: +serhiy.storchaka ___ Python tracker ___

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

2017-12-02 Thread Xavier de Gaye
New submission from Xavier de Gaye : Currently uuid.getnode() returns a random 48-bit number and so the UUIDs are not persistent across time. The reason is that on Android the 'ip link list' command fails. uuid._ip_getnode() should invoke the 'ip link' command instead.