[spambayes-dev] Nuke experimental_ham_spam_imbalance_adjustment?

Skip Montanaro skip at pobox.com
Mon Dec 15 09:48:48 EST 2003


    Tim> Cool!  I just did that.  There's a minor problem: the OptionsClass
    Tim> module says the magic prefix is

    Tim>     X-

    Tim> (uppercase), but only

    Tim>     x-

    Tim> (lowercase) works as intended.  With

    Tim>     X-experimental_ham_spam_imbalance_adjustment

    Tim> the warning is

    Tim>     warning: Invalid option experimental_ham_spam_imbalance_adjustment in
    Tim>     section Classifier in file
    Tim>     C:\WINDOWS\Application Data\SpamBayes\default_bayes_customize.ini

    Tim> and with

    Tim>     x-experimental_ham_spam_imbalance_adjustment

    Tim> it's the mostly <wink> hoped-for

    Tim>     warning: option experimental_ham_spam_imbalance_adjustment in
    Tim>     section Classifier is deprecated

    Tim> I'm not sure what your intent was, but the code should match the
    Tim> docs one way or the other.  The second form of message should
    Tim> probably include the filename too.

My intent was to mimic rfc-822-style experimental headers, but it appears I
don't really understand what ConfigParser does vis a vis case-sensitivity.
(I thought it was case-insensitive, and the code suggests it is, but that
seems to not quite be the case.)  In OptionsClass.merge_file() I originally
wanted to use X- (note its presence in a comment I forgot to change), but
wound up switching to x-.  A little more investigation suggests that
ConfigParser does indeed ignore case in the values it reads from the options
file, but that the code in OptionsClass.py doesn't treat the options it
stores in self._options that way.

I don't really care what hoops we as programmers have to jump through, but
I'd like users to be able to use either x- or X-.  I agree, the docstrings
should match required usage.  In any case, it appears Tim (or someone else)
has fixed things).

Skip



More information about the spambayes-dev mailing list