Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf-8 branch name issue in SymbolicReference._get_ref_info_helper #954

Closed
grho opened this issue Oct 24, 2019 · 2 comments
Closed

utf-8 branch name issue in SymbolicReference._get_ref_info_helper #954

grho opened this issue Oct 24, 2019 · 2 comments

Comments

@grho
Copy link

grho commented Oct 24, 2019

Hi,
a branch is shown incorrectly when contains utf-8 characters

Branch name:
refs/heads/zażółć_gęślą_jaźń

The issue can be fixed by adding encoding in SymbolicReference._get_ref_info_helper.
Proposed change:
Replace

with open(osp.join(repodir, ref_path), 'rt') as fp:

Current result (e.g. shown as active_branch):
refs/heads/zażółć_gęślą_jaźń

with

with open(osp.join(repodir, ref_path), 'rt', encoding="utf-8") as fp:

Expected result:
refs/heads/zażółć_gęślą_jaźń

@Byron
Copy link
Member

Byron commented Oct 28, 2019

Thanks for letting me know! Unfortunately, GitPython is full of encoding issues, and even though assuming UTF-8 isn't technically a perfect fix, it's definitely an improvement over using ASCII implicitly.

I would be happy to receive a PR for that.

@Harmon758
Copy link
Member

Duplicate of #774

@Harmon758 Harmon758 marked this as a duplicate of #774 Feb 18, 2020
@Byron Byron added this to the v3.0.9 - Bugfixes milestone Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants