This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, serhiy.storchaka, vstinner
Date 2017-11-23.19:31:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
On Nov 23, 2017, at 11:24, Serhiy Storchaka <> wrote:

> Wait, now I understand the purpose of the current test! There is just a typo in a comment, should be 41 instead of 47. The test itself is correct. If the address is obtained from network cards, it should have the 41 bit clear. If it is generated randomly, it should have the 41 bit set, to avoid conflicts with addresses obtained from network cards. There is nothing about the 42 bit.

It’s not just a typo in the comment, it’s a typo in the bitmask, at least if the intent of the test is to ensure that the MAC address is universally administered.  That is defined as having a 0 in the “second least significant bit of the first octet”.  Here’s a way to make that clearer.

# Second least significant bit of the first octet of the 48-bit MAC address
>>> 0b00000010_00000000_00000000_00000000_00000000_00000000
# Constant from the PR
>>> 1<<41
# Literal bit mask from the original code.
>>> 0x010000000000

The latter is off by 1 place.
Date User Action Args
2017-11-23 19:31:23barrysetrecipients: + barry, vstinner, serhiy.storchaka
2017-11-23 19:31:23barrylinkissue32107 messages
2017-11-23 19:31:23barrycreate