From bda571705129cae2e513bb6548ec7a57878b1f66 Mon Sep 17 00:00:00 2001 From: Maya Date: Thu, 13 Apr 2023 18:10:21 +0100 Subject: [PATCH] Use standard Python zipfile module to decompress firmware --- RNS/Utilities/rnodeconf.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/RNS/Utilities/rnodeconf.py b/RNS/Utilities/rnodeconf.py index 9943c7e..873d09b 100644 --- a/RNS/Utilities/rnodeconf.py +++ b/RNS/Utilities/rnodeconf.py @@ -32,6 +32,7 @@ import datetime import time import math import hashlib +import zipfile from urllib.request import urlretrieve from importlib import util import RNS @@ -2287,12 +2288,9 @@ def main(): try: if fw_filename.endswith(".zip"): RNS.log("Decompressing firmware...") - unzip_status = call(get_flasher_call("unzip", fw_filename)) - if unzip_status == 0: - RNS.log("Firmware decompressed") - else: - RNS.log("Could not extract firmware from downloaded zip file") - exit() + with zipfile.ZipFile(fw_src+fw_filename) as zip: + zip.extractall(fw_src) + RNS.log("Firmware decompressed") RNS.log("Flashing RNode firmware to device on "+args.port) from subprocess import call