[spambayes-dev] Openning a db

Remi Ricard papaDoc at videotron.ca
Mon Apr 26 21:31:39 EDT 2004


Hi,

I'm having a problem:

When I create a db from scratch using the following command

sb_mboxtrain -d ./hammie.db -g ham.mbox -s spam.mbox

The db is created with the dbm_type="best"
in the dbmstorage.py. This will call the function 
dbmstorage.py: open_db3hash

but when I try to train again with the same command line
(I know this does nothing to the database but continue reading)
sb_mboxtrain -d ./hammie.db -g ham.mbox -s spam.mbox

Then I get the error message:
-------------------
 File "/gmc/logiciels/spambayes/spambayes/spambayes/hammie.py", line
266, in open
    return Hammie(storage.open_storage(filename, useDB, mode))
  File "/gmc/logiciels/spambayes/spambayes/spambayes/storage.py", line
680, in open_storage
    return klass(data_source_name, mode)
  File "/gmc/logiciels/spambayes/spambayes/spambayes/storage.py", line
164, in __init__
    self.load()
  File "/gmc/logiciels/spambayes/spambayes/spambayes/storage.py", line
189, in load
    self.dbm = dbmstorage.open(self.db_name, self.mode)
  File "/gmc/logiciels/spambayes/spambayes/spambayes/dbmstorage.py",
line 75, in open
    return f(db_name, mode)
  File "/gmc/logiciels/spambayes/spambayes/spambayes/dbmstorage.py",
line 22, in open_dbhash
    return bsddb.hashopen(*args)
  File "/usr/local/lib/python2.3/bsddb/__init__.py", line 193, in
hashopen
    d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- ./hammid.db:
unsupported hash version: 8')
------------------------

since the db is openned with the dbhash
by calling the function
dbmstorage.py: open_dbhash


To solve my problem I'm imposing the dbm_type to be what I want but
I don't think this can be a fix ;-). So this is all yours to solve....

I'm running on RedHat 9 with python2.3 compiled from source.
the whichdb is really the one from the python2.3
(this was found with 
 echo test | strace -tt -f -o trace.txt python sb_mboxtrain.py -d
hammid.db -g ham.mbox -s spam.mbox)

Remi

-- 
Remi Ricard <papaDoc at videotron.ca>




More information about the spambayes-dev mailing list