U 巀g?@sPddlZddlZddlZddlZddlmZeedddZeeddd Z dS) N)WINDOWS)pathreturncCs.tjtj|}tjdtj|}|S)zh Convert a path to a file: URL. The path will be made absolute and have quoted path parts. file:) osrnormpathabspathurllibparseurljoinrequest pathname2url)rurlrF/opt/hc_python/lib/python3.8/site-packages/pip/_internal/utils/urls.py path_to_url sr)rrcCs|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. rz1You can only turn file: urls into filenames (not ) localhostz\\z8non-local file URIs are not supported on this platform: r/r):z:/N) startswithAssertionErrorr r urlsplitr ValueErrorr url2pathnamelenstring ascii_letters)r_netlocrrrr url_to_paths8       r%) rr! urllib.parser urllib.requestcompatrstrrr%rrrrs