[Spambayes] What does this mean?

skip at pobox.com skip at pobox.com
Wed Jun 17 13:50:46 CEST 2009


    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%40palladion.com%3e

Richie, care to chime in?

-- 
Skip Montanaro - skip at 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


More information about the SpamBayes mailing list