Author ocean-city
Recipients
Date 2006-08-17.10:44:28
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch improves workaround clocks with low
resolution yielding duplicate UUIDs. (rev51307)

Currently, windows buildbot is failing due to this bug.
http://www.python.org/dev/buildbot/trunk/x86%20XP%20trunk/builds/1390/step-test/0

Traceback (most recent call last):
  File
"C:\buildbot_py25\trunk.mcintyre-windows\build\lib\test\test_uuid.py",
line 381, in test_uuid1
    equal(len(uuids.keys()), 1000)
AssertionError: 998 != 1000

This happens because on this code (Lib/uuid.py),

   if timestamp == _last_timestamp:
       timestamp += 1
   _last_timestamp = timestamp

if timestamp is same value more than 3 times....

   timestamp == X and _last_timestamp != X:
       timestamp <- X + 1 and _last_timestamp <- X + 1

   timestamp == X: (again)
       timestamp != _last_timestamp, so timestamp is
       still X

   timestamp == X: (again)
       timestamp != _last_timestamp, so timestamp is
       still X (duplicated timestamp!)
       
I fixed this bug with attached patch.

# also fixed probably typo in test_uuid.py
History
Date User Action Args
2007-08-23 15:54:13adminlinkissue1541863 messages
2007-08-23 15:54:13admincreate