[Spambayes] gratuitous changes? + bugs

Sjoerd Mullender sjoerd at acm.org
Sun Apr 27 12:55:17 EDT 2003

I did a cvs update today, and I clearly shouldn't have.  My programs
based on spambayes ceased working for a variety of reasons.

1. OptionClass.mergefiles was renamed to OptionClass.merge_files.
   Gratuitous change?  Or is there some deeper reason behind this.  The
   change was not mentioned in the cvs log, by the way.
2. Boolean values in my .ini file (or at least the verbose flag) can't
   be parsed anymore.  The reason is, the check is_boolen is incorrect
   for Python 2.3.  It checks that the allowed_values is a bool, but in
   actual fact it's a tuple of bools.  See the diff.
3. My setting of basic_header_skip and safe_headers didn't work
   anymore.  The header names now have to be separated with a single
   space.  Why?  I propose the fix included in the diff.

-- Sjoerd Mullender <sjoerd at acm.org>

Index: Options.py
RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v
retrieving revision 1.43
diff -u -r1.43 Options.py
--- Options.py	27 Apr 2003 05:11:40 -0000	1.43
+++ Options.py	27 Apr 2003 09:46:22 -0000
@@ -1183,7 +1183,8 @@
         # considered valid input (and 0 and 1 don't look as nice)
         # So, just for the 2.2 people, we have this helper function
-            if type(self.allowed_values) == types.BooleanType:
+            if type(self.allowed_values) == types.TupleType and \
+               type(self.allowed_values[0]) == types.BooleanType:
                 return True
             return False
         except AttributeError:
@@ -1354,7 +1355,7 @@
                           (opt, sect, filename)
                     if self.multiple_values_allowed(sect, opt):
-                        value = tuple(value.split(' '))
+                        value = tuple(value.split())
                     self.set(sect, opt, self.convert(sect, opt, value))
     # not strictly necessary, but convenient shortcuts to self._options

More information about the Spambayes mailing list