Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to resolve locale before running Click #32

Merged
merged 7 commits into from
Aug 3, 2023
Merged

Conversation

dstaroff
Copy link
Contributor

@dstaroff dstaroff commented Aug 3, 2023

On some systems, misconfigured LC_ALL and LANG env variables breaks Click with errors like:

Traceback (most recent call last):
  File "/usr/bin/chadmin", line 8, in <module>
    sys.exit(main())
  File "/opt/yandex/ch-tools/lib/python3.6/site-packages/ch_tools/chadmin/chadmin_cli.py", line 150, in main
    cli.main()
  File "/opt/yandex/ch-tools/lib/python3.6/site-packages/click/core.py", line 1034, in main
    _verify_python_env()
  File "/opt/yandex/ch-tools/lib/python3.6/site-packages/click/_unicodefun.py", line 100, in _verify_python_env
    raise RuntimeError("\n\n".join(extra))
RuntimeError: Click will abort further execution because Python was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/unicode-support/ 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

Click discovered that you exported a UTF-8 locale but the locale system could not pick up from it because it does not exist. The exported locale is 'en_US.UTF-8' but it is not supported.

This PR is about resolving locale before running Click

@dstaroff dstaroff requested review from myrrc and aalexfvk August 3, 2023 11:20
Copy link
Contributor

@myrrc myrrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Makefile Show resolved Hide resolved
@dstaroff dstaroff merged commit 20c47d8 into main Aug 3, 2023
@dstaroff dstaroff deleted the dstaroff/lc-all branch August 3, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants