Skip to content

Fix: Quote Python path to handle spaces in postinstall scripts - #5363

Closed
alex-lisi wants to merge 1 commit into
platformio:developfrom
alex-lisi:fix-unquoted-python-path-postinstall
Closed

Fix: Quote Python path to handle spaces in postinstall scripts#5363
alex-lisi wants to merge 1 commit into
platformio:developfrom
alex-lisi:fix-unquoted-python-path-postinstall

Conversation

@alex-lisi

Copy link
Copy Markdown
Contributor

Description

Fixes installation failure when Python is installed in a directory containing spaces (e.g., C:\Program Files\Python37\).

Changes

  • Modified call_pkg_script() in platformio/package/manager/base.py to wrap the Python executable path in quotes when it contains spaces
  • This prevents the shell from incorrectly splitting the path during postinstall script execution

Testing

Related Issue

Fixes #5361

Wraps Python executable path in quotes when it contains spaces before executing package postinstall scripts. This fixes installation failures on Windows when Python is installed in directories like 'Program Files'.

Fixes #5361
@ivankravets

Copy link
Copy Markdown
Member

The recommended way to declare the commdn is LIST type. See

if not isinstance(cmd, list):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants