[PATCH] More robust external diff output handling
Wouter van Heyst
larstiq at larstiq.dyndns.org
Thu Nov 9 16:24:24 GMT 2006
On Thu, Nov 09, 2006 at 06:19:10PM +0300, Dmitry Vasiliev wrote:
> Hi,
>
> On Mandrake 10.1 with non-C locale settings external diff ignores LANG=C
> environment variable. I guess such behavior is because of all LC_*
> variables are also set and so LANG value is overridden. The attached patch
> fixed it by setting also LC_ALL=C variable so the diff output now should be
> handled more robustly within non-C environment.
LANGUAGE and LC_CTYPE get unset, LANG was C. To what exactly does diff
pay attention to outside of those that LC_ALL is needed?
> === modified file 'bzrlib/diff.py'
> --- bzrlib/diff.py 2006-10-27 16:43:19 +0000
> +++ bzrlib/diff.py 2006-11-09 13:52:24 +0000
> @@ -96,9 +96,9 @@
>
>
> def _set_lang_C():
> - """Set the env var LANG=C"""
> + """Set the env vars LANG=C and LC_ALL=C."""
> osutils.set_or_unset_env('LANG', 'C')
> - osutils.set_or_unset_env('LC_ALL', None)
> + osutils.set_or_unset_env('LC_ALL', 'C')
> osutils.set_or_unset_env('LC_CTYPE', None)
> osutils.set_or_unset_env('LANGUAGE', None)
Wouter van Heyst
More information about the bazaar
mailing list