mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
f6b184ccaf
Functions like urllib.parse.urlsplit() parses a file:// URL created from a non-UNC Windows absolute path with a leading slash in the path component: >>> from pathlib import Path >>> from urllib.parse import urlsplit >>> path = Path("C:/Users/VssAdministrator") >>> parsed = urlsplit(path.as_posix()) >>> parsed.path '/C:/Users/VssAdministrator' This value unfortunately does not play well with path functions like open(), so we performs some additional cleanup to strip that leading slash. This commit also contains some minor cleanup to unify how Windows is detected, and how a file:// URL is fetched.
4 lines
216 B
ReStructuredText
4 lines
216 B
ReStructuredText
Strip leading slash from a ``file://`` URL built from an path with the Windows
|
|
drive notation. This fixes bugs where the ``file://`` URL cannot be correctly
|
|
used as requirement, constraint, or index URLs on Windows.
|