shelve portability problem

Skip Montanaro skip at mojam.com
Thu Jul 29 14:55:18 EDT 1999


    nadim> I'm having a problem moving a Python shelve ODB from Solaris to
    nadim> Linux.
	...
    nadim> What seems to be happening is that Solaris is storing the data in
    nadim> an old DBM style database, and Linux is using a new gdbm format.

    nadim> I know I can work around this by using pickle and a specific DB
    nadim> module, but does anyone know how I can get it working using the
    nadim> shelve module?

Make sure the same database libraries are available on the two platforms.
Apparently, gdbm isn't available on your Solaris system.  Shelve uses
anydbm, which runs through a canned list of potential modules.  It uses the
first one it finds.  It might be possible to also fiddle the order of the
anydbm._names list to guarantee whatever you have in common on the two
platforms is found first.

Skip Montanaro	| http://www.mojam.com/
skip at mojam.com  | http://www.musi-cal.com/~skip/
847-475-3758




More information about the Python-list mailing list