[spambayes-dev] testing tweaks

T. Alexander Popiel popiel at wolfskeep.com
Mon Aug 11 22:19:26 EDT 2003


In message:  <1ED4ECF91CDED24C8D012BCF2B034F1302BF387F at its-xchg4.massey.ac.nz>
             "Meyer, Tony" <T.A.Meyer at massey.ac.nz> writes:
>This is a multi-part message in MIME format.
>
>------_=_NextPart_001_01C35FCC.C2CD2B12
>Content-Type: text/plain;
>	charset="US-ASCII"
>Content-Transfer-Encoding: quoted-printable
>
>> Hey, where's the patch?  It's kind of hard to generate=20
>> corroborating evidence without a patch...
>
>Good point <blush>.  Attached are "diff -u"s - is that right?

It looks like only the classifier change is needed; the others
look like null changes to me.  Is this correct?

Also, for those of us still running 2.2, it's nice to stick in
the 'from __future__ import generators' at the top of the file,
while using yield.

I'm now having the following error thrown:

  Traceback (most recent call last):
    File "timcv.py", line 167, in ?
      main()
    File "timcv.py", line 164, in main
      drive(nsets)
    File "timcv.py", line 113, in drive
      d.test(hamstream, spamstream)
    File "/home/cashew/popiel/spambayes/testing/spambayes/spambayes/TestDriver.py", line 265, in test
      t.predict(spam, True, new_spam)
    File "/home/cashew/popiel/spambayes/testing/spambayes/spambayes/Tester.py", line 92, in predict
      prob = guess(example)
    File "/home/cashew/popiel/spambayes/testing/spambayes/spambayes/classifier.py", line 225, in chi2_spamprob
      clues = self._getclues(wordstream)
    File "/home/cashew/popiel/spambayes/testing/spambayes/spambayes/classifier.py", line 452, in _getclues
      q = wordstream.next()
  AttributeError: 'Msg' object has no attribute 'next'

Given that the error clearly didn't happen on the first message it tried
to classify, I suspect it's triggered by a peculiarity of one of my
messages... as a random guess, I'd say perhaps a MIME multipart/digest
or some other thing that has an embedded rfc822 section?  In any case,
I'm looking at how I might rephrase the classifier to avoid this issue...

- Alex



More information about the spambayes-dev mailing list