Python version 3.11.3 When I use gitpython, my codes like below
os.environ["PYTHONIOENCODING"] = "utf-8"
os.environ["PYTHONUFT8"] = "on"
repo = Repo(repo_path)
remote = repo.remote()
remote.fetch()
if there is a branch named with Chinese like "测试分支", it will throw error
git.exc.CommandError: Cmd('<stderr-pump>') failed due to: UnicodeDecodeError(''gbk' codec can't decode byte 0xad in position 54: illegal multibyte sequence')
I know it's an encoding problem, I've already set PYTHONUTF8=1 and PYTHONIOENCODING='utf-8',but it doesn't work.
- Does
fetchmethod have any params likeencoding='utf-8'? - How could I use fetch with utf-8?
- Why does it auto choose gbk?