HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_internal/utils/__pycache__/unpacking.cpython-311.pyc
�

�mi�2����dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl	mZddl
mZddlmZmZmZmZddlmZeje��ZeezZ	ddlZeez
Zn #e$re�d	��YnwxYw	ddlZeez
Zn #e$re�d
��YnwxYwd/d
�Zd0d�Zd1d�Z d2d�Z!d/d�Z"d3d�Z#d4d�Z$d5d6d#�Z%d7d$�Z&d8d)�Z'd9d+�Z(	d:d;d.�Z)dS)<zUtilities related archives.�)�annotationsN)�Iterable)�ZipInfo)�InstallationError)�BZ2_EXTENSIONS�TAR_EXTENSIONS�
XZ_EXTENSIONS�ZIP_EXTENSIONS)�
ensure_dirzbz2 module is not availablezlzma module is not available�return�intc�V�tjd��}tj|��|S)zBGet the current umask which involves having to set it temporarily.r)�os�umask)�masks �?D:\Python311\Lib\site-packages\pip/_internal/utils/unpacking.py�
current_umaskr-s!��
�8�A�;�;�D��H�T�N�N�N��K��path�str�	list[str]c�*�|�d���d��}d|vrJd|vr,|�d��|�d��ksd|vr|�dd��Sd|vr|�dd��S|dgS)N�/�\��)�lstrip�find�split�rs r�split_leading_dirr!4s����;�;�s���"�"�4�(�(�D�
�d�{��	
�����)�)�C�.�.�4�9�9�T�?�?�:��?C�4�?O���z�z�#�q�!�!�!�	
�����z�z�$��"�"�"��b�z�r�paths�
Iterable[str]�boolc�^�d}|D]'}t|��\}}|sdS|�|}�||krdS�(dS)zyReturns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)NFT)r!)r"�
common_prefixr�prefix�rests     r�has_leading_dirr)@se���M�����(��.�.�����	��5�5�
�	�"�M�M�
�}�
$�	��5�5�	��4r�	directory�targetc���tj�|��}tj�|��}tj�||g��}||kS)zL
    Return true if the absolute path of target is within the directory
    )rr�abspath�commonprefix)r*r+�
abs_directory�
abs_targetr's     r�is_within_directoryr1OsO���G�O�O�I�.�.�M������(�(�J�
�W�
!�
!�=�*�"=�
>�
>�F��]�"�"rc�,�dt��zdzS)Ni��I)r�rr�!_get_default_mode_plus_executabler5Zs���M�O�O�#�#�e�+�+r�Nonec�H�tj|t����dS)zx
    Make file present at path have execute for user/group/world
    (chmod +x) is no-op on windows per python docs
    N)r�chmodr5r s r�2set_extracted_file_to_default_mode_plus_executabler9^s#��
�H�T�4�6�6�7�7�7�7�7r�inforc�f�|jdz	}t|otj|��o|dz��S)N�r3)�
external_attrr$�stat�S_ISREG)r:�modes  r�zip_item_is_executablerAfs7�����#�D���<���d�+�+�<��u��=�=�=rT�filename�location�flattenc�R�t|��t|d��}	tj|d���}t	|�����o|}|���D�]�}|j}|}|rt|��d}tj
�||��}tj
�|��}	t||��s&d}
t|
�|||�����|�d��rt|����t|	��|�|��}	t|d��5}t#j||��ddd��n#1swxYwY|���t)|��rt+|����S#|���t)|��rt+|��wwxYw	|���dS#|���wxYw)	a�
    Unzip the file (with path `filename`) to the destination `location`.  All
    files are written based on system defaults and umask (i.e. permissions are
    not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written. Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    �rbT)�
allowZip64rzQThe zip file ({}) has a file ({}) trying to install outside target directory ({}))rr�wbN)r�open�zipfile�ZipFiler)�namelist�infolistrBr!rr�join�dirnamer1r�format�endswith�shutil�copyfileobj�closerAr9)
rBrCrD�zipfp�zip�leadingr:�name�fn�dir�message�fp�destfps
             r�
