[Spambayes] 1.0rc1:sb_imapfilter fails after install over b1

Tony Meyer tameyer at ihug.co.nz
Thu Jun 10 00:23:39 EDT 2004


> Delving further...
> 
> I've 'fixed' the problem by changing message.py to say:
> if options["Storage", "persistent_use_database"] or \
>    options["Storage", "persistent_use_database"] == "dbm":
>     msginfoDB = MessageInfoDB(message_info_db_name)
> elif options["Storage", "persistent_use_database"] == False or \
>      options["Storage", "persistent_use_database"] == "pickle":
>     msginfoDB = MessageInfoPickle(message_info_db_name)
> 
> rather than
> if options["Storage", "persistent_use_database"] is True or \
>    options["Storage", "persistent_use_database"] == "dbm":
>     msginfoDB = MessageInfoDB(message_info_db_name)
> elif options["Storage", "persistent_use_database"] is False or \
>      options["Storage", "persistent_use_database"] == "pickle":
>     msginfoDB = MessageInfoPickle(message_info_db_name)
> 
> ie testing for True rather than True identity. Seems a silly 
> error so there must be something deeper going on?

I haven't had a chance to check this, but I think I can guess what's
happening here.  That particular option was once a Boolean (True meant some
sort of dbm, False meant pickle), but is now one of various strings ("dbm",
"pickle", "mysql", "zodb", etc).  The chance happened rather late, so
there's code to handle people that have True/False values so as to not break
their configuration.

However, it's even more complicated, because options get stored in plain
text, so this option can actually end up being "True" or "False" (i.e.
strings) rather than True or False (i.e. Booleans).  It's rather messy and
will be cleaned up once a chance arrives.

I suspect that what is happening here is that the option is "False", and
since bool("False") is True, the wrong bit of the conditional gets executed.
It certainly explains why your fix works.  I'll check in something like your
fix before 1.0rc2.  (Thanks for digging into it and letting us know what you
found out!).

=Tony Meyer

---
Please always include the list (spambayes at python.org) in your replies
(reply-all), and please don't send me personal mail about SpamBayes. This
way, you get everyone's help, and avoid a lack of replies when I'm busy.




More information about the Spambayes mailing list