Skip to content

Commit 4e473a3

Browse files
committed
Use UTF-8 encoding when getting information about a symbolic reference
Fixes gitpython-developers#774
1 parent 84c3f60 commit 4e473a3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: doc/source/changes.rst

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Unreleased
88
* Restricted GitDB (gitdb2) version requirement to < 4
99
* Removed old nose library from test requirements
1010

11+
Bugfixes
12+
--------
13+
14+
* Changed to use UTF-8 instead of default encoding when getting information about a symbolic reference
15+
(`#774 <https://github.com/gitpython-developers/GitPython/issues/774>`_)
16+
1117
3.0.8
1218
=====
1319

Diff for: git/refs/symbolic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _get_ref_info_helper(cls, repo, ref_path):
142142
tokens = None
143143
repodir = _git_dir(repo, ref_path)
144144
try:
145-
with open(osp.join(repodir, ref_path), 'rt') as fp:
145+
with open(osp.join(repodir, ref_path), 'rt', encoding = 'UTF-8') as fp:
146146
value = fp.read().rstrip()
147147
# Don't only split on spaces, but on whitespace, which allows to parse lines like
148148
# 60b64ef992065e2600bfef6187a97f92398a9144 branch 'master' of git-server:/path/to/repo

0 commit comments

Comments
 (0)