� c��jF ���dZd�Zd�Zy)z�Convert 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��ddl}ddl}|dddk(r|dd}n |dddk(r|dd}|dddk(r|d d}|jd d �}d |vr+|jj |jd d ��S|j d �}t |�dk7s|dd|jvrd|z}t|��|ddj�}|jj |d jd d ��}|d z|zS)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 �#/usr/lib64/python3.12/nturl2path.py� url2pathnamer s�� � �2�A�w�%���!�"�g�� �S�b��^� #��"�#�h�� �2�A�w�%���!�"�g�� �+�+�c�3� �C� �#�:��|�|�#�#�C�K�K��T�$:�;�;� �9�9�S�>�D� �4�y�A�~��a����F�,@�,@�@��c�!���e�n�� ��G�B�K� � � �E� �<�<� � ��Q�����T� :� ;�D� �3�;�� ��c��ddl}|jdd�}|dddk(r:|dd}|ddj�dk(r d|ddz}n|d d d k7rtd |z��d |vr|jj |�S|j d d � �}t|�d k7st|d�d kDrd |z}t|��|jj |dj��}|jj |d �}d|zd z|zS)z{OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.rNr r �z//?/zUNC/z//r rr z Bad path: )�maxsplitr)rrrrr�quoterr)�prrrrrs r� pathname2urlr'*s��� � � �$���A���!�u��� �a�b�E�� �R�a�5�;�;�=�F� "��q���u� �A� �q��V�s�]��,��*�+� +� �!�8��|�|�!�!�!�$�$� �7�7�3��7� #�D� �4�y�A�~��T�!�W���)��q� ���e�n�� �L�L� � �t�A�w�}�}�� /�E� �<�<� � �d�1�g� &�D� �5�=�3� �� %�%r!N)�__doc__r r'�r!r�r*s��� �D&r!