У нед, 20. 11 2016. у 21:47 -0600, Leo Arias пише:
> 
> subprocess.check_call('export LANG=en_US.UTF-8', shell=True)
> subprocess.check_call('export LANGUAGE=en_US.UTF-8', shell=True)
> subprocess.check_call('export LC_ALL=en_US.UTF-8', shell=True)
> subprocess.check_call(['locale-gen', 'en_US.UTF-8'])
> subprocess.check_call(['dpkg-reconfigure', 'locales'])
os.environ["LC_ALL"] = "en_US.UTF-8"
should do what you want (after locale-gen, but en_US.UTF-8 is always
present on Ubuntu systems based on official images if I am not
mistaken; if not, use C.UTF-8 which is the name for "POSIX locale in
UTF-8").
You can always check what the locale is active by running "locale"
(just like that).

FWIW, calling out to locale.setlocale() will not help because that sets
the in-process locale, and will not apply to external programs.
Cheers,
Danilo
-- 
Juju mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to