a
    ñ»jA  ã                   @   sP   d dl Z d dlZd dlZd dlZddlmZ eedœdd„Zeedœdd	„Z	dS )
é    Né   )ÚWINDOWS)ÚpathÚreturnc                 C   s.   t j t 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.
    zfile://)	Úosr   ÚnormpathÚabspathÚurllibÚparseÚurljoinÚrequestÚpathname2url)r   Úurl© r   ú>E:\soccer\ml_env\Lib\site-packages\pip/_internal/utils/urls.pyÚpath_to_url	   s    r   )r   r   c                 C   s¼   |   d¡sJ d| ›d�ƒ‚tj | ¡\}}}}}|r<|dkrBd}ntrPd| }ntd| ›�ƒ‚tj || ¡}tr¸|s¸t|ƒdkr¸|d	 d
kr¸|d t	j
v r¸|dd… dv r¸|dd… }|S )z(
    Convert a file: URL to a path.
    zfile: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   r   r   r   Úurl_to_path   s8    ÿ
þ
ÿÿþ
ý
üûúr#   )
r   r   Úurllib.parser	   Úurllib.requestÚcompatr   Ústrr   r#   r   r   r   r   Ú<module>   s   
