summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmon <Harmon758@gmail.com>2020-02-18 12:51:03 -0600
committerHarmon <Harmon758@gmail.com>2020-02-18 12:55:47 -0600
commit863abe8b550d48c020087384d33995ad3dc57638 (patch)
treeda4442dee29f7a0c822abe174929327e4f658dbb
parent84c3f60fc805e0d5e5be488c4dd0ad5af275e495 (diff)
downloadgitpython-863abe8b550d48c020087384d33995ad3dc57638.tar.gz
Use UTF-8 encoding when getting information about a symbolic reference
Fixes #774
-rw-r--r--doc/source/changes.rst6
-rw-r--r--git/refs/symbolic.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst
index 539f9a3d..4aa55275 100644
--- a/doc/source/changes.rst
+++ b/doc/source/changes.rst
@@ -8,6 +8,12 @@ Unreleased
* Restricted GitDB (gitdb2) version requirement to < 4
* Removed old nose library from test requirements
+Bugfixes
+--------
+
+* Changed to use UTF-8 instead of default encoding when getting information about a symbolic reference
+ (`#774 <https://github.com/gitpython-developers/GitPython/issues/774>`_)
+
3.0.8
=====
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py
index 4784197c..aa449528 100644
--- a/git/refs/symbolic.py
+++ b/git/refs/symbolic.py
@@ -142,7 +142,7 @@ class SymbolicReference(object):
tokens = None
repodir = _git_dir(repo, ref_path)
try:
- with open(osp.join(repodir, ref_path), 'rt') as fp:
+ with open(osp.join(repodir, ref_path), 'rt', encoding='UTF-8') as fp:
value = fp.read().rstrip()
# Don't only split on spaces, but on whitespace, which allows to parse lines like
# 60b64ef992065e2600bfef6187a97f92398a9144 branch 'master' of git-server:/path/to/repo