From 4af398f3c010e244ba7014dee3375b0e2a612930 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 3 Feb 2011 21:10:45 +0100 Subject: Use 'replace' for errors in str.encode(). --- gitnoti.py | 6 +++--- 1 file 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 -- cgit v1.2.3