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 B251E13888F for ; Wed, 28 Oct 2015 14:50:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA6F121C006; Wed, 28 Oct 2015 14:50:01 +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 4772121C006 for ; Wed, 28 Oct 2015 14:50:01 +0000 (UTC) Received: from professor-x (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 49DAC340662 for ; Wed, 28 Oct 2015 14:50:00 +0000 (UTC) Date: Wed, 28 Oct 2015 07:49:11 -0700 From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: Re: [gentoo-catalyst] [PATCH 7/9] hash_utils: decode output of popen Message-ID: <20151028074911.0fe57236.dolsen@gentoo.org> In-Reply-To: <1444624562-26162-7-git-send-email-vapier@gentoo.org> References: <1444624562-26162-1-git-send-email-vapier@gentoo.org> <1444624562-26162-7-git-send-email-vapier@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 984dabb3-b11d-468a-8459-31574624ac9b X-Archives-Hash: f406d2587ca86a90309229eeb99b5e07 On Mon, 12 Oct 2015 00:36:00 -0400 Mike Frysinger wrote: > In py3, the return of popen is binary data. We need > to decode it to get a string we can work with. > --- > catalyst/hash_utils.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py > index 1161da3..6e08967 100644 > --- a/catalyst/hash_utils.py > +++ b/catalyst/hash_utils.py > @@ -117,7 +117,7 @@ class HashMap(object): > log.debug('args = %r', args) > source = Popen(args, stdout=PIPE) > output = source.communicate() > - lines = output[0].split('\n') > + lines = output[0].decode('ascii').split('\n') > log.debug('output = %s', output) > header = lines[0] > h_f = lines[1].split() looks good -- Brian Dolbec