summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorishepard <spadini.davide@gmail.com>2019-09-16 08:15:03 (GMT)
committerSebastian Thiel <byronimo@gmail.com>2019-09-16 08:49:16 (GMT)
commit3d7eaf1253245c6b88fd969efa383b775927cdd0 (patch)
tree7a563820c59256ac5551e8af4af9ca7a8685fdd8
parenta2d8a5144bd8c0940d9f2593a21aec8bebf7c035 (diff)
downloadgitpython-3d7eaf1253245c6b88fd969efa383b775927cdd0.tar.gz
fix decoding problem
-rw-r--r--git/objects/commit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py
index 9736914..916a108 100644
--- a/git/objects/commit.py
+++ b/git/objects/commit.py
@@ -484,7 +484,8 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
buf = enc.strip()
while buf:
if buf[0:10] == b"encoding ":
- self.encoding = buf[buf.find(' ') + 1:].decode('ascii')
+ self.encoding = buf[buf.find(' ') + 1:].decode(
+ self.encoding, 'ignore')
elif buf[0:7] == b"gpgsig ":
sig = buf[buf.find(b' ') + 1:] + b"\n"
is_next_header = False
@@ -498,7 +499,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
break
sig += sigbuf[1:]
# end read all signature
- self.gpgsig = sig.rstrip(b"\n").decode('ascii')
+ self.gpgsig = sig.rstrip(b"\n").decode(self.encoding, 'ignore')
if is_next_header:
continue
buf = readline().strip()