unzip_filer^msD���x������4� � �E� ��o�e��5�5�5��!�#�,�,�.�.�1�1�=�g���L�L�N�N�	O�	O�D��=�D��B��
0�&�t�,�,�Q�/������h��+�+�B��'�/�/�"�%�%�C�&�x��4�4�
P�4��(����x��X�(N�(N�O�O�O��{�{�;�'�'�
O��2������3�����X�X�d�^�^��O��b�$���7�6��*�2�v�6�6�6�7�7�7�7�7�7�7�7�7�7�7����7�7�7�7��H�H�J�J�J�-�d�3�3�O�J�2�N�N�N����H�H�J�J�J�-�d�3�3�O�J�2�N�N�N�N�O����5	O�:	���
�
�
�
�
�����
�
�
�
���sH�D.H�G� F�6G�F	�G�	F	�
G�
4H�5G6�6H�H&c������t��������d��s'�����d��rd}n������t��rd}nv�����t��rd}nG�����d��rd}nt
�d���d	}tj�|d
���}	td�|�
��D����}	tj�t���|rm|�
��D]X}t|j��\}}||_|���r$t|j��\}}	||kr|	|_�Yd����fd�}
|��|
���n"#t$$rt'��||��YnwxYw|���dS#|���wxYw)a�
    Untar the file (with path `filename`) to the destination `location`.
    All files are written based on system defaults and umask (i.e. permissions
    are not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied on top of the
    default.  Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    z.gzz.tgzzr:gzzr:bz2zr:xzz.tar�rz-Cannot determine compression type for file %szr:*zutf-8)�encodingc��g|]	}|j��
Sr4)rX)�.0�members  r�
<listcomp>zuntar_file.<locals>.<listcomp>�s��"N�"N�"N�6�6�;�"N�"N�"Nrrd�tarfile.TarInforrrc���|j}		�|���}nB#tj$r0tjdd�dvrtj|���}n�YnwxYwn<#tj$r*}d}t|��|�����d}~wwxYw|�	��r
|dzr�|_nd|_|S)N�>�rh�	��rh�
��rh��z%Invalid member in the tar file {}: {}r3)
r@�tarfile�LinkOutsideDestinationError�sys�version_info�
tar_filter�TarErrorrrP�isfile)	rdr�	orig_mode�excr[�data_filter�default_mode_plus_executablerBrCs	     ����r�
pip_filterzuntar_file.<locals>.pip_filter�s
���"�K�	��"�!,��V�X�!>�!>����"�>�
"�
"�
"��+�B�Q�B�/�4��"�&-�%7���%I�%I�F�F�!�#�F�
"�������'�	�	�	�E�G�,����$�����������		�����=�=�?�?�'�y�5�'8�'�">�F�K�K�#'�F�K��
s2��A�<A�A�A�A�B�*%B�B)�filterN)rdrfrrrrf)r�lowerrQrr	�logger�warningrrrIr)�
getmembersr{r5r!rX�islnk�linkname�
extractall�AttributeError�_untar_without_filterrT)
rBrCr@�tarrWrd�	name_lead�	name_rest�lnk_lead�lnk_restr}r{r|s
``         @@r�
untar_filer��st�������x�����~�~��� � ��'�'�
�8�>�>�+;�+;�+D�+D�V�+L�+L�
����	���	�	�	"�	"�>�	2�	2�����	���	�	�	"�	"�=�	1�	1�	����	���	�	�	"�	"�6�	*�	*��������;��	
�	
�	
���
�,�x���
8�
8�
8�C�C�!�"N�"N�S�^�^�=M�=M�"N�"N�"N�O�O��
:	8�!�-�K�,M�+N�+N�(��

7�"�n�n�.�.�7�7�F�+<�V�[�+I�+I�(�I�y�"+�F�K��|�|�~�~�7�->�v��-O�-O�*��(�#�y�0�7�.6�F�O��%
�%
�%
�%
�%
�%
�%
�%
�%
�N
�N�N�8�J�N�7�7�7�7��q�	D�	D�	D�!�(�H�c�7�C�C�C�C�C�	D����v	�	�	��������	�	�������s1�"+H0�G8�BH0�8H�H0�H�H0�0Ir��tarfile.TarFile�tarinforfc�L�tj�tj�|j��|j��}tj�|��}|�dd��}	|�|��dS#t$rYdSwxYw)zGCheck if the file pointed to by the symbolic link is in the tar archiverrTF)
rrrNrOrXr��normpath�replace�	getmember�KeyError)r�r�r�s   r�is_symlink_target_in_tarr��s����w�|�|�B�G�O�O�G�L�9�9�7�;K�L�L�H��w����)�)�H�����c�*�*�H���
�
�h�����t�������u�u����s�>B�
B#�"B#rWc���|���D�]J}|j}|rt|��d}tj�||��}t
||��s&d}t|�|||�����|�	��rt|����|���r�t||��s0d}t|�||j|j
�����	|�||����#t$r-}t �d||j|��Yd}~��:d}~wwxYw	|�|��}	nA#t&t(f$r-}t �d||j|��Yd}~���d}~wwxYwttj�|����|	�J�t-|d��5}
t/j|	|
��ddd��n#1swxYwY|	���|�||��|jdzrt9|����LdS)z/Fallback for Python without tarfile.data_filterrzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNrHr3)r�rXr!rrrNr1rrP�isdirr�issymr�r��_extract_member�	Exceptionr�r��extractfiler�r�rOrIrRrSrT�utimer@r9)rBrCr�rWrdrYrr[rzr\r]s           rr�r�	s����.�.�"�"�8I�8I��
�[���	*�"�2�&�&�q�)�B��w�|�|�H�b�)�)��"�8�T�2�2�	N�0�
�$�G�N�N�8�T�8�$L�$L�M�M�M��<�<�>�>�-	I��t�����
�\�\�^�^�+	I�+�C��8�8�
�4��(��N�N�8�V�[�&�/�J�J����
��#�#�F�D�1�1�1�1���	
�	
�	
����E���K��	������������	
����
��_�_�V�,�,�����n�-�	
�	
�	
����E���K��	������������	
����
�r�w���t�,�,�-�-�-��!�!�!��d�D�!�!�
/�V��"�2�v�.�.�.�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/����
/�
/�
/�
/��H�H�J�J�J��I�I�f�d�#�#�#��{�U�"�
I�B�4�H�H�H��q8I�8IsB�D�
E�'"E�E�E.�.F,�?"F'�'F,�/H�H	�H	�content_type�
str | Nonec�J�tj�|��}|dks@|����t
��st
j|��r(t|||�d�����dS|dksPtj
|��s<|����ttztz��rt||��dSt�d|||��t#d|�����)Nzapplication/zipz.whl)rDzapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of )rr�realpathrrQr
rJ�
is_zipfiler^rr�
is_tarfilerrr	r�r��criticalr)rBrCr�s   r�unpack_filer�Ns4��
�w����)�)�H��)�)�R��>�>���$�$�^�4�4�R���h�'�'�R�
	�8�X�8�3D�3D�V�3L�3L�/L�M�M�M�M�M�M��,�,�R���h�'�'�R��>�>���$�$�^�n�%D�}�%T�U�U�R�
	�8�X�&�&�&�&�&�	���
