#90 Protection for dnscache corruption

open
nobody
None
5
2007-09-26
2007-09-26
Dave Abrahams
No

My spam filtering regularly starts failing because the dnscache is corrupted. I don't have any idea how it gets that way, but a broken cache should never scuttle the process, so I propose the enclosed patch.

procmail: Executing "sb_filter.py"
Traceback (most recent call last):
File "/usr/local/bin/sb_filter.py", line 83, in ?
from spambayes import hammie, Options, mboxutils, storage
File "/usr/local/lib/python2.4/site-packages/spambayes/hammie.py", line 7, in ?
from spambayes.tokenizer import tokenize
File "/usr/local/lib/python2.4/site-packages/spambayes/tokenizer.py", line 44, in ?
cache = dnscache.cache(cachefile=options["Tokenizer", "lookup_ip_cache"])
File "/usr/local/lib/python2.4/site-packages/spambayes/dnscache.py", line 98, in __init__
self.caches = pickle.load(open(self.cachefile, "rb"))
cPickle.UnpicklingError: invalid load key, '
'.
procmail: Program failure (1) of "sb_filter.py"

Discussion

  • Dave Abrahams
    Dave Abrahams
    2007-09-26

     
    Attachments
  • Skip Montanaro
    Skip Montanaro
    2007-10-22

    Logged In: YES
    user_id=44345
    Originator: NO

    I'm trying to figure out what the patch to hammie.py has to do with protecting against a corrupt
    dnscache. Was perhaps the wrong patch attached to this ticket?