diff options
Diffstat (limited to 'Lib/bsddb/dbtables.py')
-rw-r--r-- | Lib/bsddb/dbtables.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py index 85a13ff72a..06fcf8aacf 100644 --- a/Lib/bsddb/dbtables.py +++ b/Lib/bsddb/dbtables.py @@ -362,12 +362,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 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 range(_rowid_str_len): - blist.append(random.randint(1,255)) + blist.append(random.randint(0,255)) newid = bytes(blist) # Guarantee uniqueness by adding this key to the database |