[Spambayes] Lotus Notes filter error KeyError: ('Hammie', 'header_spam_string')

Kenny Pitt kennypitt at hotmail.com
Wed Nov 5 14:42:35 EST 2003


Mike Smith wrote:
> When I try to train, it dies.  Here is the command I'm entering:
> C:\Program Files\Python23\Scripts>sb_notesfilter.py -t -d spambayes
> -l c:\apps\N 
> otes\Data\msmith1.nsf -f spam
> 
> Here is the Traceback:
> Traceback (most recent call last):
>   File "C:\Program Files\Python23\Scripts\sb_notesfilter.py", line
>     384, in ? sbfname, doTrain, doClassify)
>   File "C:\Program Files\Python23\Scripts\sb_notesfilter.py", line
>     321, in run processAndTrain(vtrainspam, vspam, bayes, True,
>   notesindex) File "C:\Program
> Files\Python23\Scripts\sb_notesfilter.py", line 237, in proce 
> ssAndTrain
>     str = options["Hammie", "header_spam_string"]
>   File
> "C:\PROGRA~1\Python23\lib\site-packages\spambayes\OptionsClass.py",
>     line 562, in __getitem__ return self.get(key[0], key[1])
>   File
> "C:\PROGRA~1\Python23\lib\site-packages\spambayes\OptionsClass.py",
>     line 559, in get return self.get_option(sect, opt).get()
>   File
> "C:\PROGRA~1\Python23\lib\site-packages\spambayes\OptionsClass.py",
>     line 553, in get_option return self._options[sect, opt]
> KeyError: ('Hammie', 'header_spam_string
> 
> Am I missing something?

No, it's not you, it's a bug in the script.  Some of the options were
renamed or moved for 1.0a7, and it looks like a few references were
missed (probably because not too many people use notesfilter).

Since you have the source, you can fix this yourself for now.  Go into
the scripts subdirectory (under your source directory, not your Python23
directory) and open sb_notesfilter.py in any text editor.  Wherever you
find 'options["Hammie",' just change "Hammie" to "Headers".  Then run
the setup.py build/install commands again to update.

As I mentioned, I don't think sb_notesfilter has been used/tested as
much as some of the other scripts, so this may not be the only thing
that is a bit out-of-date, but good luck.  Keep us updated on how this
works for you.

-- 
Kenny Pitt




More information about the Spambayes mailing list