Training... 500 Server error Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/spambayes/Dibbler.py", line 476, in found_terminator getattr(plugin, name)(**params) File "/usr/local/lib/python2.6/dist-packages/spambayes/ProxyUI.py", line 302, in onReview self.flush() File "/usr/local/lib/python2.6/dist-packages/spambayes/Dibbler.py", line 712, in flush return self._handler.flush() File "/usr/local/lib/python2.6/dist-packages/spambayes/Dibbler.py", line 221, in flush while (self.producer_fifo or self.ac_out_buffer) and not self._closed: File "/usr/lib/python2.6/asyncore.py", line 391, in __getattr__ return getattr(self.socket, attr) AttributeError: '_socketobject' object has no attribute 'ac_out_buffer' This is Spambayes 1.1a4 installed on a fresh install of Ubuntu 9.04. Could someone explain to me what I broke? Thanks, Eric
Eric> File "/usr/lib/python2.6/asyncore.py", line 391, in __getattr__ Eric> return getattr(self.socket, attr) Eric> AttributeError: '_socketobject' object has no attribute Eric> 'ac_out_buffer' Eric> This is Spambayes 1.1a4 installed on a fresh install of Ubuntu Eric> 9.04. Eric> Could someone explain to me what I broke? You didn't break anything. The ground under your feet shifted. In Python 2.6 someone reworked the asyncore and asynchat modules in backwards-incompatible ways. One of the things that was done was to remove that ac_out_buffer attribute. Unfortunately, it looks like Dibbler.py uses it. This whole episode caused quite a stir on python-dev when it came to light. (Not enough, apparently, to restore the code in 2.7 though.) I'm not certain of the correct fix, not being very familiar with the changes in Python 2.6 or with the Dibbler module. Here are a couple things you might try: * Install Python 2.5 on your system and use that instead of Python 2.6. * Modify your copy of Dibbler.py to remove the (sole) reference to self.ac_out_buffer. Change: while (self.producer_fifo or self.ac_out_buffer) and not self._closed: to acob = (hasattr(self, "ac_out_buffer") and self.ac_out_buffer or True) while (self.producer_fifo or acob) and not self._closed: * Staring at the thread on python-dev suggests that this might work as well: while self.writable() and not self._closed: I'm pretty sure switching to Python 2.5 will work, though that may cause your system some consternation if you have other packages which require 2.6 and you can't install both of them at the same time (I suspect that will be ok). I'm a bit less sure about the second and third changes, but I think they should work. Clearly the third is clearer and likely more correct as well. Full details on the change from python-dev: http://news.gmane.org/find-root.php?message_id=%3c48EE2C77.1050809%40palladi... Richie, care to chime in? -- Skip Montanaro - skip@pobox.com - http://www.smontanaro.net/ when i wake up with a heart rate below 40, i head right for the espresso machine. -- chaos @ forums.usms.org
[Skip]
Richie, care to chime in?
Eric, Skip's advice to use Python 2.5 is your best bet. There's no reason you can't install it alongside other versions, and I believe there's an option in the installer to not change your file associations etc. (and if there isn't, you can always reinstall the later version afterwards). Skip, I'll have a look at your proposed fixes this week, but I don't have time tonight - it's bed time here. 8-) -- Richie Hindle richie@entrian.com
On 09-06-17 04:00 PM, Richie Hindle wrote:
[Skip]
Richie, care to chime in?
Eric, Skip's advice to use Python 2.5 is your best bet. There's no reason you can't install it alongside other versions, and I believe there's an option in the installer to not change your file associations etc. (and if there isn't, you can always reinstall the later version afterwards).
Skip, I'll have a look at your proposed fixes this week, but I don't have time tonight - it's bed time here. 8-)
I checked Synaptic to what in regards to Python was installed. It says that Python 2.5 and 2.6 are installed. Is it possible to specify in the command line which version of Python to use? Thanks, Eric
Eric> I checked Synaptic to what in regards to Python was installed. It Eric> says that Python 2.5 and 2.6 are installed. Eric> Is it possible to specify in the command line which version of Eric> Python to use? I sort of assume you installed SpamBayes something like this: python setup.py install You can refrence Python 2.5 directly: python2.5 setup.py install SpamBayes will then be run using Python 2.5. If you install SpamBayes using Synaptics, I don't know how to tell it to use Python 2.5. Skip
On 09-06-17 07:06 PM, skip@pobox.com wrote:
Eric> I checked Synaptic to what in regards to Python was installed. It Eric> says that Python 2.5 and 2.6 are installed.
Eric> Is it possible to specify in the command line which version of Eric> Python to use?
I sort of assume you installed SpamBayes something like this:
python setup.py install
You can refrence Python 2.5 directly:
python2.5 setup.py install
SpamBayes will then be run using Python 2.5. If you install SpamBayes using Synaptics, I don't know how to tell it to use Python 2.5.
Skip
.
I tried your suggestion of using "python2.5 setup.py install". I launch the proxy this way, "python2.5 sb_server.py" I am no longer getting an error message when training, but I am now getting this error message when I am using the configuration pages... 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 "./spambayes/scripts/sb_server.py", line 1007, in _recreateState prepare() File "./spambayes/scripts/sb_server.py", line 1022, in prepare state.prepare(can_stop) File "./spambayes/scripts/sb_server.py", line 822, in prepare self.createWorkers() File "./spambayes/scripts/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' Is this something different or part of the same problem as before? Thanks for all the suggestions, Eric
Eric> I tried your suggestion of using "python2.5 setup.py install". Eric> I launch the proxy this way, "python2.5 sb_server.py" That works, but you're running SpamBayes from your source repository, not from the installed location. Try running /usr/local/bin/sb_server.py instead, or if /usr/local/bin is in your PATH, simply sb_server.py Eric> I am no longer getting an error message when training, but I am now Eric> getting this error message when I am using the configuration pages... Eric> 500 Server error ... Eric> File "./spambayes/scripts/sb_server.py", line 889, in createWorkers Eric> self.stats = Stats.Stats(options, self.mdb) Eric> File "/usr/lib/python2.5/site-packages/spambayes/Stats.py", line 60, Eric> in __init__ Eric> self.from_date = self.messageinfo_db.get_statistics_start_date() Eric> AttributeError: 'NoneType' object has no attribute Eric> 'get_statistics_start_date' Eric> Is this something different or part of the same problem as before? This is something new. Are you trying to train before you're done configuring the setup? I wouldn't think you'd be creating a Stats object (the beginning of what I quoted) at that point. I'm not terribly familiar with the POP3 proxy (sb_server) anymore, and it will probably be a day or two before I have a chance to take a look at the problem. In the meantime, double-check that you've completely configured the server before trying to do any training. Skip
On 09-06-18 03:42 AM, skip@pobox.com wrote:
Eric> I tried your suggestion of using "python2.5 setup.py install".
Eric> I launch the proxy this way, "python2.5 sb_server.py"
That works, but you're running SpamBayes from your source repository, not from the installed location. Try running
/usr/local/bin/sb_server.py
instead, or if /usr/local/bin is in your PATH, simply
sb_server.py
Eric> I am no longer getting an error message when training, but I am now Eric> getting this error message when I am using the configuration pages...
Eric> 500 Server error ... Eric> File "./spambayes/scripts/sb_server.py", line 889, in createWorkers Eric> self.stats = Stats.Stats(options, self.mdb)
Eric> File "/usr/lib/python2.5/site-packages/spambayes/Stats.py", line 60, Eric> in __init__ Eric> self.from_date = self.messageinfo_db.get_statistics_start_date()
Eric> AttributeError: 'NoneType' object has no attribute Eric> 'get_statistics_start_date'
Eric> Is this something different or part of the same problem as before?
This is something new. Are you trying to train before you're done configuring the setup? I wouldn't think you'd be creating a Stats object (the beginning of what I quoted) at that point.
I'm not terribly familiar with the POP3 proxy (sb_server) anymore, and it will probably be a day or two before I have a chance to take a look at the problem. In the meantime, double-check that you've completely configured the server before trying to do any training.
Skip
.
Thanks for letting me know about the proper path to run the server from, I'm still getting used to Linux... What was happening when I was getting that error, was that I was trying to configure the proxy and when I would tell it to save the settings, that error message would show up and then I would have to restart the proxy to be able to do the rest of the configuration. The funny part of the proxy crashing during configuration is that when I restart it and go to check the settings, all the settings I wanted, were in fact saved. Anyway, I do still get the error message... 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/local/bin/sb_server.py", line 1007, in _recreateState prepare() File "/usr/local/bin/sb_server.py", line 1022, in prepare state.prepare(can_stop) File "/usr/local/bin/sb_server.py", line 822, in prepare self.createWorkers() File "/usr/local/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' ...whenever the save button is pressed on any of the 3 configuration pages. Otherwise the proxy works fine and no problem with the "review" page or when training. I must say that this spam filter is the best one that I have ever come across, I just wish the others could be 25% as good. With training on as few as 12 ham and 12 spam, I am already getting as few as 0.3% unsure. Thanks, Eric
participants (3)
-
Eric Johnson -
Richie Hindle -
skip@pobox.com