summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_recno.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2007-08-23 07:32:27 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2007-08-23 07:32:27 (GMT)
commit361ed15383845bffc017b6a14acfb9da8f63ef73 (patch)
tree808d7729ad334a8b32e31fca6acd1edf010d7398 /Lib/bsddb/test/test_recno.py
parente5a8dc684ce67578f1bac94c1a76fea659d4ace7 (diff)
downloadcpython-361ed15383845bffc017b6a14acfb9da8f63ef73.zip
cpython-361ed15383845bffc017b6a14acfb9da8f63ef73.tar.gz
cpython-361ed15383845bffc017b6a14acfb9da8f63ef73.tar.bz2
Require strict bytes objects for all bsddb.db input values.
Diffstat (limited to 'Lib/bsddb/test/test_recno.py')
-rw-r--r--Lib/bsddb/test/test_recno.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py
index 3da5006..25482d5 100644
--- a/Lib/bsddb/test/test_recno.py
+++ b/Lib/bsddb/test/test_recno.py
@@ -41,7 +41,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
for x in letters:
- recno = d.append(x * 60)
+ recno = d.append(bytes(x) * 60)
assert type(recno) == type(0)
assert recno >= 1
if verbose:
@@ -219,7 +219,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
data = "The quick brown fox jumped over the lazy dog".split()
for datum in data:
- d.append(datum)
+ d.append(bytes(datum))
d.sync()
d.close()
@@ -238,8 +238,8 @@ class SimpleRecnoTestCase(unittest.TestCase):
d.set_re_source(source)
d.open(self.filename, db.DB_RECNO)
- d[3] = 'reddish-brown'
- d[8] = 'comatose'
+ d[3] = b'reddish-brown'
+ d[8] = b'comatose'
d.sync()
d.close()
@@ -261,12 +261,12 @@ class SimpleRecnoTestCase(unittest.TestCase):
d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
for x in letters:
- d.append(x * 35) # These will be padded
+ d.append(bytes(x) * 35) # These will be padded
- d.append('.' * 40) # this one will be exact
+ d.append(b'.' * 40) # this one will be exact
try: # this one will fail
- d.append('bad' * 20)
+ d.append(b'bad' * 20)
except db.DBInvalidArgError as val:
assert val.args[0] == db.EINVAL
if verbose: print(val)