[spambayes-bugs] [ spambayes-Bugs-1819910 ] AttributeError, get_statistics_start_date
SourceForge.net
noreply at sourceforge.net
Sat Feb 2 17:11:00 CET 2008
Bugs item #1819910, was opened at 2007-10-25 06:59
Message generated for change (Comment added) made by heres4
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1819910&group_id=61702
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: pop3proxy
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter Bengtsson (peterbe)
Assigned to: Nobody/Anonymous (nobody)
Summary: AttributeError, get_statistics_start_date
Initial Comment:
python2.5 in Ubuntu I start sb_server and just enter the remove server and remote proxy and press the Save button. Then I get this error:
500 Server error
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 476, in found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.5/site-packages/spambayes/UserInterface.py", line 888, in onChangeopts
self.reReadOptions()
File "/usr/lib/python2.5/site-packages/spambayes/ProxyUI.py", line 587, in reReadOptions
state = self.state_recreator()
File "/usr/bin/sb_server.py", line 1007, in _recreateState
prepare()
File "/usr/bin/sb_server.py", line 1022, in prepare
state.prepare(can_stop)
File "/usr/bin/sb_server.py", line 822, in prepare
self.createWorkers()
File "/usr/bin/sb_server.py", line 889, in createWorkers
self.stats = Stats.Stats(options, self.mdb)
File "/usr/lib/python2.5/site-packages/spambayes/Stats.py", line 60, in __init__
self.from_date = self.messageinfo_db.get_statistics_start_date()
AttributeError: 'NoneType' object has no attribute 'get_statistics_start_date'
----------------------------------------------------------------------
Comment By: Daniel Miller (heres4)
Date: 2008-02-02 11:11
Message:
Logged In: YES
user_id=1000620
Originator: NO
Wow, this is an ugly one (quote from spambayes.message.Message: This whole
message info database thing is a real mess). Anyway, the fix is to do this
in State.close() method of sb_server.py:
spambayes.message.Message().message_info_db = None
instead of this:
spambayes.message.Message.message_info_db = None
Notice the difference? spambayes.message.Message.message_info_db should be
a class attribute, but it's a property (see the Message class for the messy
details). The latter statement creates a class attribute, which blows away
the property object. At that point the logic to create a new
message_info_db is hidden forever in Message._get_class_message_info_db()
which will never be called again. It would probably be good to at least
make a set of public class methods on Message for managing the
message_info_db so we don't need to use such a hackish way to discard the
old one and/or create a new one.
----------------------------------------------------------------------
Comment By: Head Geek (chadaaronnelson)
Date: 2008-01-27 19:18
Message:
Logged In: YES
user_id=1993365
Originator: NO
I ran into this today too. I tracked it down to sbserver.py, the close()
function of the State class:
if self.mdb is not None:
self.mdb.store()
self.mdb.close()
self.mdb = None
spambayes.message.Message.message_info_db = None
Commenting out the "self.mdb.close()" and
"spambayes.message.Message.message_info_db = None" lines fixes the problem.
I'm not certain that the close line has to be removed yet, though I suspect
it does.
How do we get this fixed in the next release?
----------------------------------------------------------------------
Comment By: Peter Bengtsson (peterbe)
Date: 2007-10-25 07:09
Message:
Logged In: YES
user_id=208160
Originator: YES
Tried to downgrade to 1.1a3 but problem persists :(
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1819910&group_id=61702
More information about the Spambayes-bugs
mailing list