Skip to content

npm wrapper: venv bootstrap hard-codes python3, fails on Windows installs without a python3 command #940

Description

@Scottcjn

Defect

The npm wrapper always creates its venv with python3, including on Windows, where a standard Python install usually provides python.exe / py.exe but no python3 command.

Where

  • bin/beacon.js:25-30 — pythonBin() already handles win32 (Scripts/python.exe)
  • bin/beacon.js:48-54 — ensureVenv() runs run('python3', ['-m', 'venv', VENV_DIR]) unconditionally
  • bin/beacon.js:42 — run() throws on spawn error, so a missing python3 aborts the first run (main @ d975e13)

Repro

  1. On Windows with Python from python.org (no python3 alias), with ~/.beacon/npm/venv absent
  2. Run beacon <anything>
  3. spawnSync('python3', ...) fails with ENOENT before the venv exists

Expected vs actual

  • Expected: bootstrap succeeds, since the wrapper already supports the Windows venv layout
  • Actual: bootstrap fails on Windows systems without a python3 command

Suggested fix

Choose the bootstrap interpreter per platform: honor PYTHON if set, then try py -3 / python on win32 and python3 / python elsewhere. Add a unit test for the selection.

No open fix PR for this was found at filing time (checked gh pr list for fable/*-2026-09-21 branches).

Reported by @fsalmon1991 via email (GitHub App 403 fallback) for rustchain-bounties#254; filed on their behalf by Sophia (Elyan Labs).

AI-assisted: the reporter disclosed AI assistance; this issue was verified against current main and drafted with AI assistance (Claude) before filing.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions