[PATCH] Windows testsuite fixes [1/4]

Andrew Bennetts andrew at canonical.com
Mon Dec 4 01:18:50 GMT 2006


On Fri, Dec 01, 2006 at 04:24:42PM +0100, Vincent Ladeuil wrote:
> >>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:
[...]
>     jam> It does seem like you can call 'setlocale'. But I wonder
>     jam> if there is something that you could use when calling
>     jam> out to another process. (We would like to use it when
>     jam> spawning an external diff).
> 
> I'm all ears here.
> 
> I was bitten by the same kind of problem on another project where
> perl was confused by Gtk setting the locales in a way I couldn't
> understand. The only way I know of to change locale in windows is
> by using *interactively* the international control panel
> (whatever its name).

I'm somewhat sure that an individual process can set its locale however it likes
with setlocale (although this can be problematic if a library does it — e.g. I
recall reading that spambayes plugin for Outlook Express would have to
continually call setlocale because another thread in Outlook Express would call
it to set it back to a something else).  I'm not sure how to portably instruct a
spawned process that it should use a locale other than the system default.  I'll
be interested to know how the final solution for this works, even though I'm
just a boring English-only user.

>     >> Your solution seems ok for this instance, but in general run_bzr should probably
>     >> ensure the test bzr is run in a predictable way.
>     >> 
>     >> Otherwise, +1 from me.
> 
> Thanks. I'll take that into account and propose a better patch
> next week.
> 
> If anybody have ideas to address the point above, please don't
> hesitate :)

I think solving the general problem is going to be moderately hard, so I don't
mind if you merge your solution as is.  If your workaround of the problem was in
some way inferior to the previous code in clarity or effectiveness of the test,
then it would be more important to solve it properly, but in this case it seems
fine to merge what you have.

I guess that comment in my review was targeted to the developer community in
general, a sort of call for "please, someone fix this", rather than something
you had to do yourself.  That said, if you do want to fix it now... thanks! :)

-Andrew.





More information about the bazaar mailing list