fix(security-guidance): strip CRLF from Python version probe on Windows#68701
Open
AZERDSQ131 wants to merge 2 commits into
Open
fix(security-guidance): strip CRLF from Python version probe on Windows#68701AZERDSQ131 wants to merge 2 commits into
AZERDSQ131 wants to merge 2 commits into
Conversation
…ndows
The SessionStart hook command was invoked as a bare path:
${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh
On Windows this fails because CLAUDE_PLUGIN_ROOT contains backslashes.
Also, without an explicit `bash` prefix the command relies on the file's
executable bit, which git does not always preserve across platforms.
Replace with the same tr-based path normalization pattern used by
security-guidance (BUG-20):
bash -c 'R=$(echo "$CLAUDE_PLUGIN_ROOT" | tr \\ /); bash "$R/..."'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On Windows (Git Bash), Python's stdout is opened in text mode and emits \r\n line endings. bash command substitution $() strips the trailing \n but leaves \r, so the version string becomes "3\r" instead of "3". The comparison [ "$v" = "3" ] then always fails, causing sg-python.sh to skip every interpreter and exit 1 — making all security-guidance hooks silently inoperative on Windows. Fix: pipe the probe output through `tr -d '\r'` before the comparison. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closed
2 tasks
This was referenced Jun 16, 2026
2 tasks
This was referenced Jun 16, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.