bsddb code updated to version 4.7.3pre2. This code is the same than
Python 2.6 one, since the intention is to keep an unified 2.x/3.x
codebase.

The Python code is automatically translated using "2to3". Please, do not
update this code in Python 3.0 by hand. Update the 2.6 one and then do
"2to3".
diff --git a/Lib/bsddb/dbrecio.py b/Lib/bsddb/dbrecio.py
index 6036b3a..932ce2e 100644
--- a/Lib/bsddb/dbrecio.py
+++ b/Lib/bsddb/dbrecio.py
@@ -29,6 +29,7 @@
 """
 
 import errno
+import string
 
 class DBRecIO:
     def __init__(self, db, key, txn=None):
@@ -38,6 +39,7 @@
         self.len = None
         self.pos = 0
         self.closed = 0
+        self.softspace = 0
 
     def close(self):
         if not self.closed:
@@ -82,9 +84,9 @@
         if self.closed:
             raise ValueError, "I/O operation on closed file"
         if self.buflist:
-            self.buf = self.buf + ''.join(self.buflist)
+            self.buf = self.buf + string.joinfields(self.buflist, '')
             self.buflist = []
-        i = self.buf.find('\n', self.pos)
+        i = string.find(self.buf, '\n', self.pos)
         if i < 0:
             newpos = self.len
         else:
@@ -133,7 +135,7 @@
         self.pos = newpos
 
     def writelines(self, list):
-        self.write(''.join(list))
+        self.write(string.joinfields(list, ''))
 
     def flush(self):
         if self.closed:
@@ -158,14 +160,14 @@
     if f.getvalue() != text:
         raise RuntimeError, 'write failed'
     length = f.tell()
-    print('File length =', length)
+    print 'File length =', length
     f.seek(len(lines[0]))
     f.write(lines[1])
     f.seek(0)
-    print('First line =', repr(f.readline()))
+    print 'First line =', repr(f.readline())
     here = f.tell()
     line = f.readline()
-    print('Second line =', repr(line))
+    print 'Second line =', repr(line)
     f.seek(-len(line), 1)
     line2 = f.read(len(line))
     if line != line2:
@@ -177,8 +179,8 @@
     line2 = f.read()
     if line != line2:
         raise RuntimeError, 'bad result after seek back from EOF'
-    print('Read', len(list), 'more lines')
-    print('File length =', f.tell())
+    print 'Read', len(list), 'more lines'
+    print 'File length =', f.tell()
     if f.tell() != length:
         raise RuntimeError, 'bad length'
     f.close()