jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
534 stars 47 forks source link

UnicodeDecodeError: #76

Closed modaye closed 2 years ago

modaye commented 2 years ago

Error getting user name through Git

Exception in thread Thread-7:
Traceback (most recent call last):
  File "c:\users\mag\appdata\local\programs\python\python39\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "c:\users\mag\appdata\local\programs\python\python39\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\mag\appdata\local\programs\python\python39\lib\subprocess.py", line 1479, in _readerthread
    buffer.append(fh.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0xbe in position 8: illegal multibyte sequence

It happens in GIT_ utils.py line 66 The error stack has no idea where the error is

image 中文: 我添加了encoding=utf-8

jimporter commented 2 years ago

Hmm, it seems that git returns the username in UTF-8 no matter what the current locale is. I'll have to see how this applies to other git commands, since this could be an issue any time we read output from git...