From 863abe8b550d48c020087384d33995ad3dc57638 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 18 Feb 2020 12:51:03 -0600 Subject: Use UTF-8 encoding when getting information about a symbolic reference Fixes #774 --- doc/source/changes.rst | 6 ++++++ git/refs/symbolic.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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 `_) + 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 -- cgit v1.2.1