Skip to content

fix(install): quote python path variables to handle spaces#10019

Closed
PStarH wants to merge 3 commits into
NousResearch:mainfrom
PStarH:main
Closed

fix(install): quote python path variables to handle spaces#10019
PStarH wants to merge 3 commits into
NousResearch:mainfrom
PStarH:main

Conversation

@PStarH

@PStarH PStarH commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes an installation failure on macOS where the script exits silently. When uv installs Python into a directory containing spaces (e.g., ~/Library/Application Support/uv/...), the original unquoted variable expansion PYTHON_FOUND_VERSION=$($PYTHON_PATH --version) caused the shell to split the path and attempt to execute Library/Application as a command. This triggered set -e and caused the installer to crash. This fix ensures path variables are robustly quoted.

Related Issue

Fixes #10009

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

scripts/install.sh: Added double quotes around $PYTHON_PATH variable assignments and command substitutions in the check_python function to handle paths containing spaces correctly.

How to Test

  1. Ensure uv is installed and the Python path contains spaces (default behavior on macOS).
  2. Run bash -x install.sh to trace the execution.
  3. Observe that the path is now correctly interpreted as a single string (e.g., "/path/to/python" --version) instead of being split at the space, and the installation proceeds successfully.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

截屏2026-04-15 10 51 40

Copilot AI and others added 3 commits April 15, 2026 02:44
Quote `PYTHON_PATH` command invocations in `check_python()` to handle spaced paths
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
…acOS (#10009)

Cherry-picked from PR #10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes #10009
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
…acOS (#10009)

Cherry-picked from PR #10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes #10009
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #13001 #13001 — your commit was cherry-picked onto current main with your authorship preserved. Yours was the only PR verified against the actual macOS uv path-space scenario. Thanks @PStarH!

@teknium1 teknium1 closed this Apr 20, 2026
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…acOS (NousResearch#10009)

Cherry-picked from PR NousResearch#10019 by @PStarH.

On macOS, uv stores Python in ~/Library/Application Support/uv/...
which contains a space. Unquoted $PYTHON_PATH and $UV_CMD caused
word-splitting under set -e, silently aborting install.sh.

Quotes all variable expansions in check_python():
- "$PYTHON_PATH" in command invocations
- "$UV_CMD" in uv calls
- Outer quotes on $(...) assignments

Closes NousResearch#10009
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.

[Bug]: install.sh fails on macOS due to unquoted spaces in Python path (uv)

3 participants