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

Piu has a name that may cause truble in case of locale issues #60

Open
msooszalando opened this issue Oct 26, 2018 · 0 comments
Open

Piu has a name that may cause truble in case of locale issues #60

msooszalando opened this issue Oct 26, 2018 · 0 comments

Comments

@msooszalando
Copy link

I had the following really painful issue:

msoos@ZM:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_DE.UTF-8
LANGUAGE=en_GB
LC_CTYPE="en_DE.UTF-8"
LC_NUMERIC="en_DE.UTF-8"
LC_TIME="en_DE.UTF-8"
LC_COLLATE="en_DE.UTF-8"
LC_MONETARY="en_DE.UTF-8"
LC_MESSAGES="en_DE.UTF-8"
LC_PAPER="en_DE.UTF-8"
LC_NAME="en_DE.UTF-8"
LC_ADDRESS="en_DE.UTF-8"
LC_TELEPHONE="en_DE.UTF-8"
LC_MEASUREMENT="en_DE.UTF-8"
LC_IDENTIFICATION="en_DE.UTF-8"
LC_ALL=
msoos@ZM:~$ stups configure

  ___ _____ _   _ ___  ___
 / __|_   _| | | | _ \/ __| by ZALANDO
 \__ \ | | | |_| |  _/\__ \
 |___/ |_|  \___/|_|  |___/

 STUPS - To Unleash Penguin Swarms

 Homepage:      https://stups.io
 Documentation: https://docs.stups.io
 GitHub Repos:  https://github.com/zalando-stups

Trying to autoconfigure zalando-token-cli.. OK
Trying to autoconfigure zalando-aws-cli.. OK
Trying to autoconfigure zalando-kubectl.. OK
Trying to autoconfigure zalando-deploy-cli.. OK
Checking https://pierone.stups.zalan.do.. OK
Checking https://even.stups.zalan.do.. OK
Checking https://fullstop.stups.zalan.do.. OK
Checking https://kio.stups.zalan.do.. OK
Writing global config.. OK
Writing config for Pier One.. OK
Traceback (most recent call last):
  File "/usr/local/bin/stups", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/stups/cli.py", line 28, in main
    stups_cli.config.configure(domain)
  File "/usr/local/lib/python3.6/dist-packages/stups_cli/config.py", line 107, in configure
    with Action('Writing config for Pi\xf9..'):
  File "/usr/local/lib/python3.6/dist-packages/clickclick/console.py", line 102, in __enter__
    action(self.msg, **self.msg_args)
  File "/usr/local/lib/python3.6/dist-packages/clickclick/console.py", line 53, in action
    secho(msg.format(**kwargs), nl=False, bold=True)
  File "/usr/local/lib/python3.6/dist-packages/clickclick/console.py", line 49, in secho
    click.secho(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/termui.py", line 478, in secho
    return echo(message, file=file, nl=nl, err=err, color=color)
  File "/usr/local/lib/python3.6/dist-packages/click/utils.py", line 260, in echo
    file.write(message)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf9' in position 25: ordinal not in range(128)

This was because apparently the locale set, en_DE.UTF-8 was not supported by my distro. When set to en_US.UTF-8, supported by my distro:

msoos@ZM:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_GB
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
msoos@ZM:~$ stups configure

  ___ _____ _   _ ___  ___
 / __|_   _| | | | _ \/ __| by ZALANDO
 \__ \ | | | |_| |  _/\__ \
 |___/ |_|  \___/|_|  |___/

 STUPS - To Unleash Penguin Swarms

 Homepage:      https://stups.io
 Documentation: https://docs.stups.io
 GitHub Repos:  https://github.com/zalando-stups

Trying to autoconfigure zalando-token-cli.. OK
Trying to autoconfigure zalando-aws-cli.. OK
Trying to autoconfigure zalando-kubectl.. OK
Trying to autoconfigure zalando-deploy-cli.. OK
Checking https://pierone.stups.zalan.do.. OK
Checking https://even.stups.zalan.do.. OK
Checking https://fullstop.stups.zalan.do.. OK
Checking https://kio.stups.zalan.do.. OK
Writing global config.. OK
Writing config for Pier One.. OK
Writing config for Più.. OK
Writing config for Fullstop.. OK
Writing config for Kio.. OK
Writing config for Zalando Token CLI.. OK
Writing config for Zalando AWS CLI.. OK
Writing config for Zalando Kubectl.. OK
Writing config for Zalando Deploy CLI.. OK

So as you can see, the "u" was a big issue. I am wondering if we could remove that weird "u"? I am not sure if it's really necessary to print it :D Debugging this was not that painful for me, as I had help (thanks everyone in the AWS chat) but maybe it would be for someone with less help or experience? That python error is... not exactly helpful :) Would it be a big deal to change the printed name to have the "u" without the accent?

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

No branches or pull requests

1 participant