summaryrefslogtreecommitdiff
path: root/git/objects/commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-04 15:39:28 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-04 15:39:28 +0100
commit6f55c17f48d7608072199496fbcefa33f2e97bf0 (patch)
treed6c69f667f3cce87d3fe5bf9baa62a081f4af7a8 /git/objects/commit.py
parent1b9d3b961bdf79964b883d3179f085d8835e528d (diff)
downloadgitpython-6f55c17f48d7608072199496fbcefa33f2e97bf0.tar.gz
Replaced ordered dict with standard version; used logging module
All performance tests still print to stderr, but do so in a py3 compatible way
Diffstat (limited to 'git/objects/commit.py')
-rw-r--r--git/objects/commit.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py
index 4a4a314c..9c733695 100644
--- a/git/objects/commit.py
+++ b/git/objects/commit.py
@@ -31,7 +31,9 @@ from time import (
altzone
)
import os
-import sys
+import logging
+
+log = logging.getLogger('git.objects.commit')
__all__ = ('Commit', )
@@ -473,16 +475,16 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
try:
self.author.name = self.author.name.decode(self.encoding)
except UnicodeDecodeError:
- print >> sys.stderr, "Failed to decode author name '%s' using encoding %s" % (
- self.author.name, self.encoding)
+ log.error("Failed to decode author name '%s' using encoding %s", self.author.name, self.encoding,
+ exc_info=True)
# END handle author's encoding
# decode committer name
try:
self.committer.name = self.committer.name.decode(self.encoding)
except UnicodeDecodeError:
- print >> sys.stderr, "Failed to decode committer name '%s' using encoding %s" % (
- self.committer.name, self.encoding)
+ log.error("Failed to decode committer name '%s' using encoding %s", self.committer.name, self.encoding,
+ exc_info=True)
# END handle author's encoding
# a stream from our data simply gives us the plain message
@@ -491,7 +493,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
try:
self.message = self.message.decode(self.encoding)
except UnicodeDecodeError:
- print >> sys.stderr, "Failed to decode message '%s' using encoding %s" % (self.message, self.encoding)
+ log.error("Failed to decode message '%s' using encoding %s", self.message, self.encoding, exc_info=True)
# END exception handling
return self