Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Full release notes with details on each version: [GitHub Releases](https://githu
- Fix: a PHP `use` import written with a leading-backslash / fully-qualified prefix now resolves to its target definition instead of being dropped (#2661, thanks @ousamabenyounes).
- Fix: an unresolved local JS/TS import (to a file absent from the scan) now emits a stable, portable `ref` target id instead of leaking a per-checkout absolute-path slug (#2457, thanks @rohit-jsfreaky).
- Fix: `graphify benchmark` no longer crashes on a node whose label is `None` (#2674, thanks @Arthuro0103).
- Fix: the git post-commit hook and skill interpreter probes now strip a shebang argument before using it as a path, so a pipx launcher (`#!/.../python -E`) resolves instead of silently falling back to a `python3` without graphify and printing "could not locate a Python with graphify installed" after every commit (#2629, thanks @hpstr5000).

## 0.9.40 (2026-08-11)

Expand Down
5 changes: 5 additions & 0 deletions graphify/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
*/env\\ *) GRAPHIFY_PYTHON="${_SHEBANG#*/env }" ;;
*) GRAPHIFY_PYTHON="$_SHEBANG" ;;
esac
# Strip any interpreter argument: pipx writes `#!/.../python -E`, so the
# shebang carries a trailing argument that is not part of the path. Keep
# the leading word only, else the space trips the allowlist below and the
# valid interpreter is discarded (silent python3 fallback, #2629).
GRAPHIFY_PYTHON="${GRAPHIFY_PYTHON%% *}"
# Allowlist: only keep characters valid in a filesystem path to prevent
# injection if the shebang contains shell metacharacters.
case "$GRAPHIFY_PYTHON" in
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -662,6 +667,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-amp.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -662,6 +667,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-claw.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -662,6 +667,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-droid.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -662,6 +667,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-kilo.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-kiro.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-opencode.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -657,6 +662,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-trae.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -663,6 +668,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -661,6 +666,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
10 changes: 10 additions & 0 deletions graphify/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fi
# 2. Read shebang from graphify binary (pipx and direct pip installs)
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` to the interpreter, then strip any argument
# (pipx writes `.../python -E`) so a shebang argument is not mistaken for the
# path and rejected by the allowlist below (silent python3 fallback, #2629).
case "$_SHEBANG" in */env\ *) _SHEBANG="${_SHEBANG#*/env }" ;; esac
_SHEBANG="${_SHEBANG%% *}"
case "$_SHEBANG" in
*[!a-zA-Z0-9/_.@-]*) ;;
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
Expand Down Expand Up @@ -665,6 +670,11 @@ if [ ! -f graphify-out/.graphify_python ]; then
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
# Resolve `/usr/bin/env python` and strip any shebang argument (pipx
# writes `.../python -E`) before the allowlist check, else the space
# forces the unverified python3 fallback into .graphify_python (#2629).
case "$PYTHON" in */env\ *) PYTHON="${PYTHON#*/env }" ;; esac
PYTHON="${PYTHON%% *}"
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
else
PYTHON="python3"
Expand Down
Loading
Loading