You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_git_backup_rotate_advice_974.py: pre_commit.write_text has no newline= guard against CRLF shebang on Windows #994
filed-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.lane-otherfits no other lane — kept so an unlabelled issue means untriaged, not 'nothing matched'priority:lowReal, but neither blocking nor compounding fast
tests/test_git_backup_rotate_advice_974.py:154's test_could_not_untrack_also_logs_rotate_advice
forces the hook's "could not untrack" branch by writing a pre-commit git hook script:
Path.write_text with no newline="" argument uses Python's default text-mode newline
translation, which on Windows rewrites every \n to \r\n on write. A CRLF-terminated shebang
line (#!/bin/sh\r\n) can make some shebang parsers read /bin/sh\r as the interpreter path and
fail to exec, rather than running and exiting 1 as intended -- the script would silently stop
doing what the test relies on it doing.
Why this is inert today: the whole test file carries pytestmark = pytest.mark.skipif(sys.platform == "win32", ...) for an unrelated reason (#79,
bash hook subprocess + POSIX flock/git semantics), so this file never runs on the one platform
where write_text's CRLF translation would matter. CI's own matrix
(.github/workflows/tests.yml, os: [ubuntu-latest, macos-latest, windows-latest]) confirms windows-latest is exactly the leg this skip exempts, so nothing in CI today exercises the CRLF
path either way.
What would make this live: if the #79 skip reason is ever narrowed or removed (e.g. if a
future change makes the bash-hook mechanism itself portable), this specific line needs newline="\n" added, or the content written via open(path, "wb") with an explicit b"...\n"
payload, before the test could be trusted on Windows. Re-check at that point rather than
assuming this issue was already closed by that change.
Confirmed still true by reading tests/test_git_backup_rotate_advice_974.py:154 and .github/workflows/tests.yml directly at HEAD; not independently run on a Windows box (none
available). Originally logged in trap.d/989.pre-commit-hook-script-crlf-write-text.md during
a curate pass, declined there as a one-off code observation rather than an agent-facing lesson,
with this issue filed as its tracking record per that pass's own rule (#1736).
filed-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.lane-otherfits no other lane — kept so an unlabelled issue means untriaged, not 'nothing matched'priority:lowReal, but neither blocking nor compounding fast
Activity
curate(trap.d): decline 1 fragment, filed as a tracking issue (#994) (#…
Fix #1002 CI (round 6): CRLF-corrupted stub scripts and wholesale env…
Fix #1002: route PostToolUse's background save through a hidden launc…
Fix Digital-Process-Tools#994: write the CRLF-unsafe pre-commit hook …
Fix #999: CRLF-safe shebang writes in three sibling test fixtures (#1068