git-loc icon indicating copy to clipboard operation
git-loc copied to clipboard

Problems with encoding in git output

Open milgner opened this issue 12 years ago • 2 comments

I just tried to run this on a repo and it aborted with the following error:

Traceback (most recent call last):
  File "c:/Users/Marcus/Desktop/git-loc.py", line 42, in <module>
    for x in popen('git log --no-color --reverse -p'):
  File "c:\Python33\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1162: cha
racter maps to <undefined>

I unfortunately don't know my way around Python but I found this ticket which has been marked as "WontFix". But probably there's some way around it?

milgner avatar Dec 04 '13 16:12 milgner

Seems like your commit message is in utf8, by python wants cp1252. Is it a case?

I don't have windows to test if this is a case.

ITikhonov avatar Dec 05 '13 10:12 ITikhonov

That's my guess, too. I'm not sure which message is the culprit here, so I can't say for certain.

milgner avatar Dec 05 '13 10:12 milgner