From 5ccc2d9900f691ac6e3000836d052f60e0d1e726 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20Bie=C3=9Fmann?= Date: Mon, 9 Dec 2013 13:30:53 +0100 Subject: [PATCH] pwclient: fix handling UTF-8 in patch info MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch fixes following error when redirecting 'pwclient info' output: ---8<--- andreas@dockstar % pwclient info 295268 > /tmp/test.out Traceback (most recent call last): File "/home/andreas/bin/pwclient", line 508, in main() File "/home/andreas/bin/pwclient", line 471, in main action_info(rpc, patch_id) File "/home/andreas/bin/pwclient", line 242, in action_info print("- %- 14s: %s" % (key, value)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 29: ordinal not in range(128) --->8--- Signed-off-by: Andreas Bießmann Signed-off-by: Jeremy Kerr --- apps/patchwork/bin/pwclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 5fce359..0c0ccaf 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -231,7 +231,7 @@ def action_info(rpc, patch_id): print(s) print('-' * len(s)) for key, value in sorted(patch.iteritems()): - print("- %- 14s: %s" % (key, value)) + print("- %- 14s: %s" % (key, unicode(value).encode("utf-8"))) def action_get(rpc, patch_id): patch = rpc.patch_get(patch_id) -- 2.39.2