Closed pravi closed 7 years ago
The issue lies in python core. Here are some links
We can warn user like what click
does here
@shanavas786 can't we convert such literals to unicode literals explicitly? At the minimum we should tell the user to choose a locale with UTF-8. We can also instruct them to run dpkg-reconfigure locales, choose a UTF-8 enabled locale and reboot.
@pravi We can't convert. AFAIK, its a compatibility issue with python3 on non-utf terminals.
At the minimum we should tell the user to choose a locale with UTF-8.
Thats what click
does.
$ LANG=C python3 -c 'import click; cli = click.command()(lambda:print("ok")); cli()'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 675, in main
_verify_python3_env()
File "/usr/lib/python3/dist-packages/click/_unicodefun.py", line 119, in _verify_python3_env
'mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either run this under Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.
This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8