Skip to content
This repository was archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
util/op,plat/network: parse subprocess output as utf-8
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Pluvinage <[email protected]>
  • Loading branch information
TheLortex authored and nderjung committed Mar 16, 2022
1 parent 91bab60 commit ec9335b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kraft/plat/network/driver/brctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def bridge_exists(self, name=None):

if err == b"can't get info No such device\n":
return False
elif "does not exist!" in err.decode('ascii'):
elif "does not exist!" in err.decode('utf-8'):
return False

return True
4 changes: 2 additions & 2 deletions kraft/util/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def execute(cmd="", env={}, dry_run=False, use_logger=False):
)

for line in popen.stdout:
line = line.strip().decode('ascii')
line = line.strip().decode('utf-8')
if use_logger:
logger.info(line)
else:
Expand Down Expand Up @@ -140,7 +140,7 @@ def make_progressbar(make=""):

for line in popen.stdout:
t.update()
line = line.strip().decode('ascii')
line = line.strip().decode('utf-8')
if line.startswith("make: Leaving directory") is False and \
line.startswith("make: Entering directory") is False:
print(line)
Expand Down

0 comments on commit ec9335b

Please sign in to comment.