Gentoo Archives: gentoo-catalyst

From: Mike Frysinger <vapier@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH 7/9] hash_utils: decode output of popen
Date: Mon, 12 Oct 2015 04:36:26
Message-Id: 1444624562-26162-7-git-send-email-vapier@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 1/9] convert octals to py3 compat by Mike Frysinger
1 In py3, the return of popen is binary data. We need
2 to decode it to get a string we can work with.
3 ---
4 catalyst/hash_utils.py | 2 +-
5 1 file changed, 1 insertion(+), 1 deletion(-)
6
7 diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py
8 index 1161da3..6e08967 100644
9 --- a/catalyst/hash_utils.py
10 +++ b/catalyst/hash_utils.py
11 @@ -117,7 +117,7 @@ class HashMap(object):
12 log.debug('args = %r', args)
13 source = Popen(args, stdout=PIPE)
14 output = source.communicate()
15 - lines = output[0].split('\n')
16 + lines = output[0].decode('ascii').split('\n')
17 log.debug('output = %s', output)
18 header = lines[0]
19 h_f = lines[1].split()
20 --
21 2.5.2

Replies