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

"Setting locale failed" after update to 2.1.0-canary.2 #3091

Closed
2 tasks done
timomeh opened this issue Jun 18, 2018 · 12 comments
Closed
2 tasks done

"Setting locale failed" after update to 2.1.0-canary.2 #3091

timomeh opened this issue Jun 18, 2018 · 12 comments
Labels
🐛 Type: Bug Issue pertains to something wrong within Hyper 🦉 Version: Canary Issue is about something in the canary release of Hyper

Comments

@timomeh
Copy link

timomeh commented Jun 18, 2018

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: macOS High Sierra 10.13.4
  • Hyper.app version: 2.1.0-canary.2
  • Link of a Gist with the contents of your .hyper.js: https://gist.github.com/timomeh/43d41685f55ee530018e91c45ee943b5
  • Relevant information from devtools (CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere): N/A
  • The issue is reproducible in vanilla Hyper.app: If "vanilla" means without plugins, then yes, it can be reproduced. If "vanilla" means a non-canary version, then no, it cannot be reproduced.

Issue

After updating to 2.1.0-canary.2, I get the following message in my shell when starting a new session:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "en_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

This can't be reproduced in Terminal.app, and if I go back to 2.1.0-canary.1, the issue is gone.

It seems like #2913 could introduce this issue.

@ataias
Copy link

ataias commented Jun 18, 2018

I am having the same problem. I think the only config that is different is that I am on macOS 10.13.5.

@chabou
Copy link
Collaborator

chabou commented Jun 19, 2018

Can you execute locale command and attach the result?
Can you compare with Terminal.app output for the same command?

@timomeh
Copy link
Author

timomeh commented Jun 19, 2018

locale on Hyper:

> locale
LANG="en_DE.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

locale on Terminal.app:

> locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

@chabou
Copy link
Collaborator

chabou commented Jun 19, 2018

ok I think this is related to your os configuration. You've certainly set english language with germany as Region. Thus detected locale is en_DE and it doesn't exist.

Several workaround exists (in your case, something like sudo echo en_DE.UTF-8 en_US.UTF-8 >> /usr/share/locale/locale.alias to define en_DE as an alias of en_US) but I think that we must validate locale before setting it.

@timomeh
Copy link
Author

timomeh commented Jun 19, 2018

Thanks for your response. For now I added LC_ALL and LANG to my zshrc, instead of sudo-ing around.

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

But I agree, setting a non-configured locale shouldn't happen.

@ataias
Copy link

ataias commented Jun 19, 2018

Fixed for me with the same thing that @timomeh has done.

@pseudocubic
Copy link

pseudocubic commented Jun 19, 2018

I am also having a problem related to this. In my case I get the following error when trying to source activate conda-env

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/Users/uname/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 98, in main
        return activator_main()
      File "/Users/uname/anaconda3/lib/python3.6/site-packages/conda/activate.py", line 584, in main
        print(activator.execute(), end='')
     UnicodeEncodeError: 'ascii' codec can't encode character '\u279c' in position 152: ordinal not in range(128)

I am on MacOS 10.13.5, also using ZSH. The output of locale in hyper.app is

LANG="en_US.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

and in Terminal.app

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

I can also reproduce the error with Perl mentioned above.

@chabou
Copy link
Collaborator

chabou commented Jun 20, 2018

@pseudocubic can you confirm that your error doesn't happen on Terminal.app and on stable Hyper?

@pseudocubic
Copy link

Yes, I can confirm that both Terminal.app and stable Hyper (2.0.0) both work fine, and even up to 2.1.0-canary.1 works, its only 2.1.0-canary.2 that this has become a problem

@albinekb albinekb added 🐛 Type: Bug Issue pertains to something wrong within Hyper 🦉 Version: Canary Issue is about something in the canary release of Hyper labels Jun 20, 2018
@pi0
Copy link
Contributor

pi0 commented Dec 16, 2018

I can confirm this bug too (#2913 (comment)). IMO setting lang to EN and having a differrent locale is not an os misconfiguration. We should somehow validate locale to prevent invalid default computed values like en_IR.UTF-8

@pi0
Copy link
Contributor

pi0 commented Dec 16, 2018

Should be hopefully fixed by sindresorhus/os-locale#33

@chabou
Copy link
Collaborator

chabou commented Dec 16, 2018

@pi0 thank you for this PR on the right place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Issue pertains to something wrong within Hyper 🦉 Version: Canary Issue is about something in the canary release of Hyper
Projects
None yet
Development

No branches or pull requests

6 participants