From: Expo on
Hi guys,

I found an incompatibility in the bsddb library shipped with Python
which is a different version between the win32 release and the linux
release.
This happend using Python 2.6.2 on win32 and OpenSuse 11.2.
To reproduce this problem, create a bsddb file under win32 with this
code:

import shelve

f = shelve.open( "test.bin" )
f["test"] = "test"
f.sync()
f.close()

copy test.bin in the OpenSuse system and try to open it:

import shelve

f = shelve.open( "test.bin" )
print f["test"]

and you get this traceback:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/shelve.py", line 234, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python2.6/shelve.py", line 218, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "/usr/lib/python2.6/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "/usr/lib/python2.6/dbhash.py", line 19, in open
return bsddb.hashopen(file, flag, mode)
File "/usr/lib/python2.6/bsddb/__init__.py", line 361, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- ./test.bin:
unsupported hash version: 9')

I don't know yet if the problem is related to OpenSuse or to the
Python linux distribution.

How I can resolve this ?