You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on Windows #485
The runtime identity probe in scripts/compare_scan_accuracy.py converts an editable dependency's direct_url.jsonfile:// URL to a local path with Path(urllib.parse.unquote(parsed.path)). On Windows that produces a doubled drive letter and the subsequent resolve(strict=True) raises.
A Windows file:// URL is file:///C:/Users/.../pkg, so urlsplit(...).path is /C:/Users/.../pkg — with a leading slash. Path() reads that slash as a root, so the result is C:\C:\Users\...\pkg:
>>> from urllib.parse import urlsplit, unquote
>>> from pathlib import Path
>>> Path(unquote(urlsplit("file:///C:/Users/me/pkg").path))
WindowsPath('/C:/Users/me/pkg') # -> resolves against the cwd drive as C:\C:\Users\me\pkg
resolve(strict=True) then raises:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect:
'C:\C:\Users\...\editable-dependency'
On POSIX the two are identical (/tmp/pkg either way), which is why CI does not see it.
Reproduction
On Windows, with the repo installed as an editable dependency:
uv run pytest tests/unit/test_compare_scan_accuracy.py::test_runtime_probe_hashes_installed_and_editable_dependency_bytes
Fails with the WinError 123 above. This is your existing test, unmodified — it already covers the bug, it just never runs on a Windows host in CI.
Suggested fix
urllib.request.url2pathname is the stdlib function for this conversion and is correct on both platforms:
Verified on Windows 11 / Python 3.13: the test above goes from failing to passing with that one-line change, and ruff check / ruff format --check stay clean. Happy to open a PR.
#486 and #490 clear the same single failure here, measured on Windows 11.
tests/unit/test_compare_scan_accuracy.py on main69dcdfb is 4 failed, 25 passed. With either PR applied it is 3 failed, and the one each clears is test_runtime_probe_hashes_installed_and_editable_dependency_bytes in both cases.
The visible difference is coverage rather than behaviour on this platform: #490 reports 28 passed against #486's 26, because #490 adds two tests of its own.
What I could not evaluate: #490 also says it preserves the empty-authority delimiter so valid POSIX double-slash paths survive. That is not observable from a Windows box, and it is the one place the two could actually differ, so it looks worth checking before picking between them.
The other three failures in that file are unrelated to both and reproduce on main.
Implementation is in progress in PR #490, which converts editable file:// dependency URLs without duplicating the Windows drive prefix. Keeping this issue open until the PR merges and the Windows regression is verified.
Thanks for the update. That sounds good to me.
I’ll leave #485 open while #490 lands and the Windows regression is verified. Thanks for carrying the fix forward.
Updated implementation links: PR #490 remains open for portable editable-dependency file-URL conversion. The open PR #636 also proposes Windows file-URL normalization alongside other Windows compatibility fixes. Neither has merged; the older PR #486 is closed unmerged. Keeping this issue open until an accepted fix lands.
Activity
docs: record the upstream contribution of the file:// URL fix
MohammedAlkindi commentedon Sep 10, 2026
#486 and #490 clear the same single failure here, measured on Windows 11.
tests/unit/test_compare_scan_accuracy.pyonmain69dcdfb is 4 failed, 25 passed. With either PR applied it is 3 failed, and the one each clears istest_runtime_probe_hashes_installed_and_editable_dependency_bytesin both cases.The visible difference is coverage rather than behaviour on this platform: #490 reports 28 passed against #486's 26, because #490 adds two tests of its own.
What I could not evaluate: #490 also says it preserves the empty-authority delimiter so valid POSIX double-slash paths survive. That is not observable from a Windows box, and it is the one place the two could actually differ, so it looks worth checking before picking between them.
The other three failures in that file are unrelated to both and reproduce on
main.rng1995 commentedon Sep 16, 2026
Implementation is in progress in PR #490, which converts editable
file://dependency URLs without duplicating the Windows drive prefix. Keeping this issue open until the PR merges and the Windows regression is verified.SanHsien commentedon Sep 17, 2026
Thanks for the update. That sounds good to me.
I’ll leave #485 open while #490 lands and the Windows regression is verified. Thanks for carrying the fix forward.
rng1995 commentedon Oct 4, 2026
Updated implementation links: PR #490 remains open for portable editable-dependency file-URL conversion. The open PR #636 also proposes Windows file-URL normalization alongside other Windows compatibility fixes. Neither has merged; the older PR #486 is closed unmerged. Keeping this issue open until an accepted fix lands.
PR-state snapshot checked on 2026-10-04:
Keeping this issue open: the relevant implementation is not merged. Check/review status is a point-in-time snapshot, not a claim of merge readiness.