| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Added test for weakreferencing a uuid.UUID object.
|
|
|
|
|
| |
uuid.uuid1() now calls time.time_ns() rather than
int(time.time() * 1e9). Replace also int(nanoseconds/100)
with nanoseconds // 100. Add an unit test.
|
|
|
|
| |
also mention the change and its consequences in What's New
|
|
|
| |
Co-Authored-By: Wouter Bolsterlee.
|
|
|
|
|
|
| |
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match.
|
|
|
|
| |
(GH-5608)
|
| |
|
|
|
|
| |
list' (GH-4696)
|
|
|
|
|
| |
uuid.get_node() always must return a stable result.
Also added a test for non-reproducibility of _random_getnode().
Original patch by Xavier de Gaye.
|
|
|
|
|
|
|
|
| |
``uuid.getnode()`` now preferentially returns universally administered MAC addresses if available, over locally administered MAC addresses. This makes a better guarantee for global uniqueness of UUIDs returned from ``uuid.uuid1()``. If only locally administered MAC addresses are available, the first such one found is returned.
Also improve internal code style by being explicit about ``return None`` rather than falling off the end of the function.
Improve the test robustness.
|
|
|
| |
This reverts commit 9522a218f7dff95c490ff359cc60e8c2af35f5c8.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve UUID1 MAC address calculation and related tests.
There are two bits in the MAC address that are relevant to UUID1. The first is the locally administered vs. universally administered bit (second least significant of the first octet). Physical network interfaces such as ethernet ports and wireless adapters will always be universally administered, but some interfaces --such as the interface that MacBook Pros communicate with their Touch Bars-- are locally administered. The former are guaranteed to be globally unique, while the latter are demonstrably *not* globally unique and are in fact the same on every MBP with a Touch Bar. With this bit is set, the MAC is locally administered; with it unset it is universally administered.
The other bit is the multicast bit (least significant bit of the first octet). When no other MAC address can be found, RFC 4122 mandates that a random 48-bit number be generated. This randomly generated number *must* have the multicast bit set.
The improvements in uuid.py include:
* Preferentially return a universally administered MAC address, falling back to a locally administered address if none of the former can be found.
* Improve several coding style issues, such as adding explicit returns of None, using a more readable bitmask pattern, and assuming that the ultimate fallback, random MAC generation will not fail (and propagating any exception there instead of swallowing them).
Improvements in test_uuid.py include:
* Always testing the calculated MAC for universal administration, unless explicitly disabled (i.e. for the random case), or implicitly disabled due to running in the Travis environment. Travis test machines have *no* universally administered MAC address at the time of this writing.
|
|
|
|
|
|
| |
* Using ifconfig on NetBSD and OpenBSD.
* Using arp on Linux, FreeBSD, NetBSD and OpenBSD.
Based on patch by Takayuki Shimizukawa.
|
|
|
|
|
| |
On macOS, use uuid_generate_time() instead of
uuid_generate_time_safe() of libuuid, since uuid_generate_time_safe()
is not available.
|
|
|
|
| |
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid.
|
|
|
| |
See PEP 11.
|
|
|
|
| |
bpo-22807: Expose platform UUID generation safety information.
|
| |
|
|
|
|
| |
Patch by jgauthier.
|
| |
|
| |
|
|
|
|
| |
with specified exception type. Original patch by Ramchandra Apte.
|
|
|
|
| |
implementation in issue #21408 they are redundant.
|
|
|
|
| |
in uuid.getnode(). Pach by Bruno Cauet.
|
|\ |
|
| | |
|
|\ \
| |/
| |
| | |
Based on patch by Aivars Kalvāns.
|
| |
| |
| |
| | |
Based on patch by Aivars Kalvāns.
|
| |
| |
| |
| | |
a pipe in _ipconfig_getnode().
|
| | |
|
| |
| |
| |
| | |
Replace os.popen() with subprocess.Popen() in the uuid module.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Optimized bytes and bytes_le properties of UUID and UUID constructor with
bytes_le argument.
Fixed a bug in handling an error occured during reading from a pipe in
_ipconfig_getnode().
|
|/
|
|
| |
class name instead of hardcoded one.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
I didn't realize LC_ALL was an override, and I should have. I tried to
make a test, but it is not clear that the LC variables actually affect
the strings that uuid is using to parse the command output.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Patch by Serhiy Storchaka.
|
|\ \
| |/
| |
| | |
virtual interface. Original patch by Kent Frazier.
|
| |
| |
| |
| | |
virtual interface. Original patch by Kent Frazier.
|
|\ \
| |/
| |
| |
| | |
if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov.
|
| |
| |
| |
| |
| | |
if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov.
|
| | |
|
|\ \
| |/ |
|
| | |
|
|/ |
|
|
|
|
|
| |
plain tuples to immutable iterable objects with named attributes
(structseq objects).
|
|
|
|
| |
in finally. Removes two ResourceWarnings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82276 | ronald.oussoren | 2010-06-27 14:43:47 +0200 (Sun, 27 Jun 2010) | 5 lines
The uuid library on OSX 10.5 seems to contain the same bug as the one
on OSX 10.6, therefore don't use it there either.
This fixes issue8621.
........
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80784 | ronald.oussoren | 2010-05-05 16:48:37 +0200 (Wed, 05 May 2010) | 9 lines
The C function used by uuid.uuid4 is broken on
OSX 10.6 in that after os.fork() the parent and
child generate the same sequence of UUIDs.
This patch falls back to the the Python implementation
on OSX 10.6 or later.
Fixes issue #8621.
........
|