tests: skip the preflight symlink case when Windows refuses symlinks #1126
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1126
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1126/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Toons29 on GitHub · 2026-11-24 01:27 UTC · original
Toons29:tests/preflight-symlink-skip→main· +14 −1 · 1 files · 1 commits · merged 2026-11-24 02:06 UTCChange
pe_package_import_closurefails on a Windows account that can't create symlinks (no Developer Mode, not elevated).test_inspect_never_executes_and_ignores_non_pe_filescreateslinked.dllas a symlink at the very end, and on such an account that raisesOSError: [WinError 1314] A required privilege is not held by the client. The test errors, so everything before it goes unreported too. CI doesn't hit this because the runner can create symlinks.This moves the symlink check into its own test,
test_inspect_refuses_a_symlinked_pe_candidate, which callsskipTestonly when the error isERROR_PRIVILEGE_NOT_HELD(1314). Any otherOSErrorstill fails. The assertion itself is unchanged, and the rest of the original test now runs on every account.Verification
At
c579c564(on maina7710b73), Windows 11 build 26300, MSVC 19.44, Python 3.14, standard user account without Developer Mode,devpreset:ctest --preset dev --no-tests=error -R '^pe_package_import_closure$'failed with the WinError 1314 traceback above (FAILED (errors=1), 12 tests).out\pe-env\Scripts\python.exe -B tests\pe_package_preflight_check.py -vgivesRan 13 tests ... OK (skipped=1), and the skip readsthis Windows account cannot create symlinks (WinError 1314).I couldn't run the symlink branch itself on this account; CI, which can create symlinks, still runs it.
Checklist
AI-assisted.
@tedin7 on GitHub · 2026-11-24 02:02 UTC · original · reviewed
Reviewed at
c579c564a47c1bce135a9856291c0baaeec6460d(tests/pe_package_preflight_check.py).test_inspect_refuses_a_symlinked_pe_candidateand skipping only whengetattr(error, "winerror", None) == 1314(ERROR_PRIVILEGE_NOT_HELD) cleanly unblocks non-elevated Windows accounts without masking otherOSErrors or non-Windows failures, while keeping all non-symlink assertions intest_inspect_never_executes_and_ignores_non_pe_files.python3 -m py_compile tests/pe_package_preflight_check.py,python3 -B tests/docs_links_check.py,python3 -B tests/bidi_controls_check.py,python3 -B tests/gpu_report_format_check.py,python3 -B tests/xgameruntime_table_check.py— all passed. (pe_package_preflight_check.pyitself was not executed here becausepefileis not installed in this container.)