How to set the locale?

Bilal Baqar bbaqar at plumgrid.com
Mon Nov 21 06:17:14 UTC 2016


Try using this:

locale.setlocale(locale.LC_ALL, "en_US.UTF-8")


On Sun, Nov 20, 2016 at 7:47 PM, Leo Arias <leo.arias at canonical.com> wrote:

> Hello,
>
> I added this step to my charm:
>
> subprocess.check_call(['pip', 'install', 'rainbowstream'])
>
> But it fails with: UnicodeDecodeError: 'ascii' codec can't decode byte
> 0xe2 in position 393: ordinal not in range(128)
> http://paste.ubuntu.com/23510046/
>
> My guess is that the locale is not set to utf-8. But I've tried things
> like these and it still fails:
>
> 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'])
>
> any idea what I'm missing?
>
> thank you.
> --
> ¡paz y baile!
> http://www.ubuntu.com
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>


-- 
Bilal Baqar
MTS - PLUMgrid Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20161120/25ab0dc4/attachment.html>


More information about the Juju mailing list