
    RhG                         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                 Z   ddl }ddl}| j                  dd      } d| vrH| dd dk(  r| dd } | j                  d      }|j                  j                  d	j                  |            S | j                  d      }t        |      dk7  s|d   d
   |j                  vrd| z   }t        |      |d   d
   j                         }|d   j                  d      }|dz   }|D ]&  }|s|d	z   |j                  j                  |      z   }( |j                  d      r| j                  d      r|d	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////   /\z	Bad URL:    )stringurllib.parsereplacesplitparseunquotejoinlenascii_lettersOSErrorupperendswith)urlr   urllib
componentscomperrordrivepaths           !/usr/lib/python3.12/nturl2path.pyurl2pathnamer       s,     
++c3
C#:r7f ab'CYYs^
||##DIIj$9::99S>D
4yA~aF,@,@@c!enGBKEas#J3;D <$;!5!5d!;;D< }}Scll3/K    c                    ddl }| 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rH| dd dk(  rd| z   } | j                  d      }|j                  j                  dj                  |            S | j                  d	d      }t        |      dk7  st        |d         dkD  rd
| z   }t        |      |j                  j                  |d   j                               }|d   j                  d      }d|z   d	z   }|D ]&  }|s|dz   |j                  j                  |      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   z\\?\zUNC\r	   r   r   r   z
Bad path: z\\r   )maxsplitz///)r   r   r   r   r   quoter   r   )pr   r   r   r   r   r   s          r   pathname2urlr&   -   s`     	!u	abERa5;;=G#quAqVs],*++!8Ra5F? 
AWWT]
||!!#((:"6777737#D
4yA~T!W)q enLLtAw}}/Eat$J5=3D 9#: 2 24 88D9 Kr!   N)__doc__r    r&    r!   r   <module>r)      s   #J$r!   