From 718820bcebd21d4a619fa262d9b9cf3acbf110f8 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Mon, 5 Oct 2020 19:28:49 +0100 Subject: [PATCH] rpi-eeprom-config: Use decode('utf-8') to convert subprocess txt This matters on Python3 but not on Python2 --- rpi-eeprom-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpi-eeprom-config b/rpi-eeprom-config index ad417bd..ea2ca48 100755 --- a/rpi-eeprom-config +++ b/rpi-eeprom-config @@ -76,7 +76,7 @@ def shell_cmd(args): exit_error("%s failed: %d\n %s\n %s\n" % (arg_str, result.returncode, result.stdout.read(), result.stderr.read())) else: - return result.stdout.read() + return result.stdout.read().decode('utf-8') def get_latest_eeprom(): """ @@ -131,7 +131,7 @@ def edit_config(eeprom=None): if os.path.exists(pending): config_src = pending image = BootloaderImage(pending) - current_config = image.get_config() + current_config = image.get_config().decode('utf-8') else: config_src = 'vcgencmd bootloader_config' current_config = read_current_config() @@ -140,7 +140,7 @@ def edit_config(eeprom=None): # then get the current config from there. image = BootloaderImage(eeprom) config_src = eeprom - current_config = image.get_config() + current_config = image.get_config().decode('utf-8') create_tempdir() tmp_conf = os.path.join(TEMP_DIR, 'boot.conf')