[RFC] external diff on win32 and locale

John Arbash Meinel john at arbash-meinel.com
Thu Jan 4 20:00:18 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...

> Should be adjusted to set $LANGUAGE for diff to 'C'.
> This could be done by pass corresponding argument named `env'
> to subprocess.Popen() function. And this should be portable
> solution instead of `preexec_fn' argument that not supported
> on win32 at all.

Yeah, I saw the 'env' parameter months after I implemented the
preexec_fn stuff.

So I agree that we should create an 'env' dict, and set things in there.
(I think the easiest thing is to do:

 env = dict(os.environ)
 env['LANG'] = 'C'
 env['LANGUAGE'] = 'C'
 ...

> 
> So theoretically we can use pair (GetThreadLocale, SetThreadLocale)
> to save, change and restore locale settings. I can write
> corresponding patch if you can test on your machine those
> cases that rely on locale settings (on my russian machine
> I yet can't see the problems with locales). If this will help
> then we will need to add pywin32 to obligatory dependencies
> of bzr on win32.
> 
> 
> Alexander
> 

Well, these are only necessary if you are using an external diff, or if
you are running the test suite. We could have the test suite skip if it
can't do it.

I'm a little worried that SetThreadLocale() won't do the right thing
since you are spawning an external process.

But if setting LANGUAGE works for you, I think it is a good first step.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFnVzSJdeBCYSNAAMRAmkJAKC/WUF0wHWm4Mj2QZLMdWatOt7FfgCdHeRj
cyh7B6zHls+JuuT8cON92lI=
=uX6G
-----END PGP SIGNATURE-----



More information about the bazaar mailing list