Skip to content

Preserve UNC roots when normalizing link targets - #277

Open
123qeew wants to merge 1 commit into
jaraco:mainfrom
123qeew:fix/readlink-unc-targets
Open

123qeew wants to merge 1 commit into
jaraco:mainfrom
123qeew:fix/readlink-unc-targets

Conversation

@123qeew

@123qeew 123qeew commented Oct 27, 2026

Copy link
Copy Markdown

Path.readlink() strips the Windows extended path prefix from every target. When os.readlink() returns an extended UNC target, this leaves UNC\server\share\file, a relative path, instead of the network path \\server\share\file.

Handle the extended UNC prefix before the existing drive-path normalization. Add regression coverage for extended UNC paths and unchanged drive-prefixed, ordinary UNC and relative paths, plus a news fragment.

Validation: the UNC regression fails on the base. tox passes with 168 tests, one skip and 99% coverage; baseline was 164 tests and one skip. Ruff lint/format checks pass. Tests simulate the documented Windows os.readlink() output on macOS; native Windows execution has not been run locally.

Found and implemented with Codex during a code audit; the reproduction and checks were run locally.

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.

1 participant