+����	
�	
�	
� � P�h� P� P�Q�Q�Qr)rr
)rrrr)r"r#rr$)r*rr+rrr$)rrrr6)r:rrr$)T)rBrrCrrDr$rr6)rBrrCrrr6)r�r�r�rfrr$)
rBrrCrr�r�rWr$rr6)N)rBrrCrr�r�rr6)*�__doc__�
__future__r�loggingrrRr>rtrrrJ�collections.abcrr�pip._internal.exceptionsr�pip._internal.utils.filetypesrrr	r
�pip._internal.utils.miscr�	getLogger�__name__r��SUPPORTED_EXTENSIONS�bz2�ImportError�debug�lzmarr!r)r1r5r9rAr^r�r�r�r�r4rr�<module>r�s���!�!�"�"�"�"�"�"�����	�	�	�	�
�
�
�
�����
�
�
�
���������$�$�$�$�$�$�������6�6�6�6�6�6�������������0�/�/�/�/�/�	��	�8�	$�	$��&��6��0��J�J�J��N�*�����0�0�0�
�L�L�.�/�/�/�/�/�0����1��K�K�K��M�)�����1�1�1�
�L�L�/�0�0�0�0�0�1��������	�	�	�	�����#�#�#�#�,�,�,�,�8�8�8�8�>�>�>�>�+�+�+�+�+�\]�]�]�]�@����BI�BI�BI�BI�P $�R�R�R�R�R�R�Rs$�	A)�)B�B�
	B�B1�0B1