[Spambayes] New web training interface for pop3proxy

Paul Moore lists@morpheus.demon.co.uk
Sun Nov 24 17:35:07 2002


Richie Hindle <richie@entrian.com> writes:

> Um?  That code says:
>
>>             if record is None:
>>                 record = self.WordInfoClass(now)
>> 
>>             if is_spam:
>>                 record.spamcount += 1
>>             else:
>>                 record.hamcount += 1
>>             # Needed to tell a persistent DB that the content changed.
>>             wordinfo[word] = record
>
> So by the time it gets to the offending line, record can't be None...

Hmm. I just did some tracing by using Python's trace hooks (neat
trick, although it does produce a lot of output...) It stops in
hammie.py at line 130, which is in DBDict.__setitem__ doing
self.hash[key] = v. That's mildly worrying, as it sort of implies that
the lockup is in the DBM C extension. (If any more Python code was
being called, I'd expect to see trace output).

Any DBM experts in the house?

Paul.

PS The tracing code I used was as follows. It's quite a neat trick, as
   it doesn't need any changes to the source at all - and by playing
   with the trace hook, you can even dump local variable values if you
   need to...

import sys

def tracer(frame, event, arg):
    if event == 'call':
        return tracer
    if event == 'line':
        print frame.f_code.co_filename, frame.f_lineno
        return tracer

sys.settrace(tracer)
sys.argv = ["pop3proxy.py", "-d", "-l", "8110", "localhost"]
execfile(sys.argv[0])


-- 
This signature intentionally left blank



More information about the Spambayes mailing list