Backing up objects in db file

Skip Montanaro skip at pobox.com
Thu Mar 4 10:35:48 EST 2004


    >> Take a look at db2pickle.py and pickle2db.py in the Tools/scripts
    >> directory of the source distribution.  I have no idea if they are
    >> included in the Windows installer.  Here's the doc string from
    >> db2pickle.py:

    Chris> Skip - this would be fine if only the db file changed between
    Chris> releases of libdb.  Unfortunately, it appears the pickle format
    Chris> also sometimes changes, at least this was my experience.  So it's
    Chris> not a portable text format.

I've yet to see a situation where an older pickle file couldn't be read by a
newer pickle version.  One goal of the pickle format was precisely that it
should be version-independent.  You might not be able to go the other way
(dump in newer, load in older), but even then you should be able to force
the dump to be made in the plain text (version 0) format.

The one situation I can think of where an older pickle would be unreadable
with a new version of pickle is if you dumped an instance in the older
version whose class could not be found in the newer version.

Skip





More information about the Python-list mailing list