Skip to content

fix(testing): use arePathsSame when comparing resolvedPath and cwd in pytest symlink check - #26229

Open
MOHAMMED WASIM KHAN (wasim-builds) wants to merge 1 commit into
microsoft:mainfrom
wasim-builds:fix-26050-case-insensitive-path-warning
Open

MOHAMMED WASIM KHAN (wasim-builds) wants to merge 1 commit into
microsoft:mainfrom
wasim-builds:fix-26050-case-insensitive-path-warning

Conversation

@wasim-builds

Copy link
Copy Markdown

Fixes #26050

Summary

In handleSymlinkAndRootDir, resolvedPath is compared to cwd using strict identity (resolvedPath !== cwd). On case-insensitive file systems (such as Windows, where drive letters or paths may differ only by case like c:\clones\python-soundfile vs C:\clones\python-soundfile), this caused a false positive warning:
Working directory resolves to different path: ${cwd} -> ${resolvedPath}. Checking for symlinks in parent directories.
and triggered unnecessary recursive parent directory symlink checks.

This PR:

  1. Replaces resolvedPath !== cwd with !arePathsSame(resolvedPath, cwd) using the extension's cross-platform arePathsSame helper.
  2. Adds unit tests covering handleSymlinkAndRootDir verifying that parent symlink checking is bypassed when paths differ only by casing on case-insensitive filesystems while still properly checking parents when paths truly resolve to different locations.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

"[warning] Working directory resolves to different path" due to case-sensitive comparison

2 participants