[Spambayes-checkins] spambayes/Outlook2000 train.py,1.12,1.13

Tim Peters tim.one@comcast.net
Mon Nov 4 05:03:05 2002


[Mark Hammond]
> Modified Files:
> 	train.py
> Log Message:
> Fix the root of my:
>   File "F:\src\spambayes\classifier.py", line 450, in _getclues
>     distance = abs(prob - 0.5)
>
> Exception - problem is that we trained, but didn't update probabilities -
> thus, we failed for every new word seen only since the last complete
> retrain.

Mark, I've never seen this, and believed I fixed the only way it could have
happened last week -- WordInfo records start life with a genuine probability
(spamprob) now, instead with a spamprob of None.  It's possible, though,
that you had some leftover WordInfo record with None in your dict, and
didn't retrain from scratch after that fix.  Or it's possible there's an
entirely different bug I still don't know about.

> There may be a case for _getclues() to detect a probability of None
> and call update_probabilities() automatically - either that or just
> keep throwing vague exceptions <wink>

Except it should never be possible for _getclues() to see None -- if that
was still happening for you, there's a deeper bug that still needs to be
fixed.


In other news, here's a shallow bug, upon starting Outlook now:

Traceback (most recent call last):
  File "C:\PYTHON22\lib\site-packages\win32com\universal.py", line 150, in
dispatch
    retVal = ob._InvokeEx_(meth.dispid, 0, pythoncom.DISPATCH_METHOD, args,
None, None)
  File "C:\PYTHON22\lib\site-packages\win32com\server\policy.py", line 322,
in _InvokeEx_
    return self._invokeex_(dispid, lcid, wFlags, args, kwargs,
serviceProvider)
  File "C:\PYTHON22\lib\site-packages\win32com\server\policy.py", line 562,
in _invokeex_
    return DesignatedWrapPolicy._invokeex_( self, dispid, lcid, wFlags,
args, kwArgs, serviceProvider)
  File "C:\PYTHON22\lib\site-packages\win32com\server\policy.py", line 510,
in _invokeex_
    return apply(func, args)
  File "C:\Code\spambayes\Outlook2000\addin.py", line 392, in OnConnection
    button.Init(self.manager, application, activeExplorer)
  File "C:\Code\spambayes\Outlook2000\addin.py", line 262, in Init
    ButtonDeleteAsExplorerEvent)
  File "C:\Code\spambayes\Outlook2000\addin.py", line 103, in
WithEventsClone
    events_class = getevents(clsid)
exceptions.NameError: global name 'getevents' is not defined

It can't have worked for you, either.  I fiddled my local copy to do

from win32com.client import constants, getevents

near the top, and that appears to have fixed it.  I'll check that in, but
please ensure that was the correct fix.