File: D:/Python311/Lib/site-packages/pip/_internal/utils/__pycache__/urls.cpython-311.pyc
�
�miA � �R � d dl Z d dlZd dlZd dlZddlmZ dedefd�Zdedefd�Z dS ) � N� )�WINDOWS�path�returnc � � t j � t j � | � � � � } t j � dt j � | � � � � }|S )zh
Convert a path to a file: URL. The path will be made absolute and have
quoted path parts.
zfile://) �osr �normpath�abspath�urllib�parse�urljoin�request�pathname2url)r �urls �:D:\Python311\Lib\site-packages\pip/_internal/utils/urls.py�path_to_urlr sS � �
�7���B�G�O�O�D�1�1�2�2�D�
�,�
�
�y�&�.�*E�*E�d�*K�*K�
L�
L�C��J� r c �� � | � d� � sJ d| �d�� � �t j � | � � \ }}}}}|r|dk rd}nt rd|z }nt d| ��� � �t j � ||z � � }t rK|sIt |� � dk r6|d d
k r*|d t j
v r|dd
� dv r
|dd� }|S )z(
Convert a file: URL to a path.
zfile: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)�
startswithr r �urlsplitr �
ValueErrorr �url2pathname�len�string�
ascii_letters)r �_�netlocr s r �url_to_pathr&