Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)

Đang mở Phù hợp với người mới
#4,563 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Deepjyoti-Sarmah đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #4568 của @Deepjyoti-Sarmah — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, shell
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

Đọc graphify/hooks.py và kiểm tra khối “Last resort” của _PYTHON_DETECT, đặc biệt là thứ tự dò tìm python3 và python. Tái hiện cơ chế dự phòng trong Git Bash trên Windows khi bật bí danh thực thi ứng dụng của Microsoft Store và chưa cài Store Python. Hoàn tất khi hook tránh khởi chạy trình chuyển hướng WindowsApps mà vẫn tìm được một trình thông dịch Python khả dụng; payload không nêu tên tệp kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Where: graphify/hooks.py, _PYTHON_DETECT, the "Last resort" block — python3 -c "$_GFY_PROBE" is tried before python -c … (0.9.92: L131–135; same order back to 0.8.36 L64–68).

What happens on Windows: with the Microsoft Store app-execution alias enabled (the Windows 10/11 default) and no Store Python installed, command -v python3 in Git Bash resolves to /c/Users/<me>/AppData/Local/Microsoft/WindowsApps/python3 — the AppInstallerPythonRedirector.exe stub. Running it opens a visible console window for ~1.1 s, then exits 9009. So on any machine where the pinned interpreter, .graphify_python, the launcher shebang and the uv-tools scan all miss (removed venv, graphify moved to another env, GUI git client with a minimal PATH), every commit flashes a terminal window before the hook falls through to python.

Environment: Windows 11 Home 23H2 (build 22631), Git for Windows, Windows Terminal 1.24 as default terminal, CPython 3.11.9 (per-user install under %LOCALAPPDATA%\Programs\Python, not the Store build), graphifyy 0.8.36 (probe block unchanged in 0.9.92).

Repro (Git Bash, alias on, no Store Python):

command -v python3          # -> /c/Users/<me>/AppData/Local/Microsoft/WindowsApps/python3
time python3 --version      # console window appears for ~1.1 s; exit code 9009

Measured three times from a hidden launcher: ~1.1 s each, one AppInstallerPythonRedirector.exe + OpenConsole.exe per call.

Caveat: on my machine the hook never reached this branch (the pinned interpreter has graphify), so this is measured on the alias directly, not through a hook run.

Suggested fix (either):

  • on Windows (uname -s = MINGW*/MSYS*/CYGWIN*) probe python before python3; or
  • skip a python3 whose resolved path contains /WindowsApps/ (case "$(command -v python3)" in */WindowsApps/*) ;; esac).

Related: #287 noted the WindowsApps stub's exit code for the AGENTS.md command; #1416 touches the python3 fallback in skill-claw.md. Neither covers the hook probe or the window flash. The console-window burst from DETACHED_PROCESS is #2253 (fixed in 0.9.29) and is a different mechanism.

Ngôn ngữ chính
Python
Star
124k
Fork
11.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Graphify-Labs/graphify

Tất cả issue của Graphify-Labs/graphify

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.