관리-도구
편집 파일: urls.cpython-38.pyc
U &?�f? � @ sP d dl Z d dlZd dlZd dlZddlmZ eed�dd�Zeed�dd �Z dS ) � N� )�WINDOWS)�path�returnc C s. t j�t j�| ��} tj�dtj�| ��}|S )zh Convert a path to a file: URL. The path will be made absolute and have quoted path parts. �file:) �osr �normpath�abspath�urllib�parse�urljoin�request�pathname2url)r �url� r �F/opt/hc_python/lib/python3.8/site-packages/pip/_internal/utils/urls.py�path_to_url s r )r r c C s� | � d�std| �d���tj�| �\}}}}}|r<|dkrBd}ntrPd| }ntd| ����tj�|| �}tr�|s�t |�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 � � )�:z:/N)� startswith�AssertionErrorr r �urlsplitr � ValueErrorr �url2pathname�len�string� ascii_letters)r �_�netlocr r r r �url_to_path s8 � � ��� � ���r% ) r r! �urllib.parser �urllib.request�compatr �strr r% r r r r �<module> s