From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id CFA5E138ACF for ; Wed, 11 Feb 2015 17:37:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BDDDE088A; Wed, 11 Feb 2015 17:37:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 930DFE088A for ; Wed, 11 Feb 2015 17:37:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 984C0340816 for ; Wed, 11 Feb 2015 17:37:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 42016118A9 for ; Wed, 11 Feb 2015 17:37:50 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1422675827.d3446934815ba262e479cea7272a524b65d3f041.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/actions.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: d3446934815ba262e479cea7272a524b65d3f041 X-VCS-Branch: master Date: Wed, 11 Feb 2015 17:37:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a91a8da1-621c-4f01-bffe-eee4edcd3c67 X-Archives-Hash: ce0fd4d8e5d8d775b3b09dfd94b8a635 commit: d3446934815ba262e479cea7272a524b65d3f041 Author: Brian Dolbec gentoo org> AuthorDate: Tue Jan 13 05:58:59 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 31 03:43:47 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=d3446934 gkeys/actions.py: Trap UnicodeDecodeError for installkey() Add debug logging for the error. --- gkeys/gkeys/actions.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index 23c71fc..ad03038 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -292,9 +292,16 @@ class Actions(object): msg = "key desired: %(name)s, key added: %(key)s, succeeded:" +\ " %(success)s, fingerprint: %(fpr)s" for result in results[key.name]: - print(msg % ({'name': key.name, 'key': result.username, - 'success': not result.failed, - 'fpr': result.fingerprint})) + try: + print(msg % ({'name': key.name, 'key': result.username, + 'success': str(not result.failed), + 'fpr': result.fingerprint})) + except UnicodeDecodeError: + print("UnicodeDecodeError printing results for:", key.name) + self.logger.debug("installkey(); UnicodeDecodeError for:" + key.name) + self.logger.debug(" result.username...:" + result.username) + self.logger.debug(" result.failed.....:" + result.failed) + self.logger.debug(" result.fingerprint:" + result.fingerprint) self.logger.debug("stderr_out: " + str(result.stderr_out)) if result.failed: failed.append(key) @@ -564,7 +571,7 @@ class Actions(object): "succeeded: %(success)s, fingerprint: %(fpr)s" for result in results[gkey.name]: print(msg % ({'name': gkey.name, 'key': result.username, - 'success': not result.failed, + 'success': str(not result.failed), 'fpr': result.fingerprint})) self.logger.debug("stderr_out: " + str(result.stderr_out)) if result.failed: