Skip to content

Commit 6690159

Browse files
Try: set scheme as "file" if not set
1 parent 28f33b4 commit 6690159

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

micropip/wheelinfo.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ def from_url(cls, url: str) -> "WheelInfo":
6969
See https://www.python.org/dev/peps/pep-0427/#file-name-convention
7070
"""
7171
parsed_url = urlparse(url)
72-
if parsed_url.scheme == "":
73-
url = "file:///" + url
72+
if not parsed_url.scheme:
73+
parsed_url = ParseResult(
74+
scheme="file",
75+
netloc=parsed_url.netloc,
76+
path=parsed_url.path,
77+
params=parsed_url.params,
78+
query=parsed_url.query,
79+
fragment=parsed_url.fragment,
80+
)
7481
file_name = Path(parsed_url.path).name
7582
name, version, build, tags = parse_wheel_filename(file_name)
7683
return WheelInfo(

0 commit comments

Comments
 (0)