U jaG@sTddlZddlZddlZddlZddlmZddlmZddZ ddZ d d Z dS) N)Optional)WINDOWScCs d|kr dS|dddS)N:rr)splitlower)urlr p/private/var/folders/k6/_7fsz4ts3b78x3b3xwrxjh_c8s8xv7/T/pip-unpacked-wheel-bug3gbve/pip/_internal/utils/urls.pyget_url_scheme sr cCs.tjtj|}tjdtj|}|S)zh Convert a path to a file: URL. The path will be made absolute and have quoted path parts. file:) ospathnormpathabspathurllibparseurljoinrequest pathname2url)rrr r r path_to_urlsrcCs|dstd|dtj|\}}}}}|r<|dkrBd}ntrPd|}ntd|tj||}tr|st |dkr|d d kr|d t j kr|d d dkr|d d}|S)z( Convert a file: URL to a path. r z1You can only turn file: urls into filenames (not ) localhostz\\z8non-local file URIs are not supported on this platform: r/r)rz:/N) startswithAssertionErrorrrurlsplitr ValueErrorr url2pathnamelenstring ascii_letters)r_netlocrr r r url_to_paths8       r() r r$ urllib.parserurllib.requesttypingrcompatrr rr(r r r r s