diff options
author | Tim Peters <tim.peters@gmail.com> | 2006-07-28 04:51:59 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2006-07-28 04:51:59 (GMT) |
commit | 750c4420a86852bf549ded572c52b544b7c4bc6b (patch) | |
tree | 05217d3f2b5a0c54a73027d755a910d8f6cd6cf9 /Lib/uuid.py | |
parent | df80af7659c05e45bb3500ce4cecca1f3f426280 (diff) | |
download | cpython-750c4420a86852bf549ded572c52b544b7c4bc6b.zip cpython-750c4420a86852bf549ded572c52b544b7c4bc6b.tar.gz cpython-750c4420a86852bf549ded572c52b544b7c4bc6b.tar.bz2 |
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
Diffstat (limited to 'Lib/uuid.py')
-rw-r--r-- | Lib/uuid.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py index 11e0da3..dabe22e 100644 --- a/Lib/uuid.py +++ b/Lib/uuid.py @@ -362,6 +362,10 @@ try: # hardware address. On Windows 2000 and later, UuidCreate makes a # random UUID and UuidCreateSequential gives a UUID containing the # hardware address. These routines are provided by the RPC runtime. + # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last + # 6 bytes returned by UuidCreateSequential are fixed, they don't appear + # to bear any relationship to the MAC address of any network device + # on the box. try: lib = ctypes.windll.rpcrt4 except: @@ -389,10 +393,13 @@ def _random_getnode(): _node = None def getnode(): - """Get the hardware address as a 48-bit integer. The first time this - runs, it may launch a separate program, which could be quite slow. If - all attempts to obtain the hardware address fail, we choose a random - 48-bit number with its eighth bit set to 1 as recommended in RFC 4122.""" + """Get the hardware address as a 48-bit positive integer. + + The first time this runs, it may launch a separate program, which could + be quite slow. If all attempts to obtain the hardware address fail, we + choose a random 48-bit number with its eighth bit set to 1 as recommended + in RFC 4122. + """ global _node if _node is not None: |