starcraftman / zsh-git-prompt

[Active Fork] Informative git prompt for zsh
MIT License
58 stars 15 forks source link

git_status.py displays error on non-english git #32

Open fabienduhamel opened 6 years ago

fabienduhamel commented 6 years ago

First, nice job for this repository (I come from olivierverdier's repository).

git_status.py displays this error in shell:

Traceback (most recent call last):                                                                                                                                              
  File "/home/fduhamel/.oh-my-zsh/custom/plugins/zsh-git-prompt/gitstatus.py", line 244, in <module>
    main()
  File "/home/fduhamel/.oh-my-zsh/custom/plugins/zsh-git-prompt/gitstatus.py", line 225, in main
    err = u'\n'.join(lines)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 32: ordinal not in range(128)

I've found that my Git execution language is French, which does not validate this test:

# git_status.py:233
if err.lower().startswith('fatal: not a git repository'):

If I export LANGUAGE=en_US.UTF-8, everything is OK. Either the execution should force it in english or the test should be rewritten.