U
ʗRe @ sp d dl Z d dlZd dlZd dlZd dlmZ ddlmZ e ee dddZ
e e dd d
Ze e dddZdS )
N)Optional )WINDOWS)urlreturnc C s d| krd S | ddd S )N:r r )splitlower)r r
/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/utils/urls.pyget_url_scheme
s r )pathr c C s. t jt j| } tjdtj| }|S )zh
Convert a path to a file: URL. The path will be made absolute and have
quoted path parts.
file:) osr
normpathabspathurllibparseurljoinrequestpathname2url)r
r r
r
r path_to_url s r c C s | dstd| dtj| \}}}}}|r<|dkrBd}ntrPd| }ntd| tj|| }tr|st |dkr|d d
kr|d t
jkr|dd
dkr|dd }|S )z(
Convert a file: URL to a path.
r z1You can only turn file: urls into filenames (not ) localhost z\\z8non-local file URIs are not supported on this platform: r /r )r z:/N)
startswithAssertionErrorr r urlsplitr
ValueErrorr url2pathnamelenstring
ascii_letters)r _netlocr
r
r
r url_to_path s8
r) )
r r% urllib.parser urllib.requesttypingr compatr strr r r) r
r
r
r