From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (unknown [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 22E111381FA for ; Fri, 16 May 2014 01:07:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 20C86E0AB1; Fri, 16 May 2014 01:07:10 +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 50DC3E0AAB for ; Fri, 16 May 2014 01:07:09 +0000 (UTC) Received: from spoonbill.gentoo.org (unknown [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E8BF6340066 for ; Fri, 16 May 2014 01:07:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 8684C1818D for ; Fri, 16 May 2014 01:07:06 +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: <1400202356.6cf1b5626a81d9bfbf4ad4125df9719760144837.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:gsoc2014 commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/api.py X-VCS-Directories: layman/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: 6cf1b5626a81d9bfbf4ad4125df9719760144837 X-VCS-Branch: gsoc2014 Date: Fri, 16 May 2014 01:07:06 +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: ee8c11b5-7f45-4fe3-9ff1-b4bf6cc2da6c X-Archives-Hash: cb1390cecdb8a1407b59f5eade88dc72 commit: 6cf1b5626a81d9bfbf4ad4125df9719760144837 Author: Devan Franchini gentoo org> AuthorDate: Wed May 14 19:24:59 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Fri May 16 01:05:56 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=6cf1b562 layman/api.py: Corrects output of repos and stderr Due to repos coming in as a binary string, it needed to be converted to a normal string before joining it in the debug message or it will cause runtime failures. Due to 2to3 overlooking the print statement on line 513, this has also been corrected along with a check to see if the repos variable is an instance of type str instead of type basestring which is no longer available in py3. --- layman/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layman/api.py b/layman/api.py index f36be0a..7dd5ea7 100755 --- a/layman/api.py +++ b/layman/api.py @@ -90,7 +90,7 @@ class LaymanAPI(object): converting a string to a list[string] if it is not already a list. produces and error message if it is any other type returns repos as list always""" - if isinstance(repos, basestring): + if isinstance(repos, str): repos = [repos] # else assume it is an iterable, if not it will error return [encode(i) for i in repos] @@ -299,7 +299,7 @@ class LaymanAPI(object): @param update_news: bool, defaults to False @rtype bool or {'repo-id': bool,...} """ - self.output.debug("API.sync(); repos to sync = %s" % ', '.join(repos), 5) + self.output.debug("API.sync(); repos to sync = %s" % ', '.join((x.decode() if isinstance(x, bytes) else x) for x in repos), 5) fatals = [] warnings = [] success = [] @@ -513,7 +513,7 @@ class LaymanAPI(object): self._error_messages.append(message) self.output.debug("API._error(); _error_messages = %s" % str(self._error_messages), 4) if self.report_errors: - print >>self.config['stderr'], message + print(message, file=self.config['stderr']) def get_errors(self):