WinXP, Python 2.3.3
I run the program (classifying), enter my password, wait about a minute and then I get an error message. The emails don't seem to get classified. Classifying worked before for me (with rc1).
Here's the output:
C:\Program Files\Python\Scripts>sb_imapfilter.py -c -P
SpamBayes IMAP Filter Version 0.4 (May 2004)
and engine SpamBayes Engine Version 0.3 (January 2004).
Password:
Traceback (most recent call last):
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 928, in ? run()
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 918, in run
imap_filter.Filter()
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 789, in Filter
self.unsure_folder)
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 703, in Filter
for msg in self:
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 594, in __iter__
yield self[key]
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 643, in __getitem__msg.Save()
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 504, in Save
self.as_string())
File "C:\Program Files\Python\Scripts\sb_imapfilter.py", line 472, in as_string
return message.SBHeaderMessage.as_string(self, unixfrom)
File "c:\progra~1\python\Lib\site-packages\spambayes\message.py", line 279, in
as_string
return self._force_CRLF(email.Message.Message.as_string(self, unixfrom))
File "C:\PROGRA~1\Python\lib\email\Message.py", line 130, in as_string
g.flatten(self, unixfrom=unixfrom)
File "C:\PROGRA~1\Python\lib\email\Generator.py", line 102, in flatten
self._write(msg)
File "C:\PROGRA~1\Python\lib\email\Generator.py", line 130, in _write
self._dispatch(msg)
File "C:\PROGRA~1\Python\lib\email\Generator.py", line 156, in _dispatch
meth(msg)
File "C:\PROGRA~1\Python\lib\email\Generator.py", line 199, in _handle_text
raise TypeError, 'string payload expected: %s' % type(payload)
TypeError: string payload expected: <type 'list'>
Logged In: YES
user_id=552329
The problem here is a single message, almost certainly spam,
which is malformed. For the moment, the solution is to
manually remove that message, and then all should be fine.
A fix for this has already been checked in, so once the next
release (1.0rc2, most likely) comes out, this will no longer
be a problem.
Longer term, the email parser that SpamBayes uses has been
updated so that just about any malformed mail should be
handled correctly. It'll be a couple of months before we
start using this, though.