summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2007-11-01 21:15:36 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2007-11-01 21:15:36 (GMT)
commit6d331ca9a49245c5d18d3aa9b0f72cc54f9521c3 (patch)
tree992ddf5e4b0441aa89752986b070da50bea9216a /Lib/bsddb
parentaae141a7513bb6ff44834f9a2459632d7a5f6b00 (diff)
downloadcpython-6d331ca9a49245c5d18d3aa9b0f72cc54f9521c3.zip
cpython-6d331ca9a49245c5d18d3aa9b0f72cc54f9521c3.tar.gz
cpython-6d331ca9a49245c5d18d3aa9b0f72cc54f9521c3.tar.bz2
Undo revision 58533 58534 fixes. Those were a workaround for
a problem introduced by 58385.
Diffstat (limited to 'Lib/bsddb')
-rw-r--r--Lib/bsddb/dbtables.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py
index f793055..babe97c 100644
--- a/Lib/bsddb/dbtables.py
+++ b/Lib/bsddb/dbtables.py
@@ -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