[Python-checkins] r58758 - python/trunk/Lib/bsddb/dbtables.py

gregory.p.smith python-checkins at python.org
Thu Nov 1 22:15:36 CET 2007


Author: gregory.p.smith
Date: Thu Nov  1 22:15:36 2007
New Revision: 58758

Modified:
   python/trunk/Lib/bsddb/dbtables.py
Log:
Undo revision 58533 58534 fixes.  Those were a workaround for
a problem introduced by 58385.


Modified: python/trunk/Lib/bsddb/dbtables.py
==============================================================================
--- python/trunk/Lib/bsddb/dbtables.py	(original)
+++ python/trunk/Lib/bsddb/dbtables.py	Thu Nov  1 22:15:36 2007
@@ -360,12 +360,11 @@
         unique = 0
         while not unique:
             # Generate a random 64-bit row ID string
-            # (note: this code has <64 bits of randomness
+            # (note: might have <64 bits of true randomness
             # but it's plenty for our database id needs!)
-            # We must ensure that no null bytes are in the id value.
             blist = []
             for x in xrange(_rowid_str_len):
-                blist.append(random.randint(1,255))
+                blist.append(random.randint(0,255))
             newid = struct.pack('B'*_rowid_str_len, *blist)
 
             # Guarantee uniqueness by adding this key to the database


More information about the Python-checkins mailing list