[spambayes-dev] RE: [Spambayes] Question (or possibly a bug report)

Meyer, Tony T.A.Meyer at massey.ac.nz
Thu Jul 24 18:14:32 EDT 2003

> [Moved to spambayes-dev: This will be boring to the poor users.]

If the poor users would just use English like God intended, all would be
fine <wink>.

> Hrm - so that implies our code in msgstore.py:
> Is probably not doing what we think it is.  Not that I know what we 
> think it is doing (but see below).  Fortunately, I can blame Tony for 
> almost all of these locale fixes.

Actually I knew that that code wasn't having any effect.  Logically, it
should have (at least until you read past the first page of the locale
docs), and I thought it corrected some behaviour (I was wrong) and so
checked it in.  Then later I found that commenting it out made no
difference at all.  That baffled me (reading past that first page would
probably have been an idea at that point), and so I just left it checked
in and figured I'd re-look at it when I tried to figure out the locale
stuff next time.  (And then got side tracked and didn't go back to the
locale stuff until now).  So although you were (at least partly) joking,
I am to blame for the effect-less code there.

> Both:
>     S = ln(S) + Sexp * LN2
> exceptions.OverflowError: math range error

This was of course, for those who weren't paying attention at the time,
the original locale problem.

> I get on *every* mail I try and classify - and in the "training" 
> dialog, I can reproduce the original bug:

Which means, I assume, that we are confident that this *is* a locale
problem, and that the tracker item from the person who said they were
using English was wrong?

> I actually think this is a furphy.

Ok I give up; dictionary.com has failed me - what is a furphy?

>  I instrumented our MAPI logon code to:
>         print "Before init, locale is", locale.getlocale(),
> locale.getlocale(locale.LC_NUMERIC)
> etc, and this is what I get when running from inside Outlook
> ie, MAPI changes nothing.
> But if I start up "manager.py"
> as a new process hosted by python.exe, I see:
> In this case, mapi *did* set the locale to the default locale
> - but the locale that we would have had under Outlook anyway.

I begin to understand/remember where I went wrong then.  I got tired of
testing things through Outlook and started using the test code in the
various Outlook scripts, since they were there.  If you put "print
locale.setlocale(locale.LC_NUMERIC)" before the mapi logon in
msgstore.py and run that from a new process, mapi does change the locale
("C" to "German_Germany.1252").  So I figured that this was a culprit,
without then testing from Outlook.

=Tony Meyer

More information about the spambayes-dev mailing list