[MERGE] OSX test suite passing (well as of 2008/09/08 :)

John Arbash Meinel john at arbash-meinel.com
Tue Sep 9 16:23:24 BST 2008


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


...

> 
> So, sorry for that loong mail, here is the patch,
> 
>     Vincent
> 

> +            if os.environ.get('LANG', None) is None:
> +                # If LANG is not set, we end up with 'ascii', which is bad
> +                # ('mac-roman' is more than ascii), so we set a default which
> +                # will give us UTF-8 (which appears to work in all cases on
> +                # OSX). Users are still free to override LANG of course, as
> +                # long as it give us something meaningful. This work-around
> +                # *may* not be needed with python 3k and/or OSX 10.5, but will
> +                # work with them too -- vila 20080908
> +                os.environ['LANG'] = 'en_US.UTF-8'

^- There are some possible negative side effects of this, but I'm
guessing the positives out-weigh it.

1) Would it be better to just do that in the test suite?
2) There are the LC_* functions that can have similar effects, and *I*
won't claim to be an expert in any of it.
3) Is the "en_US" locale always available on Mac? I don't think it is
under Linux, but that doesn't apply here.

I really don't have any idea about how Mac goes about with locale
customized installations. I know on Windows you get things like
different code pages for the shell and the filesystem (when not it
WideChar mode.)

I'm probably about 50% on this. It solves a direct issue, but possibly
introduces others. Certainly once we have proper i18n, this is going to
become a more serious issue. In the short term it is a reasonable fix.
Though I'll also mention my other comment about avoiding 'locale'
entirely. It is a significant blip on startup time, and seems to be
doing a lot of work that we only need to do once. (Then again, maybe
setlocale is being called, and initializing a lot of state that
3rd-party code like 'svn' needs to work properly.)

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjGlOwACgkQJdeBCYSNAANeuACfVWI0+zjIS/Fj9NKFPxtGldU/
1+IAn0bVTldfmc0mdpNFVpbTa7ptGqtt
=flaL
-----END PGP SIGNATURE-----



More information about the bazaar mailing list