Skip to content

Commit a244bd1

Browse files
committed
Replace invalid bytes when decoding TagObject stream
Fixes #943
1 parent 863abe8 commit a244bd1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: doc/source/changes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Bugfixes
1313

1414
* Changed to use UTF-8 instead of default encoding when getting information about a symbolic reference
1515
(`#774 <https://github.com/gitpython-developers/GitPython/issues/774>`_)
16+
* Fixed decoding of tag object message so as to replace invalid bytes
17+
(`#943 <https://github.com/gitpython-developers/GitPython/issues/943>`_)
1618

1719
3.0.8
1820
=====

Diff for: git/objects/tag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _set_cache_(self, attr):
5050
"""Cache all our attributes at once"""
5151
if attr in TagObject.__slots__:
5252
ostream = self.repo.odb.stream(self.binsha)
53-
lines = ostream.read().decode(defenc).splitlines()
53+
lines = ostream.read().decode(defenc, 'replace').splitlines()
5454

5555
_obj, hexsha = lines[0].split(" ")
5656
_type_token, type_name = lines[1].split(" ")

0 commit comments

Comments
 (0)