Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74cb7af

Browse files
committed
by default file opens in default locale, it throw exception with unicode branch names with calling repo.branch
1 parent 2ac9c19 commit 74cb7af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/refs/symbolic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _iter_packed_refs(cls, repo):
9090
"""Returns an iterator yielding pairs of sha1/path pairs (as bytes) for the corresponding refs.
9191
:note: The packed refs file will be kept open as long as we iterate"""
9292
try:
93-
with open(cls._get_packed_refs_path(repo), 'rt') as fp:
93+
with open(cls._get_packed_refs_path(repo), 'rt', encoding='utf-8') as fp:
9494
for line in fp:
9595
line = line.strip()
9696
if not line:

0 commit comments

Comments
 (0)