]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Undo revision 58533 58534 fixes. Those were a workaround for
authorGregory P. Smith <greg@mad-scientist.com>
Thu, 1 Nov 2007 21:15:36 +0000 (21:15 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Thu, 1 Nov 2007 21:15:36 +0000 (21:15 +0000)
a problem introduced by 58385.

Lib/bsddb/dbtables.py

index f7930556cb2f63fd7d0797492a1677849beeb257..babe97c5fd99048dbdd7496271846baf1bdf61af 100644 (file)
@@ -360,12 +360,11 @@ class bsdTableDB :
         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