Skip to content

Fix GitPython on systems with language != english #68

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

Merged
merged 1 commit into from
Jul 24, 2012

Conversation

FlorianLudwig
Copy link

Currently GitPython only works on systems with language set to English. If the language is set to any other it fails silently.

This pull request provides a simple fix by settings the environment variable LANG to "C" for subprocess calls to the git executable.

@sigmavirus24
Copy link

Out of curiosity, what does setting it to 'C' do exactly that makes this work?

@FlorianLudwig
Copy link
Author

See for example: http://superuser.com/questions/219945/why-lang-c-not-d-or-e-or-f

To my knowledge "C" always gives you untranslated strings and so on every system the same; also important when parsing dates etc. So you get the English output from git. By using "C" instead of say en_US.utf8 I hoped to avoid using a LANG that might be unavailable.

@sigmavirus24
Copy link

Thanks for the explanation. My quick search this morning didn't come up with much and then I had to walk to work.

@Byron
Copy link
Member

Byron commented Jul 24, 2012

Thank you very much for pointing this out. Its quite amazing that I as a german dude never noticed it on my various english operating systems :).

Besides that, do you think you can create another pull request for the 0.3 branch ? The code there would probably have the same problem.

In any way, thanks a lot,
Sebastian

Byron added a commit that referenced this pull request Jul 24, 2012
Fix GitPython on systems with language != english
@Byron Byron merged commit 011d89d into gitpython-developers:master Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants