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 A5F0A1389E2 for ; Thu, 4 Dec 2014 20:46:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA7D6E092F; Thu, 4 Dec 2014 20:46:23 +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 55C44E092F for ; Thu, 4 Dec 2014 20:46:23 +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 80063340590 for ; Thu, 4 Dec 2014 20:46:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B9B37B93D for ; Thu, 4 Dec 2014 20:46:20 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1417725670.46ffaeaee872aa71b5e83133ccb3a2a3ea3efc03.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/output.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: 46ffaeaee872aa71b5e83133ccb3a2a3ea3efc03 X-VCS-Branch: master Date: Thu, 4 Dec 2014 20:46:20 +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: 11e119ce-5f32-4c1c-a911-5f5f11a67c04 X-Archives-Hash: 6576765f5e38e35185c7c003811ce8bf commit: 46ffaeaee872aa71b5e83133ccb3a2a3ea3efc03 Author: Devan Franchini gentoo org> AuthorDate: Thu Dec 4 20:41:10 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Thu Dec 4 20:41:10 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=46ffaeae output.py: Removes check for encoding output strings In py2.7 when trying to view an overlay info it will cause a runtime error if the string isn't encoded properly. So output.py will now indiscriminately encode all string values. X-Gentoo-Bug: 530064 X-Gentoo-Bug-URL: https://bugs.gentoo.org/530064 --- layman/output.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/layman/output.py b/layman/output.py index 21a7d6c..b22d33e 100644 --- a/layman/output.py +++ b/layman/output.py @@ -133,8 +133,7 @@ class Message(MessageBase): """empty debug function, does nothing, declared here for compatibility with DebugMessage """ - if type(info) != str:#not in types.StringTypes: - info = encode(info) + info = encode(info) if level > self.debug_lev: return @@ -153,8 +152,7 @@ class Message(MessageBase): def info (self, info, level = INFO_LEVEL): - if type(info) != str:#not in types.StringTypes: - info = encode(info) + info = encode(info) if level > self.info_lev: return @@ -165,8 +163,7 @@ class Message(MessageBase): def status (self, message, status, info = 'ignored'): - if type(message) != str:#not in types.StringTypes: - message = encode(message) + message = encode(message) lines = message.split('\n') @@ -194,8 +191,7 @@ class Message(MessageBase): def warn (self, warn, level = WARN_LEVEL): - if type(warn) != str:#not in types.StringTypes: - warn = encode(warn) + warn = encode(warn) if level > self.warn_lev: return @@ -206,8 +202,7 @@ class Message(MessageBase): def error (self, error, level = None): - if type(error) != str:#not in types.StringTypes: - error = encode(error) + error = encode(error) for i in error.split('\n'): # NOTE: Forced flushing ensures that stdout and stderr @@ -222,8 +217,7 @@ class Message(MessageBase): def die (self, error): - if type(error) != str:#not in types.StringTypes: - error = encode(error) + error = encode(error) for i in error.split('\n'): self.error(self.color_func('red', 'Fatal error: ') + i)