Skip to content

Quote PYTHON_PATH command invocations in check_python() to handle spaced paths#1

Merged
PStarH merged 1 commit into
mainfrom
copilot/fix-path-parsing-bug
Apr 15, 2026
Merged

Quote PYTHON_PATH command invocations in check_python() to handle spaced paths#1
PStarH merged 1 commit into
mainfrom
copilot/fix-path-parsing-bug

Conversation

Copilot AI commented Apr 15, 2026

Copy link
Copy Markdown

check_python() could fail on macOS when PYTHON_PATH contains spaces (e.g., Library/Application Support/...) because unquoted variable expansion split the executable path during --version calls. This updates the function to consistently treat resolved Python paths as single tokens in assignment and execution contexts.

  • Path-safe command execution

    • Wrapped all PYTHON_PATH command invocations in double quotes.
    • Updated version capture to quote command substitution results, preventing word-splitting on executable paths.
  • uv path resolution hardening

    • Switched uv discovery branch to assign with quoted command substitution:
      • PYTHON_PATH="$("$UV_CMD" python find "$PYTHON_VERSION" 2>/dev/null)"
    • Kept install/find flow unchanged while ensuring path-safe quoting in subsequent execution.
  • Scope

    • Changes are limited to quoting behavior inside check_python(); no functional logic changes to detection/install flow.
PYTHON_PATH="$("$UV_CMD" python find "$PYTHON_VERSION" 2>/dev/null)"
PYTHON_FOUND_VERSION="$("$PYTHON_PATH" --version 2>/dev/null)"

@PStarH PStarH marked this pull request as ready for review April 15, 2026 02:47
@PStarH PStarH merged commit 0fd6c86 into main Apr 15, 2026
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