Repository navigation
fix(filesystem): strip the NT path prefix from info-mode link targets - #517
Open
jaeminbird wants to merge 1 commit into
Open
jaeminbird wants to merge 1 commit into
jaeminbird wants to merge 1 commit into
Conversation
os.readlink returns absolute symlink and junction targets as \\?\C:\..., so info mode showed the NT path form. Strip the prefix (\\?\UNC\ becomes \\) and make the junction test match the exact target.
This branch has not been deployed
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.
Follow-up to #514.
test_symlink_info_reports_linkfails onmain(Python 3.14). The runner can create symlinks, so the test runs there. It is skipped on machines without that privilege.Cause: for absolute targets,
os.readlinkreturns the\\?\C:\...form, so info mode printedLink target: \\?\C:\.... That was a real output bug, not only a test problem. The junction test passed only because it checkedstr(target) in result, which matches without the prefix.Fix: strip
\\?\(and turn\\?\UNC\into\\) before showing the target. The junction test now checks the exactLink target:line.Validation: the junction test (which runs without privileges) fails before the fix and passes after. I also checked the symlink path with
os.readlinkmocked to return the CI value. Full suite: 1355 passed, 8 skipped.ruff checkis clean on the changed files.