sb_imapfilter fails to run under Python 2.5: SyntaxError: from __future__ imports

Bug #114798 reported by Kevin Smith
6
Affects Status Importance Assigned to Milestone
spambayes (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

After upgrading from edgy to fiesty, spambayes stopped working. Running sb_imapfilter gives this error:

kevins@aria:~$ cd /home/kevins/.spambayes/tavo;sb_imapfilter.py -c -t
  File "/usr/bin/sb_imapfilter.py", line 93
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file
kevins@aria:~/.spambayes/tavo$

As a result, my spam filtering is completely broken and is doing nothing at all.

It looks like spambayes (sb_imapfilter) is not compatible with python 2.5, but python 2.5 has been installed as the default interpreter.

I am going to try to work around it by manually editing the #! line to point to python 2.4 specifically.

Tags: bitesize

Related branches

description: updated
Revision history for this message
Scott Kitterman (kitterman) wrote :

You might also try changing from __future__ import generators to import generators

Changed in spambayes:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Michael Bienia (geser) wrote :

The fix is to move line 93 ("from __future__ import generators") to line 2 (between the #! line and the description starting in line 3) in sb_imapfilter.py.

sb_dbexpimp.py and sb_notesfilter.py is also affected (other files might also be affected, I didn't grep all). The person fixing it might looked at sb_pop3dnd.py as this script does it right.

Revision history for this message
Edoardo Batini (edoardo-batini) wrote :

List of files of package spambayes with __future__ imports.

Revision history for this message
Kevin Smith (ubuntu-qualitycode) wrote :

Thanks very much! I moved line 93 and now it runs...but I get this (after a long time):

kevins@aria:~$ cd /home/kevins/.spambayes/tavo;sb_imapfilter.py -c -t
SpamBayes IMAP Filter Version 0.6 (January 2005)
and engine SpamBayes Engine Version 0.3 (January 2004).

Exception exceptions.TypeError: "'NoneType' object is not callable" in <bound method MessageInfoDB.__del__ of <spambayes.message.MessageInfoDB object at 0x836778c>> ignored
Exception exceptions.TypeError: "'NoneType' object is not callable" in ignored
Exception exceptions.TypeError: "'NoneType' object is not callable" in ignored
kevins@aria:~/.spambayes/tavo$

Should I file it as a separate bug?

Revision history for this message
Scott Kitterman (kitterman) wrote :

Yes. Please file that as a different bug.

Changed in spambayes:
assignee: nobody → adam-collard
status: Confirmed → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

I'm making the assumption that after several months Adam had this assigned to himself for triaging and not for fixing. Working on a fix.

Changed in spambayes:
assignee: adam-collard → kitterman
Revision history for this message
Scott Kitterman (kitterman) wrote :

Fix uploaded for Gutsy.

Changed in spambayes:
assignee: kitterman → nobody
status: In Progress → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

spambayes (1.0.4-3ubuntu2) gutsy; urgency=low

  * Update debian/patches/fix_import_future.dpatch to fix all instances
    of from future import not being at the start of the file.
    (LP: #114798)
  * Simplify debian/rules so unpatch actually works.
  * Remove dh_python from debian/rules (not needed)
  * Change maintainer to MOTU
  * Add build-dep on dpatch

 -- Scott Kitterman <email address hidden> Tue, 25 Sep 2007 23:56:28 -0400

Changed in spambayes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.