[Python-Dev] how about adding ping's uuid module to the standard lib ? (original) (raw)
Tim Peters tim.peters at gmail.com
Fri Jul 28 05:21:15 CEST 2006
- Previous message: [Python-Dev] Internal namespace proposal
- Next message: [Python-Dev] how about adding ping's uuid module to the standard lib ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Georg discovered that test_uuid didn't run any tests, and fixed that on Thursday. A number of buildbots have failed that test since then.
My XP box appears unique among the Windows buildbots in failing. It always fails like so:
AssertionError: different sources disagree on node: from source 'getnode1', node was 00038a000015 from source 'getnode2', node was 00038a000015 from source 'ipconfig', node was 001111b2b7bf
0x00038a000015 /is/ the last 6 bytes returned by the Windows UuidCreateSequential() on my box. I confirmed that by writing a C program calling it directly. However, it doesn't appear to correspond to any MAC address of any HW on my box.
All documented ways of determining the MAC address of my Ethernet card (using UuidCreateSequential for this appears to be folklore rather than documented behavior) agree that 0x001111b2b7bf is correct on this box; e.g.,
$ getmac /fo list /v Connection Name: Local Area Connection Network Adapter: Marvell Yukon 88E8050 PCI-E ASF Gigabit Ethernet Controller Physical Address: 00-11-11-B2-B7-BF Transport Name: \Device\Tcpip_...
Connection Name: 1394 Connection Network Adapter: 1394 Net Adapter Physical Address: 62-A1-AC-6C-FD-BE Transport Name: \Device\Tcpip_...
Connection Name: 1394 Connection 2 Network Adapter: 1394 Net Adapter Physical Address: E2-1F-01-C6-5D-88 Transport Name: \Device\Tcpip_...
The last two are for firewire interfaces, and don't match the purported MAC address extracted from UuidCreateSequential's output anyway.
So, at least on my box, this comment in uuid.py is incorrect (UuidCreateSequential does not behave as it says):
# On Windows prior to 2000, UuidCreate gives a UUID containing the
# hardware address. On Windows 2000 and later, UuidCreate makes a
# random UUID and UuidCreateSequential gives a UUID containing the
# hardware address. ...
Unfortunately, uuid.getnode() tries things in this order on Windows:
getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]
It's only the first one that returns the bogus 0x00038a000015; both of the latter return 0x001111B2B7BF.
However, there's nothing I can do to that list to make test_uuid pass on this box. It wants to insist that all three ways of getting/guessing the MAC address return the same thing, and that's never going to happen here.
Given that _windll_getnode's actual behavior appears to have nothing in common with what was expected for it here, best suggestion I can make is to throw its code away.
- Previous message: [Python-Dev] Internal namespace proposal
- Next message: [Python-Dev] how about adding ping's uuid module to the standard lib ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]