setlocale (Was: Re: [PATCH] patchbomb: fix From_ in the message's envelope)
Brodie Rao
dackze at gmail.com
Wed Jul 15 18:38:41 CDT 2009
On Jul 15, 2009, at 5:45 PM, Matt Mackall wrote:
> On Mon, 2009-07-06 at 23:56 +0200, Cedric Duval wrote:
>> So... on the course of implementing this locale test, some weird
>> behaviors led to an interesting discovery. :) Nowhere do we have
>> the idiomatic
>>
>> locale.setlocale(locale.LC_ALL, '')
>>
>> for setting up the locales according to the user's environment.
>>
>> It would allow users to take advantage of, for instance, dates
>> displayed
>> in a way they are used to (e.g. in 'hg log'), etc.
>>
>> It also means that we'd have to be more careful where locales may
>> affect
>> results, and that the current code may have wrong assumptions that
>> will
>> have to be fixed, but in the long run I think this is worth doing.
>>
>> Thoughts?
>
> I'm not very keen on that. We're likely to hit some unpleasant
> surprises
> like changes in collation order or the like.
Do you have any specific scenarios in mind where this could come up?
The only libraries in Python itself that use the locale library are
calendar, datetime, and time. Nothing uses strxfrm, strcoll, wcsxfrm,
or wcscoll.
I'm not sure about Python's or Mercurial's 3rd party dependencies.
More information about the Mercurial-devel
mailing list