[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux
New submission from Kent Frazier : If a virtual interface is present in the system, such as if the user is connected to a VPN, then there may be entries in ifconfig that do not conform to the expected `HWAddr 01:23:45:67:89:ab` MAC address format expected by uuid._find_mac. For instance, under Ubuntu 10.10 on my Acer Eee 1005HA, using Cisco's AnyConnect VPN client, I have the following entry in ifconfig: cscotun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 Not only is this more than 6 bytes long, it also uses dashes as a delimiter rather than the colons used by MAC address. After reading the relevant parts of RFC4122's definition of the algorithm for UUID1, I think we probably should be ignoring these virtual interfaces, since I doubt they are guaranteed to be unique. The attached patch assumes that it is correct to ignore these entries. If this is not appropriate, it might be better to strip all colons and dashes before the int conversion. I tried to write a test to demonstrate this issue, but had difficulty figuring out how to make it work. The import of `os` is at the function level rather than at the top of the uuid module, so mocking out the module didn't seem feasible. I also tried replacing the call to ifconfig with a call to echo with the appropriate strings to emulate this result, but echo is typically not within any of the hard-coded list of directories that _find_mac looks in. If anyone has a good idea of how to write a test for this issue, I would be happy to write one with some guidance, but I was stumped. This is my first patch submission to CPython, so if I did anything incorrectly, please let me know and I will try to correct my error. -- components: Library (Lib) files: uuid_ValueError_fix.diff keywords: patch messages: 130892 nosy: kfrazier priority: normal severity: normal status: open title: Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux type: crash versions: Python 3.3 Added file: http://bugs.python.org/file21136/uuid_ValueError_fix.diff ___ Python tracker <http://bugs.python.org/issue11508> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux
Changes by Kent Frazier : Removed file: http://bugs.python.org/file21136/uuid_ValueError_fix.diff ___ Python tracker <http://bugs.python.org/issue11508> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux
Kent Frazier added the comment: I was mistaken about the issues with mocking. I am submitting a new patch with a test included. -- Added file: http://bugs.python.org/file21143/uuid_ValueError_fix.diff ___ Python tracker <http://bugs.python.org/issue11508> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21244] distutils fails to build C extensions with XCode 5.1 and OS X 10.9 (Mavericks)
New submission from Kent Frazier: Using the stock Python shipped by Apple with OS X 10.9 Mavericks and XCode 5.1, Mercurial (and other Python extensions) encounter an error like: cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c mercurial/base85.c -o /private/var/folders/qv/tv81r5_9119bs3jwj3g2rp54gn/T/hgtests._a6HZj/build/temp.macosx-10.9-intel-2.7/mercurial/base85.o clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future error: command 'cc' failed with exit status 1 make: *** [tests] Error 1 This can be worked around with: export CFLAGS=-Qunused-arguments On my machine, Python was build with clang-500.0.68 and the XCode 5.1 updates it to clang-503.0.40. I will include a simple setup.py that can be run against Mercurial's head to demonstrate the issue. -- components: Distutils files: toysetup.py messages: 216363 nosy: dstufft, eric.araujo, jason.coombs, kfrazier priority: normal severity: normal status: open title: distutils fails to build C extensions with XCode 5.1 and OS X 10.9 (Mavericks) type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file34889/toysetup.py ___ Python tracker <http://bugs.python.org/issue21244> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11508] Virtual Interfaces cause uuid._find_mac to raise a ValueError under Linux
Kent Frazier added the comment: Serhiy, I signed the form. Let me know if you need anything else. -- ___ Python tracker <http://bugs.python.org/issue11508> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com