How to set the locale?

Leo Arias leo.arias at canonical.com
Mon Nov 21 03:47:02 UTC 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20161120/2474deed/attachment.html>


More information about the Juju mailing list