[spambayes-bugs] [ spambayes-Bugs-896366 ] Crashes in the web interface

SourceForge.net noreply at sourceforge.net
Sat Feb 14 23:14:42 EST 2004


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

Category: pop3proxy
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Massimo Ferrario (maxferrario)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crashes in the web interface

Initial Comment:
I am using the last (1.0a9) version of spambayes, and I 
am having some problems with teh web interface.

1)
If I click on the "more statistics" link in the home page I 
get 

=====================================
500 Server error

Traceback (most recent call last):

  File "/usr/lib/python2.2/site-
packages/spambayes/Dibbler.py", line 461, in 
found_terminator
    getattr(plugin, name)(**params)

  File "/usr/lib/python2.2/site-
packages/spambayes/UserInterface.py", line 1016, in 
onStats
    s = Stats.Stats()

  File "/usr/lib/python2.2/site-
packages/spambayes/Stats.py", line 42, in __init__
    self.CalculateStats()

  File "/usr/lib/python2.2/site-
packages/spambayes/Stats.py", line 58, in CalculateStats
    for msg in msginfoDB.db:

  File "/usr/lib/python2.2/shelve.py", line 70, in 
__getitem__
    f = StringIO(self.dict[key])

TypeError: key type must be string

=====================================

2)
If I try to train even a single message I get

=====================================
500 Server error
Traceback (most recent call last):

  File "/usr/lib/python2.2/site-
packages/spambayes/Dibbler.py", line 461, in 
found_terminator
    getattr(plugin, name)(**params)

  File "/usr/lib/python2.2/site-
packages/spambayes/ProxyUI.py", line 386, in onReview
    targetCorpus.takeMessage(id, sourceCorpus)

  File "/usr/lib/python2.2/site-
packages/spambayes/Corpus.py", line 187, in 
takeMessage
    self.addMessage(msg)

  File "/usr/lib/python2.2/site-
packages/spambayes/FileCorpus.py", line 140, in 
addMessage
    Corpus.Corpus.addMessage(self, message)

  File "/usr/lib/python2.2/site-
packages/spambayes/Corpus.py", line 133, in 
addMessage
    obs.onAddMessage(message)

  File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 581, in 
onAddMessage
    self.train(message)

  File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 589, in train
    self.bayes.learn(message.tokenize(), self.is_spam)

  File "/usr/lib/python2.2/site-
packages/spambayes/classifier.py", line 273, in learn
    self._add_msg(wordstream, is_spam)

  File "/usr/lib/python2.2/site-
packages/spambayes/classifier.py", line 375, in _add_msg
    record = self._wordinfoget(word)

  File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 261, in 
_wordinfoget
    r = self.db.get(word)

  File "/usr/lib/python2.2/shelve.py", line 65, in get
    if self.dict.has_key(key):

error: (-30981, 'Unknown error 4294936315')

=====================================

Hint
yesterday I reported a bug that was solved very quickly: 
it has domething to do with my version of python (2.2)
Could also this bug a python version incompatability ?

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

>Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-15 17:14

Message:
Logged In: YES 
user_id=552329

I can't duplicate (2), even with Python 2.2, and it's a dupe of:
[ 833751 ] filter dies after a processing a few emails
<https://sourceforge.net/tracker/?func=detail&atid=498103&aid=833751&group_id=61702>

Unfortunately, this was submitted Nov 1 last year and hasn't
been fixed yet.  Were you using a version of sb before
1.0a9?  If so, which version?  What sort of database are you
using?  pickle?  bsddb?  gdbm?  If you swap to a different
one, does the problem still occur?

(Sorry for all the questions, but I'm not at all sure what
could be causing this, although it certainly looks like a db
problem, and "unknown error" isn't the most helpful
description :)

What happens if you move your dbs aside and use fresh ones?
 Does the error reoccur immediately, after a while, or not
at all?

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

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-15 15:19

Message:
Logged In: YES 
user_id=552329

Drat.  Yes, it is.  It seems that iterating through a shelve
object doesn't work in Python 2.2, which is the problem with
(1).  I'll look into (2) in an hour or so.

When Stats.py v1.6 makes it into anon CVS you can grab that
and drop into into your Lib/site-packages/spambayes folder
and it'll fix (1).  (it's a 4 character change, anyway).

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

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



More information about the Spambayes-bugs mailing list