Re: [Spambayes] Bug solution for Spambayes.
Johann> I have some problems with my sourceforge account, therefore I Johann> contact you this way. Johann, I am on holiday, just sneaking a peek at my email. Based on your traceback, I went ahead and finished off a change suggested recently which should solve the problem. I incorporated the Python 2.5 versions of the asynchat and asyncore modules into SpamBayes as the API of those modules changed in incompatible ways in Python 2.6. I made a new source release of SpamBayes, 1.1b1. Please give that a try. If you continue to have problems, please send an email to spambayes-dev@python.org. I won't be checking mail much in the next several days. -- Skip Montanaro - skip@pobox.com - http://www.smontanaro.net/ Johann> As you being an active developper of SpamBayes I have some bug Johann> information and the solution to you. I'm trying to run Spambayes with Johann> ubuntu1010 and use python2.6. When trying to train spam by the web Johann> interface I get the following exception: Johann> --------------------------------------------------------------------------------------------- Johann> Traceback (most recent call last): Johann> File "/usr/lib/python2.6/dist-packages/spambayes/Dibbler.py", line Johann> 470, in found_terminator Johann> getattr(plugin, name)(**params) Johann> File "/usr/lib/python2.6/dist-packages/spambayes/ProxyUI.py", line Johann> 399, in onReview Johann> self.flush() Johann> File "/usr/lib/python2.6/dist-packages/spambayes/Dibbler.py", line Johann> 706, in flush Johann> return self._handler.flush() Johann> File "/usr/lib/python2.6/dist-packages/spambayes/Dibbler.py", line Johann> 221, in flush Johann> while (self.producer_fifo or self.ac_out_buffer) and not self._closed: Johann> File "/usr/lib/python2.6/asyncore.py", line 406, in __getattr__ Johann> %(self.__class__.__name__, attr)) Johann> AttributeError: _HTTPHandler instance has no attribute 'ac_out_buffer' Johann> --------------------------------------------------------------------------------------------- Johann> After some reading in the internet I found that the problem was python2.6: Johann> http://mail.python.org/pipermail/spambayes/2011-January/022943.html Johann> This Thread shows the solution. Johann> http://mail.python.org/pipermail/spambayes/2009-June/022430.html Johann> After I have replaced Johann> while (self.producer_fifo or self.ac_out_buffer) and not self._closed Johann> with Johann> while self.writable() and not self._closed Johann> Spambayes works fine again for me. I can confirm this solution solves my Johann> problems. Johann> I would strongly recomend to do include this changes to the source archive. Johann> Thank you very much for developping this great spam filter. Johann> Regards, Johann> Johann
On 02/25/2011 2:18 PM, skip@pobox.com wrote:
Johann> I have some problems with my sourceforge account, therefore I Johann> contact you this way.
Johann,
I am on holiday, just sneaking a peek at my email. Based on your traceback, I went ahead and finished off a change suggested recently which should solve the problem. I incorporated the Python 2.5 versions of the asynchat and asyncore modules into SpamBayes as the API of those modules changed in incompatible ways in Python 2.6.
I made a new source release of SpamBayes, 1.1b1. Please give that a try. If you continue to have problems, please send an email to spambayes-dev@python.org. I won't be checking mail much in the next several days.
I tried the new version today, building a .deb with python-stdeb on Debian Wheezy. Although the build happens and the correct dependencies are applied, this is what I got when I tried to run it. Traceback (most recent call last): File "/usr/bin/sb_server.py", line 96, in<module> from spambayes import Dibbler File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 186, in<module> from spambayes import asyncore, asynchat ImportError: cannot import name asyncore Dale
Dale> Although the build happens and the correct dependencies are Dale> applied, this is what I got when I tried to run it. Dale> Traceback (most recent call last): Dale> File "/usr/bin/sb_server.py", line 96, in<module> Dale> from spambayes import Dibbler Dale> File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 186, in<module> Dale> from spambayes import asyncore, asynchat Dale> ImportError: cannot import name asyncore Hmmm... Looks like asyncore (and probably asynchat) probably didn't make it into the distribution. I maybe have a messed up manifest. I'll take a look. Skip
On 03/08/2011 7:28 PM, skip@pobox.com wrote:
Dale> Although the build happens and the correct dependencies are Dale> applied, this is what I got when I tried to run it.
Dale> Traceback (most recent call last): Dale> File "/usr/bin/sb_server.py", line 96, in<module> Dale> from spambayes import Dibbler Dale> File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 186, in<module> Dale> from spambayes import asyncore, asynchat Dale> ImportError: cannot import name asyncore
Hmmm... Looks like asyncore (and probably asynchat) probably didn't make it into the distribution. I maybe have a messed up manifest. I'll take a look.
Skip
Well, today Debian provided an update to python that prevents the use of all Spambayes versions. I had been running 1.1a6 with python 2.5. Attempting that combination now yields: Traceback ( most recent call last): File "/usr/bin/sb_server.py", line 93, in <module> import spambayes.message ImportError: No module named spambayes.message Summarizing the current situation: The official Debian version of 1.04 starts and allows email through, but training yields only error messages and no actual training occurs. Version 1.1a6 will not start due to the spambayes.message module problem mentioned above. Version 1.1b1 has the problems with asyncore and asynchat outlined at the top and also will not start. I don't really know how to proceed at this point. Thanks, Dale _Current python packages:_ ii libpython2.6 2.6.6-10 ii python2.5 2.5.5-11 ii python2.5-minimal 2.5.5-11 ii python2.6 2.6.6-10 ii python 2.6.6-14 ii python2.6-minimal 2.6.6-10 ii python-cairo 1.8.8-1+b1 ii python-central 0.6.17 ii python-dbus 0.83.1-1+b1 ii python-dns 2.3.5-2 ii python-gobject 2.28.3-2 ii python-gobject-cairo 2.28.3-2 ii python-imaging 1.1.7-2+b1 ii python-lockfile 1:0.8-2 ii python-minimal 2.6.6-14 ii python-pexpect 2.3-1 ii python-pkg-resources 0.6.15-2 ii python-setuptools 0.6.15-2 ii python-support 1.0.13 _Version 1.04 training errors:_ *Training... * *500 Server error* *Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/spambayes/Dibbler.py", line 470, in found_terminator getattr(plugin, name)(**params) File "/usr/lib/pymodules/python2.6/spambayes/ProxyUI.py", line 399, in onReview self.flush() File "/usr/lib/pymodules/python2.6/spambayes/Dibbler.py", line 706, in flush return self._handler.flush() File "/usr/lib/pymodules/python2.6/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 406, in __getattr__ %(self.__class__.__name__, attr)) AttributeError: _HTTPHandler instance has no attribute 'ac_out_buffer' *
Dale> Although the build happens and the correct dependencies are Dale> applied, this is what I got when I tried to run it. Dale> Traceback (most recent call last): Dale> File "/usr/bin/sb_server.py", line 96, in<module> Dale> from spambayes import Dibbler Dale> File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 186, in<module> Dale> from spambayes import asyncore, asynchat Dale> ImportError: cannot import name asyncore Dale> Hmmm... Looks like asyncore (and probably asynchat) probably Dale> didn't make it into the distribution. I maybe have a messed Dale> up manifest. I'll take a look. My apologies for not getting to this sooner. Dale> Well, today Debian provided an update to python that prevents the Dale> use of all Spambayes versions. I had been running 1.1a6 with Dale> python 2.5. Attempting that combination now yields: ... Dale> Version 1.1b1 has the problems with asyncore and asynchat outlined Dale> at the top and also will not start. Dale> I don't really know how to proceed at this point. As it turns out distutils has a bug which causes it to not rebuild the MANIFEST file in many situations, so the new asyncore and asynchat modules were not incorporated into the original 1.1b1 release. I fixed that problem today and created a new 1.1b1 source release. It's available in the usual place: http://pypi.python.org/pypi?:action=display&name=spambayes Before uploading it I verified that the new files were included: % tar tfz dist/spambayes-1.1b1.tar.gz | egrep async spambayes-1.1b1/Outlook2000/dialogs/async_processor.py spambayes-1.1b1/spambayes/asynchat.py spambayes-1.1b1/spambayes/asyncore.py Please have the Debian folks regenerate their SpamBayes package. -- Skip Montanaro - skip@pobox.com - http://www.smontanaro.net/
On 05/05/2011 8:51 AM, skip@pobox.com wrote:
Dale> Although the build happens and the correct dependencies are Dale> applied, this is what I got when I tried to run it.
Dale> Traceback (most recent call last): Dale> File "/usr/bin/sb_server.py", line 96, in<module> Dale> from spambayes import Dibbler Dale> File "/usr/lib/python2.5/site-packages/spambayes/Dibbler.py", line 186, in<module> Dale> from spambayes import asyncore, asynchat Dale> ImportError: cannot import name asyncore
Dale> Hmmm... Looks like asyncore (and probably asynchat) probably Dale> didn't make it into the distribution. I maybe have a messed Dale> up manifest. I'll take a look.
My apologies for not getting to this sooner.
No apologies necessary - just glad you're willing and able to do it.
Dale> Well, today Debian provided an update to python that prevents the Dale> use of all Spambayes versions. I had been running 1.1a6 with Dale> python 2.5. Attempting that combination now yields:
...
Dale> Version 1.1b1 has the problems with asyncore and asynchat outlined Dale> at the top and also will not start.
Dale> I don't really know how to proceed at this point.
As it turns out distutils has a bug which causes it to not rebuild the MANIFEST file in many situations, so the new asyncore and asynchat modules were not incorporated into the original 1.1b1 release. I fixed that problem today and created a new 1.1b1 source release. It's available in the usual place:
http://pypi.python.org/pypi?:action=display&name=spambayes
Before uploading it I verified that the new files were included:
% tar tfz dist/spambayes-1.1b1.tar.gz | egrep async spambayes-1.1b1/Outlook2000/dialogs/async_processor.py spambayes-1.1b1/spambayes/asynchat.py spambayes-1.1b1/spambayes/asyncore.py
Please have the Debian folks regenerate their SpamBayes package.
I went live with 1.1b1 today, and all has gone well. It also seems to be somewhat faster than before. Yesterday, I tested with python 2.6 and 2.7 - both worked. For Debian users: I used python-stdeb to build the .deb package. Unlike version 1.1a6, 1.1b1 would only work on the system on which it was built - even though all python packages were of the same version between systems. Specifically, the .deb that was built on the test system installed on the production system, started on the production system, but would throw error messages when attempting to train email. I did not put any effort into finding out why this happened, so it may or may not be universally applicable. Skip, thank you very much for fixing this. It is much appreciated. Alexandre, please consider making this version an official Debian package. Dale
participants (2)
-
Dale Schroeder -
skip@pobox.com