[PR #3080] [MERGED] Port regen: hand the tools a Python that runs #4790

Closed
opened 2026-11-03 05:07:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3080
Author: @Domanffe
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/port-regen-python-that-runs


📝 Commits (1)

  • 93e61ef Port regen: hand the tools a Python that runs

📊 Changes

2 files changed (+25 additions, -1 deletions)

View changed files

📝 tests/test_port_regen.py (+9 -0)
📝 tools/port_regen.py (+16 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

python() returned shutil.which("python3") or "python3". On Git for Windows
that name is the Microsoft Store stub: it prints Python to stderr and exits
49, so every tool started through this helper (port_harness.run_harnesses,
prepare_local) died before running a line of Python. On a machine with no
python3 at all it returned a name that is not on PATH.

It now probes python3, python, py and keeps the first one that answers
the Python 3 check, once per process. On Linux and macOS python3 is still
chosen first and unchanged.

Evidence:

  • new test tests/test_port_regen.py:InterpreterTests:: test_python_is_an_interpreter_that_runs runs the returned path with
    sys.exit(sys.version_info < (3,)) and requires exit 0.
  • python -m unittest tests.test_port_regen → Ran 6 tests ... OK on
    Windows 11, where this commit resolves python() to a working 3.x instead
    of the stub.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3080 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/port-regen-python-that-runs` --- ### 📝 Commits (1) - [`93e61ef`](https://github.com/horizon-rust/horizon/commit/93e61ef9364c9b119ce8d2170803840a0f7cf68c) Port regen: hand the tools a Python that runs ### 📊 Changes **2 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_port_regen.py` (+9 -0) 📝 `tools/port_regen.py` (+16 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. `python()` returned `shutil.which("python3") or "python3"`. On Git for Windows that name is the Microsoft Store stub: it prints `Python` to stderr and exits 49, so every tool started through this helper (`port_harness.run_harnesses`, `prepare_local`) died before running a line of Python. On a machine with no `python3` at all it returned a name that is not on PATH. It now probes `python3`, `python`, `py` and keeps the first one that answers the Python 3 check, once per process. On Linux and macOS `python3` is still chosen first and unchanged. Evidence: - new test `tests/test_port_regen.py:InterpreterTests:: test_python_is_an_interpreter_that_runs` runs the returned path with `sys.exit(sys.version_info < (3,))` and requires exit 0. - `python -m unittest tests.test_port_regen` → `Ran 6 tests ... OK` on Windows 11, where this commit resolves `python()` to a working 3.x instead of the stub. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:59 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4790
No description provided.