diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-20 07:43:19 -0600 |
---|---|---|
committer | Harmon <Harmon758@gmail.com> | 2020-02-20 07:46:40 -0600 |
commit | a244bd15bcd05c08d524ca9ef307e479e511b54c (patch) | |
tree | 2035225e81f2275d8f84aa19c86f2224fa7c07ee | |
parent | 863abe8b550d48c020087384d33995ad3dc57638 (diff) | |
download | gitpython-a244bd15bcd05c08d524ca9ef307e479e511b54c.tar.gz |
Replace invalid bytes when decoding TagObject stream
Fixes #943
-rw-r--r-- | doc/source/changes.rst | 2 | ||||
-rw-r--r-- | git/objects/tag.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 4aa55275..31c91c6c 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -13,6 +13,8 @@ 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>`_) +* Fixed decoding of tag object message so as to replace invalid bytes + (`#943 <https://github.com/gitpython-developers/GitPython/issues/943>`_) 3.0.8 ===== diff --git a/git/objects/tag.py b/git/objects/tag.py index 017c4988..b9bc6c24 100644 --- a/git/objects/tag.py +++ b/git/objects/tag.py @@ -50,7 +50,7 @@ class TagObject(base.Object): """Cache all our attributes at once""" if attr in TagObject.__slots__: ostream = self.repo.odb.stream(self.binsha) - lines = ostream.read().decode(defenc).splitlines() + lines = ostream.read().decode(defenc, 'replace').splitlines() _obj, hexsha = lines[0].split(" ") _type_token, type_name = lines[1].split(" ") |