GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error using Chinese path or Chinese branch name · Issue #1362 · gitpython-developers/GitPython

Error using Chinese path or Chinese branch name #1362

New issue
Copy link
New issue
Copy link
Closed as not planned
Bug
Closed as not planned
Error using Chinese path or Chinese branch name#1362
Bug
Copy link
Labels
acknowledged

Description

@xunmi-git
xunmi-git
opened on Oct 19, 2021
Issue body actions

Environmental Information

Windows10
Python3.8
GitPython 3.1.24

Error 1

Chinese path:

git.Repo.clone_from(url="[email protected]:xun-mi-git/test-x.git", to_path="C:\\Users\\asus\\3D Objects\\个人项目\\test")

Error message

Exception in thread Thread-6:
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1370, in _readerthread
    buffer.append(fh.read())
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 41: illegal multibyte sequence

screenshot

寻觅_20210619020652

Error 2

Chinese branch:

    git.Repo.clone_from(url="[email protected]:xun-mi-git/test-x.git", to_path="C:\\test")
    a = Repo("C:\\test").remotes[0]
    for i in a.refs:
        print(i.name)
    a = a.pull()

Error message

origin/HEAD
origin/默认分支
Exception in thread Thread-7:
Traceback (most recent call last):
  File "C:\Users\asus\3D Objects\Python环境\常用通用库\lib\site-packages\git\cmd.py", line 109, in pump_stream
    for line in stream:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 58: illegal multibyte sequence

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\asus\3D Objects\Python环境\常用通用库\lib\site-packages\git\cmd.py", line 122, in pump_stream
    raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex
git.exc.CommandError: Cmd('<stderr-pump>') failed due to: UnicodeDecodeError(''gbk' codec can't decode byte 0xae in position 58: illegal multibyte sequence')
  cmdline: <stderr-pump> git pull -v origin

screenshot

寻觅_20213119023148

Activity

  1. xunmi-git commented on Oct 19, 2021

    @xunmi-git
    xunmi-git
    on Oct 19, 2021
    Author
    More actions

    Use if required:[email protected]:xun-mi-git/test-x.gitThis library test

  2. Byron
    added
    acknowledged
    on Oct 20, 2021
  3. Byron commented on Oct 20, 2021

    @Byron
    Byron
    on Oct 20, 2021
    Member
    More actions

    Thanks for this wonderful issue! I am sorry to say that dealing with encodings is a mess in GitPython. The examples above seem to indicate that it tries to see things as strings but doesn't get their encoding right. Probably it should just use UTF-8 instead of gbk.

    Maybe as a workaround, the default encoding of the python interpreter can be set to utf-8.

  4. Byron
    added the
    Bug
    issue type on Jul 20, 2026
  5. Byron
    closed this as not plannedon Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledged

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.