summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-02-03 21:10:45 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-02-03 21:10:45 +0100
commit4af398f3c010e244ba7014dee3375b0e2a612930 (patch)
treeda13f19e765e50481c4f0bec5b7f8ab7e64d5db9
parent4c171bf0e82c15437317cebda4008aacd944c36e (diff)
Use 'replace' for errors in str.encode().
-rwxr-xr-xgitnoti.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gitnoti.py b/gitnoti.py
index 5d5f186..db39ce1 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -88,9 +88,9 @@ def repo_commit_msg(repo, branch, commits):
reponame,
('/'+branch) if branch else '',
commit.hexsha[:7],
- commit.committer.name if commit.author.name.encode('utf8') == commit.committer.name else '%s/%s' % (commit.committer.name, commit.author.name.encode('utf8')),
+ commit.committer.name if commit.author.name.encode('utf8', 'replace') == commit.committer.name else '%s/%s' % (commit.committer.name, commit.author.name.encode('utf8', 'replace')),
stat,
- commit.summary.encode('utf8')
+ commit.summary.encode('utf8', 'replace')
)
if options.url:
@@ -106,7 +106,7 @@ def repo_commit_msg(repo, branch, commits):
short_url = None
if short_url:
- url = short_url.encode('utf-8')
+ url = short_url.encode('utf-8', 'replace')
msg += url
return msg