-
Notifications
You must be signed in to change notification settings - Fork 268
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
VSCode Extension overrides LANG settings unconditionally, leading to non-working Python locale #814
Comments
sigh I was looking everywhere and couldn't find that. I can't reproduce it right now, it might have something to do with a cold open? I'll see if I can reproduce this tomorrow, usually I seem to get it once every so often, and when I do I'll post here! |
Hah, I just found a failure after returning from (computer's) sleep:
But the |
I think I found something, but it might even be a VSCode/WSL problem, I'm not sure. Most of the invocations of When
|
Thanks for the info! I think you can enable the locale in WSL via:
The setlocale logic might be unnecessary. If so, we might want to remove it. |
Yeah I'm unfortunately quite aware of the glibc locale generation, so that as a workaround would work. But I also just found sapling/addons/isl-server/src/Repository.ts Line 1211 in c2d958b
|
Thanks! I'll update the related logic to not assume |
I think the easiest would be to use C.UTF-8 which AFAIR is always present, as it doesn't require generating any locale. |
glibc does not generate all combinations of locales by default, and Python fails when requesting to enforce a locale that does not exist. Since the extension is not caring for the translation chosen, but rather only trying to enforce UTF-8 support, use the C.UTF-8 locale which is guaranteed to exist as per https://www.gnu.org/software/libc/manual/html_node/Choosing-Locale.html Fixes facebook#814 where VSCode would intermittently be unable to identify a valid Sapling checkout and/or pull from a repository.
Summary: See #814. The "en_US.UTF-8" locale is not always valid. WSL uses `C.UTF-8` locale. Change the `LANG` environment calculation to: - Respect users' LANG setting if it's already UTF-8. - Fallback to `C.UTF-8` instead of `en_US.UTF-8`, which works in WSL. Reviewed By: evangrayk Differential Revision: D52927838 fbshipit-source-id: c9110437e00382bb84e50d6b141fe5d4ce69f813
I'm not sure how to gather more debug information, but the VSCode extension appears to sometimes not detect correctly that the open folder is a valid Sapling checkout:
opening a different folder and going back to the original appears to fix it, but I have no idea why is that even the case.
The text was updated successfully, but these errors were encountered: