[New-bugs-announce] [issue32107] test_uuid uses the incorrect bitmask

Barry A. Warsaw report at bugs.python.org
Tue Nov 21 12:10:23 EST 2017


New submission from Barry A. Warsaw <barry at python.org>:

The check_node() function in test_uuid.py uses the wrong bitmask, causing the tests to fail on valid MAC addresses.  Also, the description in the comment is incorrect.  From my reading of the wikipedia page, the test is trying to ensure that the MAC address is "universally administered", which is designated by a zero value in "the second least significant digit of the first octet".

Thus the bitmask value *and* the comment are both wrong AFAICT, given that the original value is:

% ./python.exe -c "from math import log2; print(log2(0x010000000000))"
40.0

I have a fix that passes on my machine, so I'll PR that and see if it passes on CI.

----------
assignee: barry
components: Tests
messages: 306672
nosy: barry
priority: normal
severity: normal
status: open
title: test_uuid uses the incorrect bitmask
versions: Python 3.7

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


More information about the New-bugs-announce mailing list