From d4ee2f6d04076c42e29fa858c06f0c00dfa452da Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Thu, 16 Mar 2017 15:25:29 -0500 Subject: [PATCH] repopick: encode commit subjects in utf-8 for printing * Fixes errors like UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 51: ordinal not in range(128) with weird characters in a commit message Change-Id: I700198481630b4b29fd6d5d1f0c79bb94e59ad86 --- build/tools/repopick.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tools/repopick.py b/build/tools/repopick.py index 9bb39aad..7d164383 100755 --- a/build/tools/repopick.py +++ b/build/tools/repopick.py @@ -347,7 +347,7 @@ if __name__ == '__main__': # Print out some useful info if not args.quiet: - print('--> Subject: "{0}"'.format(item['subject'])) + print('--> Subject: "{0}"'.format(item['subject'].encode('utf-8'))) print('--> Project path: {0}'.format(project_path)) print('--> Change number: {0} (Patch Set {0})'.format(item['id']))