Skip to content

fix(tests): skip symlink test when Windows lacks privilege#744

Open
pranav-afk wants to merge 2 commits into
usestrix:mainfrom
pranav-afk:fix/windows-symlink-test-skip
Open

fix(tests): skip symlink test when Windows lacks privilege#744
pranav-afk wants to merge 2 commits into
usestrix:mainfrom
pranav-afk:fix/windows-symlink-test-skip

Conversation

@pranav-afk

Copy link
Copy Markdown

On Windows without Administrator or Developer Mode, Path.symlink_to raises WinError 1314 and crashes the suite. Skip with a clear remediation message instead. Fixes #650.

@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the symlink-size test handle Windows privilege limits.

  • Skips the symlink test when Windows reports privilege error 1314.
  • Re-raises other symlink creation errors so setup failures still fail the test.
  • Adds a remediation message for running as Administrator or enabling Developer Mode.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
tests/test_local_sources.py The symlink test now skips only the intended Windows privilege error and keeps other symlink failures visible.

Reviews (2): Last reviewed commit: "fix(tests): only skip symlink test on Wi..." | Re-trigger Greptile

Comment thread tests/test_local_sources.py
@pranav-afk
pranav-afk force-pushed the fix/windows-symlink-test-skip branch from 951818f to 9ac12b9 Compare July 13, 2026 11:08
@0xallam
0xallam force-pushed the main branch 2 times, most recently from 44e87ca to daf39a2 Compare July 13, 2026 23:50
@0xallam
0xallam force-pushed the fix/windows-symlink-test-skip branch from 9ac12b9 to 0a53c2b Compare July 13, 2026 23:51
@AnnasMazhar

Copy link
Copy Markdown

This fix looks correct and complete — catches the privilege error, shows a clear message, and re-raises other OSErrors. The production code (directory_size_bytes) already handles symlinks correctly via os.scandir() with follow_symlinks=False, so only the test needed changes. Ship it. 🚀

@bearsyankees

Copy link
Copy Markdown
Collaborator

@greptile

On Windows without Administrator or Developer Mode, Path.symlink_to raises WinError 1314 and crashes the suite. Skip with a clear remediation message instead. Fixes usestrix#650.
Re-raise unrelated OSErrors so setup failures are not hidden as skips.
@pranav-afk
pranav-afk force-pushed the fix/windows-symlink-test-skip branch from 0a53c2b to a4dc0a8 Compare July 15, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] WinError 1314 when creating symbolic links on Windows without Administrator privileges

3 participants