Serious problem with Shelve

Rami A. Kishek ramiak2000 at yahoo.com
Tue Aug 19 01:57:36 EDT 2003


Well - I installed Python 2.3, but it still doesn't.  My program now
crashes on the first pass.  After deleting the old databases and
creating new ones, I opened them for read and this is what I get:

    self.revs = shelve.open(os.path.join(tgtdir, dbfn))
  File "D:\PROGRAMS\PYTHON23\lib\shelve.py", line 231, in open
    return DbfilenameShelf(filename, flag, protocol, writeback, binary)
  File "D:\PROGRAMS\PYTHON23\lib\shelve.py", line 212, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol,
writeback, binary)
  File "D:\PROGRAMS\PYTHON23\lib\anydbm.py", line 82, in open
    mod = __import__(result)
ImportError: No module named bsddb185


I will try enclosing that import bsddb185 in anydbm.py in try: except:,
though I hate messing around with source files, and there may be many
more such problems.  Python developers, be aware of this glitch.


Tim Churches wrote:
> 
> > of code which uses shelve to save instances of some class I define.  
> > it keeps crashing on reading from the shelved file
> > the second time I try to access it.  
> 
> In Python 2.2 or earlier, by default, shelve uses the Berkeley database
> 1.8 libraries, which we have found to be seriously broken on all
> platforms we have tried them on. Upgrading to a later version of the
> Berkeley libraries and using the pybsddb module fixed the mysterious,
> inconsistent crashes and segfaults we were seeing with shelve (and which
> were also driving us crazy). The easiest way to upgrade is to move to
> Python 2.3, which includes these  later versions, but you can also
> easily install them under earlier version of Python (at least under
> 2.2).
> --




More information about the Python-list mailing list