From 5a4d6b44aceed943e0ebbd322ccd7135319bc041 Mon Sep 17 00:00:00 2001 From: PSala Date: Mon, 11 Mar 2024 16:48:30 +0100 Subject: [PATCH] Fix decode --- apply_pr/fabfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apply_pr/fabfile.py b/apply_pr/fabfile.py index 492bc5f..9c19835 100644 --- a/apply_pr/fabfile.py +++ b/apply_pr/fabfile.py @@ -11,6 +11,7 @@ import re import pprint +import six from fabric.api import local, run, cd, put, settings, abort, sudo, hide, task, env, prefix from fabric.operations import open_shell, prompt from fabric.contrib import files @@ -274,7 +275,10 @@ def run(self): def catch_result(self, result): result_failed = result.failed - result_text = result.decode('utf-8') + if six.PY3: + result_text = bytes(result, 'utf-8').decode('utf-8') + else: + result_text = result.decode('utf-8') for line in result_text.split('\n'): if re.match('Applying: ', line): tqdm.write(colors.green(line))