[Spambayes] found a bug

David Shaw david at theresistance.net
Tue Feb 18 17:44:16 EST 2003

Hi all,
   A friend of mine had a cache file in his "unknown" folder that caused  
the "review" web page in pop3proxy.py to generate the following  

Traceback (most recent call last):

   File "spambayes/Dibbler.py", line 398, in found_terminator
     getattr(plugin, name)(**params)

   File "pop3proxy.py", line 929, in onReview
     judgement = judgement.split(';')[0].strip()

   File "pop3proxy.py", line 815, in _makeMessageInfo
     print type(text)

AttributeError: 'list' object has no attribute 'replace'

He sent me the offending message (it's actually a digest of messages),  
and I replicated the problem:

msg = open("/Users/dshaw/Desktop/crash_spam.txt", "r")
message = mbox.get_message(msg)
part = typed_subpart_iterator(message, 'text', 'plain').next()
text = part.get_payload()
 >>> text
[<email.Message.Message instance at 0x275ff0>]

So, instead of text, the payload is a list containing a single  
email.Message.Message instance.  Here are the objects' respective  

 >>> message._payload
[<email.Message.Message instance at 0x279290>, <email.Message.Message  
instance at 0x279160>, <email.Message.Message instance at 0x279e00>,  
<email.Message.Message instance at 0x280b10>, <email.Message.Message  
instance at 0x281340>, <email.Message.Message instance at 0x2828d0>,  
<email.Message.Message instance at 0x283300>, <email.Message.Message  
instance at 0x2b60a0>, <email.Message.Message instance at 0x27f4d0>,  
<email.Message.Message instance at 0x2b7c70>, <email.Message.Message  
instance at 0x2b9ac0>, <email.Message.Message instance at 0x2b8c30>,  
<email.Message.Message instance at 0x2bb770>, <email.Message.Message  
instance at 0x2bc180>]

 >>> text[0]._payload
'pilot-pda Digest 18 Feb 2003 11:00:01 -0000 Issue 1605\r\n\r\nTopics  
(messages 37277 through 37289):\r\n\r\n(best) Download sites  
survey\r\n\t37277 by: "Bill Shadish" <bills at fo.com>\r\n\r\nMP3  
player\r\n\t37278 by: Hassan Ajami <aa7491 at wayne.edu>\r\n\t37279 by:  
PocketGoddess <jen at pocketgoddess.com>\r\n\t37281 by: "Eric Fehrman"  
<edf at ftdinc.com>\r\n\t37289 by: "Roland J. Roberts"  
<jay at map.com>\r\n\r\nNew Tungsten W\r\n\t37280 by: PocketGoddess  
<jen at pocketgoddess.com>\r\n\r\nKyocera 7135\r\n\t37282 by: "MMS"  
<maryszv at earthlink.net>\r\n\t37283 by: PocketGoddess  
<jen at pocketgoddess.com>\r\n\r\nPalmGear Debuts StreamLyncT AutoInstall  
Utility, Simplifying Download/Install Process For Palm OS\xae  
Software\r\n\t37284 by: "Kenny West \\(PalmGear.com\\)"  
<kenny.west at palmgear.com>\r\n\r\nClie SJ33 Review at  
Memoware.\r\n\t37285 by: "Kenneth S. Rhee" <rhee at nku.edu>\r\n\r\nPalm  
Tungsten Digitizer Patch\r\n\t37286 by: "Michael R Kizer"  
<mkizer at csc.com>\r\n\t37287 by: Chris Erickson  
<cjericks at isr.umich.edu>\r\n\r\nPalmGear Debuts StreamLyncT AutoInstall  
Utility, Simplifying Download/Install Process For Palm OSR  
Software\r\n\t37288 by: "Don Ferguson"  
<don at ferguson.us>\r\n\r\nAdministrivia:\r\n\r\nTo subscribe to the  
subscribe at freeside.ultraviolet.org\r\n\r\nTo unsubscribe from the  
unsubscribe at freeside.ultraviolet.org\r\n\r\nTo post to the list,  
pda at freeside.ultraviolet.org\r\n\r\n\r\n-------------------------------- 

The offending email is gzipped and attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1045572229.gz
Type: application/x-gzip
Size: 6821 bytes
Desc: not available
Url : http://mail.python.org/pipermail/spambayes/attachments/20030218/fbf85deb/1045572229-0001.bin

More information about the Spambayes mailing list