[spambayes-dev] RE: [Python-Dev] RE: [Spambayes] Question (orpossibly a bug report)

Mark Hammond mhammond@skippinet.com.au
Fri, 25 Jul 2003 08:57:01 +1000


> Jeez, this locale crap makes Unicode look positively delightful...

This seems to be coming to a conclusion.  Not a completely satisfactory one,
but one nonetheless.

Short story for the python-dev crew:

* Some Windows programs are known to run with the CRT locale set to other
than "C" - specifically, set to the locale of the user.
* If this happens, the marshal module will load floating point literals
incorrectly.
* Thus, once this happens, if a .pyc file is imported, the floating point
literals in that .pyc are wrong.  Confusion reigns.

The "best" solution to this probably involves removing Python being
dependent on the locale - there is even an existing patch for that.

To the SpamBayes specifics:

> The SB Windows triumvirate (Mark, Tim, Tony) seem to have
> narrowed down the
> problem quite a bit.  Is there some way to worm around it?  I
> take it with
> the unmarshalling problem it's not sufficient to specify
> floating point
> values without decimal points (e.g., 0.12 == 1e-1+2e-2).

I have a version working for the original bug reporter.  While on our
machines, we can reproduce the locale being switched at MAPILogon time, my
instrumented version also shows that for some people at least, Outlook
itself will also change it back some time before delivering UI events to us.

Today I hope to produce a less-instrumented version with the fix I intend
leaving in, and asking the OP to re-test.

We *do* still have the "social" problem of what locale conventions to use
for Config files, but that has nothing to do with our tools...

Mark.