Skip to content

Commit 622200f

Browse files
committed
Fixed installation failure when the executable path contains spaces for postinstall scripts and handling both list and string command formats // Resolve #5366
1 parent 2a27e8f commit 622200f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
2626
* Fixed a regression issue where custom build flags were not properly reflected in the `compile_commands.json <https://docs.platformio.org/en/latest/integration/compile_commands.html>`__ file, ensuring accurate compilation database generation
2727
* Fixed an issue where fully-qualified serial port URLs (e.g., ``rfc2217://host:port``) were incorrectly treated as wildcard patterns (`issue #5225 <https://github.com/platformio/platformio-core/issues/5225>`_)
2828
* Fixed an issue where the toolchain path in static analysis was not handled correctly if it contained spaces (`pull #5351 <https://github.com/platformio/platformio-core/issues/5351>`_)
29+
* Fixed installation failure when the executable path contains spaces for ``postinstall`` scripts and handling both list and string command formats (`pull #5366 <https://github.com/platformio/platformio-core/pull/5366>`_)
2930

3031
6.1.18 (2025-03-11)
3132
~~~~~~~~~~~~~~~~~~~

platformio/package/manager/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@ def call_pkg_script(self, pkg, event):
330330
return
331331
shell = False
332332
if not isinstance(cmd, list):
333-
shell = True
333+
# issue #5366: workaround when command passed as string without spaces
334+
if " " in cmd:
335+
shell = True
334336
cmd = [cmd]
335337
os.environ["PIO_PYTHON_EXE"] = get_pythonexe_path()
336338
with fs.cd(pkg.path):

0 commit comments

Comments
 (0)