
    	gF	                         d Z d Zd Zy)zConvert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
c                    ddl }ddl}| dd dk(  r| dd } n| dd dk(  r| dd } | dd dk(  r| d	d } | j                  d
d      } d| vr+|j                  j	                  | j                  dd            S | j                  d      }t        |      dk7  s|d   d   |j                  vrd| z   }t        |      |d   d   j                         }|j                  j	                  |d	   j                  dd            }|d
z   |z   S )z{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.    N   ///      z//localhost/      :|/\z	Bad URL: )
stringurllib.parsereplaceparseunquotesplitlenascii_lettersOSErrorupper)urlr   urllibcomperrordrivetails          lib/python3.12/nturl2path.pyurl2pathnamer       s     
2Aw% !"g	Sb^	#"#h
2Aw%!"g
++c3
C#: ||##CKKT$:;;99S>D
4yA~aF,@,@@c!enGBKE<<QT :;D3;    c                    ddl }| j                  dd      } | dd dk(  r:| dd } | dd j                         dk(  r	d| dd z   } n| d	d
 dk7  rt        d| z         d| vr|j                  j                  |       S | j                  dd
      }t        |      d
k7  st        |d         d	kD  rd| z   }t        |      |j                  j                  |d   j                               }|j                  j                  |d	         }d|z   dz   |z   S )z{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.r   Nr   r      z//?/zUNC/z//r	   r   r
   z
Bad path: )maxsplitr   )r   r   r   r   r   quoter   r   )pr   r   r   r   r   s         r   pathname2urlr'   *   s     	
		$A!uabERa5;;=F"quAqVs],*++!8||!!!$$7737#D
4yA~T!W)q enLLtAw}}/E<<d1g&D5=3%%r!   N)__doc__r    r'    r!   r   <module>r*      s    D&r!   