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

hotfix for os-locale on some windows platforms #240

Merged
merged 2 commits into from
Aug 28, 2015
Merged

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Aug 28, 2015

If os-locale throws, we will now default to en when detecting locale.

CC: @sindresorhus, @kevinsawicki, @MatthewNewland

@@ -531,6 +531,14 @@ function Argv (processArgs, cwd) {
return argv
}

function guessLocale () {
try {
return osLocale.sync()

Choose a reason for hiding this comment

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

This is still a bit worrisome for Atom's case where app startup time is critical and this call execs processes synchronously.

Copy link
Member Author

Choose a reason for hiding this comment

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

two options I see:

  1. is there an environment variable I can detect and flip this feature off specifically for Atom.
  2. what if I add an option .detectLocale(false)?

Shall I release this in the interim to fix the exception?

Choose a reason for hiding this comment

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

Shall I release this in the interim to fix the exception?

I think Atom will just pin to version 3.19.0 for now and cut a new release.

Just a heads up, earlier this week we moved apm to use 3.19.0 as well because of issues with long paths on Windows introduced by the os-locale addition. I know this is a Windows issues, but I just wanted to mention it in case you came across it on that repo.

what if I add an option .detectLocale(false)?

👍 That seems good

Copy link
Member

Choose a reason for hiding this comment

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

It only spawns when neither of the following environment variables are defined:

env.LC_ALL || env.LANGUAGE || env.LANG || env.LC_MESSAGES

Might be a good idea to add an option to os-locale to prevent spawning {spawn: false}?

sindresorhus added a commit to sindresorhus/os-locale that referenced this pull request Aug 28, 2015
@sindresorhus
Copy link
Member

Fixed in os-locale 1.2.1. Weird, I thought wmic were available everywhere.

I guess this PR still makes sense though, just in case.

@bcoe
Copy link
Member Author

bcoe commented Aug 28, 2015

@kevinsawicki @sindresorhus I'm going to get this hot fix out the door so that we're not breaking anything on Windows, we can discuss in this thread:

#241

bcoe added a commit that referenced this pull request Aug 28, 2015
hotfix for os-locale on some windows platforms
@bcoe bcoe merged commit a45cc3b into master Aug 28, 2015
@bcoe bcoe deleted the hotfix-for-atom branch August 28, 2015 20:54
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