[spambayes-bugs] [ spambayes-Bugs-832070 ] bsddb.error: (22, 'Invalid argument')

SourceForge.net noreply at sourceforge.net
Mon Dec 8 20:17:35 EST 2003


Bugs item #832070, was opened at 2003-10-29 13:28
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=832070&group_id=61702

Category: pop3proxy
Group: Source code 1.0a6
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Stephen Boulet (spboulet)
Assigned to: Nobody/Anonymous (nobody)
Summary: bsddb.error: (22, 'Invalid argument')

Initial Comment:
I'm not able to start sb_server any more from its
directory (though it will start from an empty directory):

$ Traceback (most recent call last):
  File "/usr/bin/sb_server.py", line 101, in ?
    import spambayes.message
  File
"/usr/lib/python2.2/site-packages/spambayes/message.py",
line 149, in ?
    msginfoDB = MessageInfoDB(message_info_db_name)
  File
"/usr/lib/python2.2/site-packages/spambayes/message.py",
line 114, in __init__
    self.dbm = dbmstorage.open(self.db_name, self.mode)
  File
"/usr/lib/python2.2/site-packages/spambayes/dbmstorage.py",
line 53, in open
    return f(*args)
  File
"/usr/lib/python2.2/site-packages/spambayes/dbmstorage.py",
line 36, in open_best
    return f(*args)
  File
"/usr/lib/python2.2/site-packages/spambayes/dbmstorage.py",
line 18, in open_dbhash
    return bsddb.hashopen(*args)
bsddb.error: (22, 'Invalid argument')

----------------------------------------------------------------------

>Comment By: Tony Meyer (anadelonbrin)
Date: 2003-12-09 14:17

Message:
Logged In: YES 
user_id=552329

What you've said is correct.  Basically 1.0a7 switched from 
using "open_best" (which knew not to use open_dbhash on 
Windoes with Python 2.2) to figuring out which function to 
use from the db itself (which is good for other reasons).  
However, it bypassed the intelligence to check the 
OS/Python version.  The fix I checked in is a permanent 
solution to this (it reintroduces the checks).  Using the 
1.0a6 dbmstorage.py should be fine until the next release - 
if you don't change db format, then the change will have no 
effect anyway.

BTW, Python 2.3 includes bsddb, so you don't need an 
installer.  But spambayes *should* work with 2.2, so you 
don't have to upgrade if you don't want to.  OTOH, the 
about to be released 2.3.3 has some important fixes that I 
don't think are going to be backported to 2.2, so maybe you 
should...

----------------------------------------------------------------------

Comment By: Bruce Zollars (brucedog)
Date: 2003-12-05 15:23

Message:
Logged In: YES 
user_id=924285

I have had this problem on Win98 as well, although the error
now occurs on line 20 of dbmstorage.py. (The updated code
may have two inserted lines?)

The docstring for open_dbhash reads 
"""Open a bsddb hash.  Don't use this on Windows, unless
Python 2.3 or 
    greater is used, in which case bsddb3 is actually named
bsddb."""

I am on Windows, and using Python 2.2, so I should be using
the immediately preceding function, open_db3hash.  The
version of dbmstorage.py that came with Spambayes 1.0a6 had
no problem with this, so the new code is either failing to
recognize my OS, failing to recognize my Python version, or
failing to recognize my name for bsddb.

I am just teaching myself Python, so that I can understand
the Spambayes project.  I can read just enough code to
figure out the above, but nowhere near enough to figure out why.

Okay, I could move to Python 2.3, but there is not yet a
binary installer version of bsddb for Python 2.3 on Windows.
 What I have done is this: I have installed Spambayes 1.0a7,
then copied the dbmstorage.py script from the 1.0a6 version
into the site-packages/spambayes directory.  Working great.

Will try to learn enough more Python in the next few hours
to come up with a more permanent solution. (snicker)

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-11-26 14:15

Message:
Logged In: YES 
user_id=552329

I believe I have found the problem here, and checked in a fix 
(dbmstorage.py 1.10).

You should be able to apply that change to your copy of 
dbmstorage.py, or use Python 2.3, or a pickle, until the next 
release.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-11-26 13:59

Message:
Logged In: YES 
user_id=552329

My wife's system (Win98) gets this now, too.  I think it may 
be related to the change in the storage.open_storage code, 
although I'm not certain.  It does appear to be a bug, 
though.  I'll look into this more as soon as I get a chance.

----------------------------------------------------------------------

Comment By: Stephen Boulet (spboulet)
Date: 2003-11-01 08:51

Message:
Logged In: YES 
user_id=6988

This is a wild guess, but I wonder if my problem could be
related to changing my linux headers version to 2.4.21 from
2.4.19, recompiling glibc, but not recompiling python.

Stephen

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=832070&group_id=61702



More information about the Spambayes-bugs mailing list