Ensure utf-8 is supported before starting
the Urwid interactive session.
This way we hope to avoid bad crashes
when the user has locale configuration problems.
Tests: `make check`.
QA:
If you have juju-quickstart installed, you should
be able to make it crash by overriding all the language
env vars, like the following:
`LC_ALL=C juju-quickstart -i`
You should see a UnicodeEncodeError:
'ascii' codec can't encode character u'\u2582' in position 0:
ordinal not in range(128)
With this branch, the following should instead work as usual:
`LC_ALL=C .venv/bin/python juju-quickstart -i`.
I am not sure how to make Urwid fail so that we can QA
the system exit in the code, but at least that code path
is tested.
*** Submitted:
Check unicode support.
Ensure utf-8 is supported before starting
the Urwid interactive session.
This way we hope to avoid bad crashes
when the user has locale configuration problems.
Tests: `make check`.
QA:
If you have juju-quickstart installed, you should
be able to make it crash by overriding all the language
env vars, like the following:
`LC_ALL=C juju-quickstart -i`
You should see a UnicodeEncodeError:
'ascii' codec can't encode character u'\u2582' in position 0:
ordinal not in range(128)
With this branch, the following should instead work as usual:
`LC_ALL=C .venv/bin/python juju-quickstart -i`.
I am not sure how to make Urwid fail so that we can QA
the system exit in the code, but at least that code path
is tested.
R=rharding /codereview. appspot. com/90740043
CC=
https:/
https:/ /codereview. appspot. com/90740043/