[PATCH] run-tests: LANGUAGE may make tests fail
Martin Geisler
mg at lazybytes.net
Tue Nov 24 10:50:10 CST 2009
Benoit Boissinot <benoit.boissinot at ens-lyon.org> writes:
> On Tue, Nov 24, 2009 at 01:57:13PM -0200, Wagner Bruna wrote:
>> # HG changeset patch
>> # User Wagner Bruna <wbruna at softwareexpress.com.br>
>> # Date 1259078113 7200
>> # Branch stable
>> # Node ID e63ef7059143ccdf7f4689604895541d5d9cda54
>> # Parent 5d748045c2aed9f9b74799c78dcbb6bdbec38657
>> run-tests: LANGUAGE may make tests fail
>
> I don't see anything about LANGUAGE here:
> http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html
>
> Do you have an example where it fails? all localization should be
> already overrident by LC_ALL+LANG.
In the gettext module, LANGAUGE is actually the most significant:
for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'):
val = os.environ.get(envar)
if val:
languages = val.split(':')
break
But other processes launched by hg (in 'hg convert') will probably only
use LC_ALL, so we should reset that too.
>> diff --git a/tests/run-tests.py b/tests/run-tests.py
>> --- a/tests/run-tests.py
>> +++ b/tests/run-tests.py
>> @@ -781,7 +781,7 @@
>>
>> # Reset some environment variables to well-known values so that
>> # the tests produce repeatable output.
>> - os.environ['LANG'] = os.environ['LC_ALL'] = 'C'
>> + os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
>> os.environ['TZ'] = 'GMT'
>> os.environ["EMAIL"] = "Foo Bar <foo.bar at example.com>"
>> os.environ['CDPATH'] = ''
I suggest we put this one in and then I'll make another patch that
resets the environment completely, i.e., starts with an empty
environment instead of copying whatever environment run-tests.py is
started with.
--
Martin Geisler
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091124/cbe43740/attachment.pgp>
More information about the Mercurial-devel
mailing list