From ef2fbcd2b60dc39b70436a597288318c699bdf9b Mon Sep 17 00:00:00 2001 From: Naomi Rennie-Waldock Date: Sat, 6 Dec 2025 17:26:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20configuration.py=20URL=20f?= =?UTF-8?q?etch=20(#28208)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/configuration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index 71d4e3777c..6677cd566d 100755 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -3,7 +3,7 @@ # configuration.py # Apply options from config.ini to the existing Configuration headers # -import re, os, shutil, configparser, datetime +import re, os, shutil, subprocess, configparser, datetime from pathlib import Path verbose = 0 @@ -149,9 +149,9 @@ def fetch_example(url): # Find a suitable fetch command if shutil.which("curl") is not None: - fetch = "curl -L -s -S -f -o" + fetch = [ "curl", "-L", "-s", "-S", "-f", "-o" ] elif shutil.which("wget") is not None: - fetch = "wget -q -O" + fetch = [ "wget", "-q", "-O" ] else: blab("Couldn't find curl or wget", -1) #blab("Couldn't find curl or wget", 0) @@ -165,7 +165,7 @@ def fetch_example(url): # Try to fetch the remote files gotfile = False for fn in ("Configuration.h", "Configuration_adv.h", "_Bootscreen.h", "_Statusscreen.h"): - if os.system(f"{fetch} wgot {url}/{fn} >/dev/null 2>&1") == 0: + if subprocess.call(fetch + [ "wgot", f"{url}/{fn}" ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0: shutil.move('wgot', config_path(fn)) gotfile = True blab(f"Fetched {fn}", 2)