[Spambayes] Upgrading python

Skip Montanaro skip at pobox.com
Wed Oct 22 18:08:44 EDT 2003


    >> If you have a file created by gdbm you should see something like
    >> % file gdbm.db
    >> gdbm.db: GNU dbm 1.x or ndbm database, little endian

    Kristian> Yes, this is what I get:

    Kristian> $ file hammie.db
    Kristian> hammie.db: GNU dbm 1.x or ndbm database, little endian

    Kristian> Let me know if I should do more tests.

That explains things perfectly.  I would be curious to know if this works
for you from a Python (2.3) prompt:

    import gdbm
    db = gdbm.open("hammie.db")
    print len(db)
    db.close()

When you were running Mandrake 9.1, you apparently didn't have the proper
RPMs installed to build and/or use the bsddb module from Python 2.2.
Accordingly, when SpamBayes created your database it used the gdbm module.
After upgrading to 9.2, bsddb became available from Python 2.3.  Since bsddb
is the preferred way to open such files in SpamBayes, it tried to use that
but failed, even though it might have successfully opened the file using
gdbm.

I think we can probably fix this - let the format of the file tell us how to
open preexisting databases instead of blindly assuming a static ordered list
of preferred modules.  Tony, I think you've worked on the storage code the
most recently.  Does a simple fix leap out at you?

Skip



More information about the Spambayes mailing list