From patchwork Tue Dec 7 15:48:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 74563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3F0B0B70CD for ; Wed, 8 Dec 2010 02:49:30 +1100 (EST) Received: from mail-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by ozlabs.org (Postfix) with ESMTP id F1DC4B70A5 for ; Wed, 8 Dec 2010 02:49:27 +1100 (EST) Received: by eyd10 with SMTP id 10so53112eyd.17 for ; Tue, 07 Dec 2010 07:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=A0tqjgnrS4bW8NXjkctAuDlcY5D7PF/EtpAENJQ5EWQ=; b=nwnCzSrznEOx9iaZ2EHx0HbHvwoy2mBDVsJpwaLUKx68DpNiSPcmexLoPl65hB2jbB XFQrEseKIn6T9a33x+mRzTHlLdjZzeDLn5oUjfX5sqvTTddhY76d6bfOXOVuPKuLB/gq UAT9xVuYjll8j1d78iUXLzZPOxNJqOs37TmQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=H6d4cm6hyh93mjLXytlS9emKp2SrQx2f9cB5uR+k4HPOOvUN8Wlg9/BiXN8qiXJkOW LTWHnkptZAjNliwXp4USH991QOk6RHeNH4GyCeCSUTLP7nZnl8dbGcxbqXWebM/U7sAw +Hv6zSV6zA3NWp5pIsiT8k81WygDcToylBJ+4= Received: by 10.213.14.146 with SMTP id g18mr785849eba.2.1291736964238; Tue, 07 Dec 2010 07:49:24 -0800 (PST) Received: from localhost.localdomain ([212.23.103.33]) by mx.google.com with ESMTPS id x54sm5974307eeh.11.2010.12.07.07.49.20 (version=SSLv3 cipher=RC4-MD5); Tue, 07 Dec 2010 07:49:23 -0800 (PST) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: patchwork@lists.ozlabs.org Subject: [PATCH] pwclient: fix handling of UTF-8 char in submitter name Date: Tue, 7 Dec 2010 16:48:20 +0100 Message-Id: <1291736900-66294-1-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org This patch fixes following bug in 'list': ---8<--- # pwclient list -p uboot -w andreas.devel | grep New Traceback (most recent call last): File "/Users/andreas/bin/pwclient", line 463, in main() File "/Users/andreas/bin/pwclient", line 411, in main action_list(rpc, filt, submitter_str, delegate_str) File "/Users/andreas/bin/pwclient", line 182, in action_list (person['name'], person['email']) UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 32: ordinal not in range(128) --->8--- Signed-off-by: Andreas Bießmann --- One note, I could reproduce this error only when output is piped. apps/patchwork/bin/pwclient | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index dc836e9..dba68fb 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -179,7 +179,8 @@ def action_list(rpc, filter, submitter_str, delegate_str): for id in ids: person = rpc.person_get(id) print "Patches submitted by %s <%s>:" % \ - (person['name'], person['email']) + (unicode(person['name']).encode("utf-8"), \ + unicode(person['email']).encode("utf-8")) f = filter f.add("submitter_id", id) patches = rpc.patch_list(f.d)