Skip to content

main: use a better windows short-path comparison method #13598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bluetech
Copy link
Member

The previous check does not account for multiple levels of symlinks: given a -> b -> c, a would match b.

Note, I don't use Windows and can't actually verify it, I only saw it reading the code. But if it's wrong hopefully the existing test_do_not_collect_symlink_siblings test will catch it on Windows CI.

is_match = same_file and (
os.path.islink(node.path)
== os.path.islink(matchparts[0])
# account for short-paths on Windows (#11895). But use a version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the logic into a function in compat and add a unittests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Since I don't run windows, going to rely on CI to see if it actually passes there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I run Windows but didn't have time to check this.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Aug 10, 2025
The previous check does not account for multiple levels of symlinks:
given a -> b -> c, a would match b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants