From af21c50aec4d8c17a721793d45b0d97ba2f6ba4f Mon Sep 17 00:00:00 2001 From: Florian Sievers Date: Wed, 24 Aug 2022 12:44:56 +0200 Subject: [PATCH] make bash version check case insensitive (#4399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the output of `bash --version` is different when the system is configured for e.g. de_DE locale. For german locale the it's `GNU bash, Version 5.0…` with an uppercase 'V'. This makes the bash completion setup fail with the error `Error: The minimal supported Bash version is 4.4`. To fix this, the version match regex now uses the `IGNORECASE` flag. --- platformio/system/completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/system/completion.py b/platformio/system/completion.py index 3192021c..57e2f1d3 100644 --- a/platformio/system/completion.py +++ b/platformio/system/completion.py @@ -30,7 +30,7 @@ class ShellType(Enum): def get_bash_version(): result = subprocess.run(["bash", "--version"], capture_output=True, check=True) - match = re.search(r"version\s+(\d+)\.(\d+)", result.stdout.decode()) + match = re.search(r"version\s+(\d+)\.(\d+)", result.stdout.decode(), re.IGNORECASE) if match: return (int(match.group(1)), int(match.group(2))) return (0, 0)