bsddb version mysmatch between win32 and linux

Discussion in 'Python' started by Expo, Feb 13, 2010.

  1. Expo

    Expo Guest

    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 ?
    Expo, Feb 13, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neville C. Dempsey
    Replies:
    0
    Views:
    359
    Neville C. Dempsey
    Jun 12, 2005
  2. Skip Montanaro
    Replies:
    1
    Views:
    384
    Bengt Richter
    Jun 26, 2005
  3. leasun

    bsddb version?

    leasun, Oct 23, 2005, in forum: Python
    Replies:
    1
    Views:
    350
    Peter Hansen
    Oct 23, 2005
  4. V Green
    Replies:
    0
    Views:
    825
    V Green
    Feb 5, 2008
  5. PA Bear [MS MVP]
    Replies:
    0
    Views:
    930
    PA Bear [MS MVP]
    Feb 5, 2008
Loading...

Share This Page