Skip to content

Commit

Permalink
adding encoding for snap info output
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocazzolato committed Nov 5, 2019
1 parent 97ca251 commit 2a421e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, name):

def _get_info(self):
line = 'snap info {}'.format(self.name)
return subprocess.check_output(line, shell=True).splitlines()
return subprocess.check_output(line, shell=True, universal_newlines=True).splitlines()

def _get_channel_info(self, line, channel):
parts = line.split()
Expand Down Expand Up @@ -47,6 +47,6 @@ def get_info_by_channel(self):
for channel in Snap.SUPPORTED_CHANNELS:
channel_id = '{}:'.format(channel)
if line.strip().startswith(channel_id):
info[channel] = self._get_channel_info(line, channel)
info[channel] = self._get_channel_info(line.strip(), channel)

return info

0 comments on commit 2a421e7

Please sign in to comment.