On 09/20/12 08:43 PM, Erik Trauschke wrote:
According to this
http://pubs.opengroup.org/onlinepubs/007908799/xbd/envvar.html:

---
LC_ALL
      This variable determines the values for all locale categories. The
value of the LC_ALL environment variable has precedence over any of the
other environment variables starting with LC_ (LC_COLLATE, LC_CTYPE,
LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) and the LANG environment
variable.
---

Unless I'm reading this wrong, if you set LC_ALL, the setting of any
other LC_ variables should not matter.

That's correct, and straightforward to verify:

timf@igyo[330] export LC_ALL=fr_FR.UTF-8
timf@igyo[331] date
vendredi 21 septembre 2012 08:46:31 NZST
timf@igyo[332] unset LC_ALL
timf@igyo[333] export LC_TIME=ja_JP.UTF-8
timf@igyo[334] date
2012年09月21日 (金) 08時46分52秒 NZST
timf@igyo[335] export LC_ALL=fr_FR.UTF-8
timf@igyo[336] date
vendredi 21 septembre 2012 08:46:59 NZST
timf@igyo[337]

So I think I should be good by adding another elif statement testing for
LC_TIME:

if "LC_ALL" in os.environ and os.environ["LC_ALL"] != "C":
      print_lc_warn()
elif "LC_TIME" in os.environ and if os.environ["LC_TIME"] != "C":
      print_lc_warn()
elif "LANG" in os.environ and if os.environ["LANG"] != "C":
      print_lc_warn()

I think that should be the correct sequence.

LGTM. (You could go to town, and check for "posix" as well as "C", but I've never run into anyone actually using that locale name)

        cheers,
                        tim

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to