Skip to content

fix(scripts): convert editable file URLs portably - #490

Open
mohgupta-ship-it wants to merge 5 commits into
mainfrom
codex/fix-editable-file-url-conversion
Open

fix(scripts): convert editable file URLs portably#490
mohgupta-ship-it wants to merge 5 commits into
mainfrom
codex/fix-editable-file-url-conversion

Conversation

@mohgupta-ship-it

Copy link
Copy Markdown
Member

Summary

  • Convert editable-install file URLs with the standard platform path adapter.
  • Preserve the empty-authority delimiter so valid POSIX double-slash paths remain local on Python 3.14 while Windows drive URLs lose their extra leading slash.
  • Add portable regression coverage for both URL shapes.

This builds on #486 and preserves the original author attribution while closing the compatibility gap found during validation.

Fixes #485

Validation

  • make lint
  • make format-check
  • ruff check scripts/compare_scan_accuracy.py
  • Targeted path-conversion tests: 3 passed
  • Full Python 3.12 suite: 3,980 passed, 14 skipped, 4 xfailed
  • Python 3.14 standard-library conversion probe for empty-authority double-slash paths

Submitted by Codex on behalf of Mohit Gupta.

SanHsien and others added 3 commits September 6, 2026 17:24
A Windows file URL's path is "/C:/Users/...". Path() reads the leading
slash as a root, so unquote() produced "C:\C:\Users\..." and the
following resolve(strict=True) raised WinError 123. url2pathname is the
stdlib conversion for this and is identical to the old behavior on POSIX,
where the path has no drive letter to double.

test_runtime_probe_hashes_installed_and_editable_dependency_bytes already
covers this; it just never runs on a Windows host in CI. On Windows 11 /
Python 3.13 it fails before this change and passes after.

Fixes #485

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: SanHsien <34234698+SanHsien@users.noreply.github.com>
Keep empty-authority delimiters intact for POSIX double-slash paths while retaining correct Windows drive conversion.

Prepared by Codex on behalf of Mohit Gupta.

Signed-off-by: Mohit Gupta <mohgupta@nvidia.com>
Construct the empty-authority delimiter explicitly so Python patch releases feed the same path shape to url2pathname.

Prepared by Codex on behalf of Mohit Gupta.

Signed-off-by: Mohit Gupta <mohgupta@nvidia.com>
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.

compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on Windows

2 participants