Re @ s d d l Z d d l Z d d l m Z d d l m Z d d l m Z e rj d d l m
Z
m Z m Z d d Z
d d Z d
d Z d S) N)parse)request)MYPY_CHECK_RUNNING)OptionalTextUnionc C s* d | k r d S| j d d d j S)N: r )splitlower)url r
/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/urls.pyget_url_scheme
s r c C s= t j j t j j | } t j d t j | } | S)zh
Convert a path to a file: URL. The path will be made absolute and have
quoted path parts.
zfile:)ospathnormpathabspathurllib_parseurljoinurllib_requestpathname2url)r r r
r
r path_to_url s r c C s | j d s' t d j t t j | \ } } } } } | sX | d k ra d } n4 t j d k r} d | } n t d j t t j
| | } | S)z(
Convert a file: URL to a path.
zfile:z9You can only turn file: urls into filenames (not {url!r}) localhost win32z\\z?non-local file URIs are not supported on this platform: {url!r})
startswithAssertionErrorformatlocalsr urlsplitsysplatform
ValueErrorr url2pathname)r _netlocr r
r
r url_to_path s
r' )r r! Zpip._vendor.six.moves.urllibr r r r pip._internal.utils.typingr typingr r r r r r' r
r
r
r