summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_uuid.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40501: Replace ctypes code in uuid with native module (GH-19948)Steve Dower2020-05-121-20/+7
|
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-291-2/+0
|
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-311-1/+1
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* bpo-39991: Enhance uuid parser for MAC address (GH-19045)Victor Stinner2020-03-171-0/+52
| | | | Reject valid IPv6 addresses which doesn't contain "::" but have a length of 17 characters.
* bpo-39991: uuid._netstat_getnode() ignores IPv6 addresses (GH-19043)Victor Stinner2020-03-171-9/+45
| | | | uuid.getnode() now skips IPv6 addresses with the same string length than a MAC address (17 characters): only use MAC addresses.
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-1/+1
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672)Michael Felt2019-09-261-21/+50
|
* bpo-28009: Fix uuid SkipUnless logic to be based on platform programs ↵Michael Felt2019-06-151-8/+12
| | | | | | | | | | | | | capable of introspection (GH-12777) uuid could try fallback methods that had no chance of working on a particular platform, and this could cause spurious test failures, as well as degraded performance as fallback options were tried and failed. This fixes both the uuid module and its test's SkipUnless logic to use a prefiltered list of techniques that may at least potentially work on that platform. Patch by Michael Felt (aixtools).
* bpo-35701: Added __weakref__ slot to uuid.UUID (GH-11570)David H2019-01-171-0/+6
| | | Added test for weakreferencing a uuid.UUID object.
* bpo-31784: Use time.time_ns() in uuid.uuid1() (GH-11189)Victor Stinner2018-12-181-0/+18
| | | | | 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.
* bpo-35202: Remove unused imports in Lib directory (GH-10450)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-151-1/+0
|
* bpo-30977: rework code changes according to post-merge code review (GH-9106)Tal Einat2018-09-101-51/+129
| | | | also mention the change and its consequences in What's New
* bpo-30977: make uuid.UUID use __slots__ (GH-9078)Tal Einat2018-09-061-0/+60
| | | Co-Authored-By: Wouter Bolsterlee.
* bpo-32502: Discard 64-bit (and other invalid) hardware addresses (#5254)Bo Bayles2018-01-241-0/+26
|
* Fix a regression in uuid added in bpo-32107. (#4677)Serhiy Storchaka2017-12-041-0/+3
| | | | | 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.
* bpo-32107 - Improve MAC address calculation and fix test_uuid.py (#4600)Barry Warsaw2017-11-281-14/+12
| | | | | | | | ``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.
* Revert "bpo-32107 - Better merge of #4494 (#4576)" (#4593)Victor Stinner2017-11-271-30/+17
| | | This reverts commit 9522a218f7dff95c490ff359cc60e8c2af35f5c8.
* bpo-32107 - Better merge of #4494 (#4576)Barry Warsaw2017-11-271-17/+30
| | | | | | | | | | | | | | | | 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.
* bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796)Antoine Pitrou2017-09-281-138/+177
| | | | bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid.
* bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971)Victor Stinner2017-04-191-0/+3
|
* require uuid_generate_time_safe for all tests of it (#390)Benjamin Peterson2017-03-021-7/+8
| | | The way mocking is written in these tests, we need to have the underlying function around.
* correct check for _uuid_generate_time (#388)Benjamin Peterson2017-03-021-1/+1
| | | If ctypes is not available, _uuid_generate_time will be None not its restype attribute.
* bpo-22807: Expose platform UUID generation safety information. (#138)Barry Warsaw2017-02-181-0/+40
| | | | bpo-22807: Expose platform UUID generation safety information.
* Issue #26267: Improve uuid.UUID documentationBerker Peksag2016-12-311-0/+4
| | | | | | | | * Document how comparison of UUID objects work * Document str(uuid) returns the braceless standard form * Add a test for comparison of a UUID object with a non-UUID object Patch by Ammar Askar.
* Issue #12813: uuid.uuid4() no longer depends on ctypesBerker Peksag2016-03-201-1/+0
| | | | uuid.uuid4() always uses os.urandom() after 756d040aa8e8.
* Issue #23015: Improved testing of the uuid module.Serhiy Storchaka2014-12-151-110/+98
|\
| * Issue #23015: Improved testing of the uuid module.Serhiy Storchaka2014-12-151-105/+94
| |
* | Issue #22902: The "ip" command is now used on Linux to determine MAC addressSerhiy Storchaka2014-11-301-0/+6
| | | | | | | | in uuid.getnode(). Pach by Bruno Cauet.
* | Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat.Serhiy Storchaka2014-11-071-1/+19
|\ \ | |/ | | | | Based on patch by Aivars Kalvāns.
| * Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat.Serhiy Storchaka2014-11-071-0/+18
| | | | | | | | Based on patch by Aivars Kalvāns.
* | Issue #22637: avoid using a shell in uuidVictor Stinner2014-10-211-19/+19
|/ | | | Replace os.popen() with subprocess.Popen() in the uuid module.
* Issue #19804: The test_find_mac test in test_uuid is now skipped if theSerhiy Storchaka2014-01-101-0/+6
| | | | ifconfig executable is not available.
* Skip test_find_mac on Windows (issue #19804).Serhiy Storchaka2013-11-271-0/+1
| | | | This test requires the ifconfig executable on $PATH, /sbin/, or /usr/sbin.
* Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment withSerhiy Storchaka2013-11-261-0/+21
| | | | virtual interface. Original patch by Kent Frazier.
* Issue #18174: Fix fd leaks in tests.Richard Oudkerk2013-06-101-0/+1
|
* Issue #18094: test_uuid no more reports skipped tests as passed.Serhiy Storchaka2013-05-311-51/+27
|
* Normalize the encoding names for Latin-1 and UTF-8 toMarc-André Lemburg2011-02-251-2/+2
| | | | | | | | | | 'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
* Merged revisions 80784 via svnmerge fromRonald Oussoren2010-05-051-0/+28
| | | | | | | | | | | | | | | | | 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. ........
* Merged revisions 79954 via svnmerge fromStefan Krah2010-04-111-23/+9
| | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79954 | stefan.krah | 2010-04-11 17:15:54 +0200 (Sun, 11 Apr 2010) | 17 lines Fix for issues #3581, #1481 and #7650: 1. The assumptions in check_node() were too restrictive: - Hardware addresses with universal_local_bit=1 are valid (locally administered). - Many of the tested functions (including uuid.getnode()) may return valid RFC 4122 random node IDs. These are pretty much random 48-bit values with the multicast bit set to 1. 2. _unixdll_getnode() calls _uuid_generate_time(), which may be None on some platforms. The resulting TypeError is now caught. ........
* #7380: Fix some str/bytearray/bytes issues in uuid docs and implementation.Georg Brandl2009-12-191-0/+6
|
* Followup to r75965: replace the test_uuid-specific patch with a generic fixAntoine Pitrou2009-10-301-3/+0
| | | | (other tests may have the same problem).
* Fix a refleak in test_uuid when run with -j.Antoine Pitrou2009-10-301-0/+3
| | | | | The "refleak" was simply the effect of internal buffering in block buffering mode (rather than line buffering when sys.stdout is a terminal)
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-4/+4
|
* Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ fromMark Dickinson2009-01-271-1/+6
| | | | the standard library and tests.
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|
* Merged revisions 57778-58052 via svnmerge fromThomas Wouters2007-09-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r57820 | georg.brandl | 2007-08-31 08:59:27 +0200 (Fri, 31 Aug 2007) | 2 lines Document new shorthand notation for index entries. ........ r57827 | georg.brandl | 2007-08-31 10:47:51 +0200 (Fri, 31 Aug 2007) | 2 lines Fix subitem markup. ........ r57833 | martin.v.loewis | 2007-08-31 12:01:07 +0200 (Fri, 31 Aug 2007) | 1 line Mark registry components as 64-bit on Win64. ........ r57854 | bill.janssen | 2007-08-31 21:02:23 +0200 (Fri, 31 Aug 2007) | 1 line deprecate use of FakeSocket ........ r57855 | bill.janssen | 2007-08-31 21:02:46 +0200 (Fri, 31 Aug 2007) | 1 line remove mentions of socket.ssl in comments ........ r57856 | bill.janssen | 2007-08-31 21:03:31 +0200 (Fri, 31 Aug 2007) | 1 line remove use of non-existent SSLFakeSocket in apparently untested code ........ r57859 | martin.v.loewis | 2007-09-01 08:36:03 +0200 (Sat, 01 Sep 2007) | 3 lines Bug #1737210: Change Manufacturer of Windows installer to PSF. Will backport to 2.5. ........ r57865 | georg.brandl | 2007-09-01 09:51:24 +0200 (Sat, 01 Sep 2007) | 2 lines Fix RST link (backport from Py3k). ........ r57876 | georg.brandl | 2007-09-01 17:49:49 +0200 (Sat, 01 Sep 2007) | 2 lines Document sets' ">" and "<" operations (backport from py3k). ........ r57878 | skip.montanaro | 2007-09-01 19:40:03 +0200 (Sat, 01 Sep 2007) | 4 lines Added a note and examples to explain that re.split does not split on an empty pattern match. (issue 852532). ........ r57879 | walter.doerwald | 2007-09-01 20:18:09 +0200 (Sat, 01 Sep 2007) | 2 lines Fix wrong function names. ........ r57880 | walter.doerwald | 2007-09-01 20:34:05 +0200 (Sat, 01 Sep 2007) | 2 lines Fix typo. ........ r57889 | andrew.kuchling | 2007-09-01 22:31:59 +0200 (Sat, 01 Sep 2007) | 1 line Markup fix ........ r57892 | andrew.kuchling | 2007-09-01 22:43:36 +0200 (Sat, 01 Sep 2007) | 1 line Add various items ........ r57895 | andrew.kuchling | 2007-09-01 23:17:58 +0200 (Sat, 01 Sep 2007) | 1 line Wording change ........ r57896 | andrew.kuchling | 2007-09-01 23:18:31 +0200 (Sat, 01 Sep 2007) | 1 line Add more items ........ r57904 | ronald.oussoren | 2007-09-02 11:46:07 +0200 (Sun, 02 Sep 2007) | 3 lines Macosx: this patch ensures that the value of MACOSX_DEPLOYMENT_TARGET used by the Makefile is also used at configure-time. ........ r57925 | georg.brandl | 2007-09-03 09:16:46 +0200 (Mon, 03 Sep 2007) | 2 lines Fix #883466: don't allow Unicode as arguments to quopri and uu codecs. ........ r57936 | matthias.klose | 2007-09-04 01:33:04 +0200 (Tue, 04 Sep 2007) | 2 lines - Added support for linking the bsddb module against BerkeleyDB 4.6.x. ........ r57954 | mark.summerfield | 2007-09-04 10:16:15 +0200 (Tue, 04 Sep 2007) | 3 lines Added cross-references plus a note about dict & list shallow copying. ........ r57958 | martin.v.loewis | 2007-09-04 11:51:57 +0200 (Tue, 04 Sep 2007) | 3 lines Document that we rely on the OS to release the crypto context. Fixes #1626801. ........ r57960 | martin.v.loewis | 2007-09-04 15:13:14 +0200 (Tue, 04 Sep 2007) | 3 lines Patch #1388440: Add set_completion_display_matches_hook and get_completion_type to readline. ........ r57961 | martin.v.loewis | 2007-09-04 16:19:28 +0200 (Tue, 04 Sep 2007) | 3 lines Patch #1031213: Decode source line in SyntaxErrors back to its original source encoding. Will backport to 2.5. ........ r57972 | matthias.klose | 2007-09-04 20:17:36 +0200 (Tue, 04 Sep 2007) | 3 lines - Makefile.pre.in(buildbottest): Run an optional script pybuildbot.identify to include some information about the build environment. ........ r57973 | matthias.klose | 2007-09-04 21:05:38 +0200 (Tue, 04 Sep 2007) | 2 lines - Makefile.pre.in(buildbottest): Remove whitespace at eol. ........ r57975 | matthias.klose | 2007-09-04 22:46:02 +0200 (Tue, 04 Sep 2007) | 2 lines - Fix libffi configure for hppa*-*-linux* | parisc*-*-linux*. ........ r57980 | bill.janssen | 2007-09-05 02:46:27 +0200 (Wed, 05 Sep 2007) | 1 line SSL certificate distinguished names should be represented by tuples ........ r57985 | martin.v.loewis | 2007-09-05 08:39:17 +0200 (Wed, 05 Sep 2007) | 3 lines Patch #1105: Explain that one needs to build the solution to get dependencies right. ........ r57987 | armin.rigo | 2007-09-05 09:51:21 +0200 (Wed, 05 Sep 2007) | 4 lines PyDict_GetItem() returns a borrowed reference. There are probably a number of places that are open to attacks such as the following one, in bltinmodule.c:min_max(). ........ r57991 | martin.v.loewis | 2007-09-05 13:47:34 +0200 (Wed, 05 Sep 2007) | 3 lines Patch #786737: Allow building in a tree of symlinks pointing to a readonly source. ........ r57993 | georg.brandl | 2007-09-05 15:36:44 +0200 (Wed, 05 Sep 2007) | 2 lines Backport from Py3k: Bug #1684991: explain lookup semantics for __special__ methods (new-style classes only). ........ r58004 | armin.rigo | 2007-09-06 10:30:51 +0200 (Thu, 06 Sep 2007) | 4 lines Patch #1733973 by peaker: ptrace_enter_call() assumes no exception is currently set. This assumption is broken when throwing into a generator. ........ r58006 | armin.rigo | 2007-09-06 11:30:38 +0200 (Thu, 06 Sep 2007) | 4 lines PyDict_GetItem() returns a borrowed reference. This attack is against ceval.c:IMPORT_NAME, which calls an object (__builtin__.__import__) without holding a reference to it. ........ r58013 | georg.brandl | 2007-09-06 16:49:56 +0200 (Thu, 06 Sep 2007) | 2 lines Backport from 3k: #1116: fix reference to old filename. ........ r58021 | thomas.heller | 2007-09-06 22:26:20 +0200 (Thu, 06 Sep 2007) | 1 line Fix typo: c_float represents to C float type. ........ r58022 | skip.montanaro | 2007-09-07 00:29:06 +0200 (Fri, 07 Sep 2007) | 3 lines If this is correct for py3k branch and it's already in the release25-maint branch, seems like it ought to be on the trunk as well. ........ r58023 | gregory.p.smith | 2007-09-07 00:59:59 +0200 (Fri, 07 Sep 2007) | 4 lines Apply the fix from Issue1112 to make this test more robust and keep windows happy. ........ r58031 | brett.cannon | 2007-09-07 05:17:50 +0200 (Fri, 07 Sep 2007) | 4 lines Make uuid1 and uuid4 tests conditional on whether ctypes can be imported; implementation of either function depends on ctypes but uuid as a whole does not. ........ r58032 | brett.cannon | 2007-09-07 06:18:30 +0200 (Fri, 07 Sep 2007) | 6 lines Fix a crasher where Python code managed to infinitely recurse in C code without ever going back out to Python code in PyObject_Call(). Required introducing a static RuntimeError instance so that normalizing an exception there is no reliance on a recursive call that would put the exception system over the recursion check itself. ........ r58034 | thomas.heller | 2007-09-07 08:32:17 +0200 (Fri, 07 Sep 2007) | 1 line Add a 'c_longdouble' type to the ctypes module. ........ r58035 | thomas.heller | 2007-09-07 11:30:40 +0200 (Fri, 07 Sep 2007) | 1 line Remove unneeded #include. ........ r58036 | thomas.heller | 2007-09-07 11:33:24 +0200 (Fri, 07 Sep 2007) | 6 lines Backport from py3k branch: Add a workaround for a strange bug on win64, when _ctypes is compiled with the SDK compiler. This should fix the failing Lib\ctypes\test\test_as_parameter.py test. ........ r58037 | georg.brandl | 2007-09-07 16:14:40 +0200 (Fri, 07 Sep 2007) | 2 lines Fix a wrong indentation for sublists. ........ r58043 | georg.brandl | 2007-09-07 22:10:49 +0200 (Fri, 07 Sep 2007) | 2 lines #1095: ln -f doesn't work portably, fix in Makefile. ........ r58049 | skip.montanaro | 2007-09-08 02:34:17 +0200 (Sat, 08 Sep 2007) | 1 line be explicit about the actual location of the missing file ........
* Make test_uuid passed.Guido van Rossum2007-07-091-29/+29
| | | | | | Change the UUID properties to use @property. Change the UUID API so that .bytes and .bytes_le return, and the corresponding arguments to __init__() require, values of type 'bytes'.
* - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;Guido van Rossum2007-02-111-1/+1
| | | | | | | | | | and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-9/+6
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-49/+49
| | | | (Rough first cut.)