Serious problem with Shelve

Tim Churches tchur at
Sun Aug 17 22:27:45 CEST 2003

On Mon, 2003-08-18 at 03:04, Rami A. Kishek wrote:
> Hi - this mysterious behavior with shelve is just about to kill me.  I
> hope someone here can shed some light.  First of all, I have this piece
> of code which uses shelve to save instances of some class I define.  It
> works perfectly on an old machine (PII-400) running Python 2.2.1 under
> RedHat Linux 8.0.  When I try to run it under Python for windows ME on a
> P-4 1.4 GHz, however, it keeps crashing on reading from the shelved file
> the second time I try to access it.  The Windows machine was originally
> running python 1.5.2, so I upgraded to 2.2.3, thinking that would solve
> the problem, but it didn't!

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

Tim C

PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere
or at
Key fingerprint = 8C22 BF76 33BA B3B5 1D5B  EB37 7891 46A9 EAF9 93D0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Python-list mailing list