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 — Unicode characters in branch name · Issue #774 · gitpython-developers/GitPython

Unicode characters in branch name #774

New issue
Copy link
New issue
Copy link
Closed
Closed
Unicode characters in branch name#774
Copy link
Labels
acknowledged
Milestone
v3.0.9 - Bugfixes

Description

@timqsh
timqsh
opened on Jun 19, 2018
Issue body actions

Hi! I an trying to get diffs using GitPython, and i have an issue when branch name have unicode characters.

Here is repo where bug can be reproduced:
https://github.com/timqsh/test_git_python
branch:
МояВетка

when i run this code:

repo = git.Repo('.')
HEAD = repo.head.commit

i get this error:

Traceback (most recent call last):
  File ".\test.py", line 4, in <module>
    HEAD = repo.head.commit
  File "C:\Users\kushukov\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\refs\symbolic.py", line 200, in _get_commit
    obj = self._get_object()
  File "C:\Users\kushukov\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\refs\symbolic.py", line 193, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "C:\Users\kushukov\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\refs\symbolic.py", line 135, in dereference_recursive
    hexsha, ref_path = cls._get_ref_info(repo, ref_path)
  File "C:\Users\kushukov\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\refs\symbolic.py", line 184, in _get_ref_info
    return cls._get_ref_info_helper(repo, ref_path)
  File "C:\Users\kushukov\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\refs\symbolic.py", line 167, in _get_ref_info_helper
    raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/heads/Р\u045aР\u0455С\u040fР\u2019Р\xb5С\u201aРєР°' does not exist

I am testing this on Windows 10.

forgot to add:
GitPython 2.1.10

Reacted by Patrick Decat

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Jul 15, 2018
  2. Byron commented on Jul 15, 2018

    @Byron
    Byron
    on Jul 15, 2018
    Member
    More actions

    Thanks for letting us know. It's a known issue that unicode usually breaks GitPython in various ways, it wasn't written with that in mind and back in the days, unicode wasn't something that one would become aware of during implementation.

  3. Harmon758
    added 2 commits that reference this issue on Feb 18, 2020

    Use UTF-8 encoding when getting information about a symbolic reference

    This issue will close once commit 4e473a3 is merged into the 'master' branch.
    4e473a3

    Use UTF-8 encoding when getting information about a symbolic reference

    This issue will close once commit 863abe8 is merged into the 'master' branch.
    863abe8
  4. Harmon758
    closed this as completedin 863abe8on Feb 18, 2020
  5. Harmon758
    removed
    help wanted
    on Feb 18, 2020
  6. Byron
    added this to the v3.0.9 - Bugfixes milestone on Feb 19, 2020
  7. wip-sync
    added a commit that references this issue on Mar 7, 2020

    py-git: update to 3.1.0.

    cc95dab
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

    No type

    Projects

    No projects

      Milestone

      • v3.0.9 - Bugfixes

      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.