git-loc
git-loc copied to clipboard
Problems with encoding in git output
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?
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.
That's my guess, too. I'm not sure which message is the culprit here, so I can't say for certain.