-
Notifications
You must be signed in to change notification settings - Fork 23
[SUBLACK] Black did not run succesfully: Click was configured to use ASCII as encoding for the environment. #2
Comments
Does this possible fix work for you? |
@jgirardet @nicokist Yep the fix_click_locale branch on your fork works correctly for me! Thanks a bunch! 👍 |
I'm afraid not. Somehow on our systems the locale is None:
Perhaps you could check for that and set LC_ALL only |
I've checked, the following works for me:
|
If don't know if this fix will work if the user is not in "en_US.UTF-8". We have to find a way to get the local under macos which macos version do you use ? it seems it's an old python bug |
I did not find much about it.
|
I'm on 10.13.4 If I use a non-english language I actually hit a crash earlier:
probably because sublime is now getting confused about the encoding:
but setting |
Your latest commit works for me. I think the undefined encoding was due to me trying switching languages while testing using the same file, it didn't recur when I created new files. |
after some reading : there a pep about cross platform locale setting : https://www.python.org/dev/peps/pep-0538/ (python3.7) The pep explains the best way to achieve this on osx is to set and tell me if it's good. thanks for help |
Still works. |
ok to keep it simple I removed,the locale settings. If someone has same problem on other platform, I will deal with it in the code.
thank for help guys |
It should be fixed now but I let It opened for now if other users encounter same problem. |
To anybody having this issue in 2019.
|
hi, |
hey well I had the same problem with this error on max os ValueError: unknown locale: UTF-8 To fix it I need to do the following in sublime console: import os
os.environ['LC_ALL'] = 'en_US.UTF-8'
os.environ['LANG'] = 'en_US.UTF-8' To make it permament, I needed to edit sublack code and I gave an instuction how to do that above. |
Hi. thank for the details. def get_env():
# modifying the locale is necessary to keep the click library happy on OSX
env = os.environ.copy()
if locale.getdefaultlocale() == (None, None):
if sublime.platform() == "osx":
env["LC_CTYPE"] = "UTF-8"
return env You have a different kind of trouble since your system seems to not be aware of UTF-8 but en_US.UTF-8. I have 2 questions about it.
|
I had this problem and
solved it. To solve it permanently I ran
once in my fish shell. Answers to your questions @jgirardet below
No, it doesn't. I had
|
Operating system: macOS
Python version: 3.6
Black version: black, version 18.4a4
Sublime Text version: 3.0 build 3170
Sulbime Console output on save:
Sublime Project settings:
The text was updated successfully, but these errors were encountered: