Skip to content

Commit 7548a5c

Browse files
committed
Merge pull request #459 from andy-maier/fix-457-typerror-on-py26
Fixes #457: 'TypeError: decode() takes no keyword arguments' on Python 2.6
2 parents 2219f13 + 55969cb commit 7548a5c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/source/changes.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Changelog
55
2.0.6 - Fixes
66
=============
77

8-
* ...
8+
* Fix: TypeError about passing keyword argument to string decode() on
9+
Python 2.6.
910

1011
2.0.5 - Fixes
1112
=============

git/objects/commit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ def _deserialize(self, stream):
501501

502502
try:
503503
self.author, self.authored_date, self.author_tz_offset = \
504-
parse_actor_and_date(author_line.decode(self.encoding, errors='replace'))
504+
parse_actor_and_date(author_line.decode(self.encoding, 'replace'))
505505
except UnicodeDecodeError:
506506
log.error("Failed to decode author line '%s' using encoding %s", author_line, self.encoding,
507507
exc_info=True)
508508

509509
try:
510510
self.committer, self.committed_date, self.committer_tz_offset = \
511-
parse_actor_and_date(committer_line.decode(self.encoding, errors='replace'))
511+
parse_actor_and_date(committer_line.decode(self.encoding, 'replace'))
512512
except UnicodeDecodeError:
513513
log.error("Failed to decode committer line '%s' using encoding %s", committer_line, self.encoding,
514514
exc_info=True)
@@ -518,7 +518,7 @@ def _deserialize(self, stream):
518518
# The end of our message stream is marked with a newline that we strip
519519
self.message = stream.read()
520520
try:
521-
self.message = self.message.decode(self.encoding, errors='replace')
521+
self.message = self.message.decode(self.encoding, 'replace')
522522
except UnicodeDecodeError:
523523
log.error("Failed to decode message '%s' using encoding %s", self.message, self.encoding, exc_info=True)
524524
# END exception handling

0 commit comments

Comments
 (0)