Your IP : 3.143.7.112


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/shutil.cpython-312.opt-2.pyc

�

�Q�f����T�	ddlZddlZddlZddlZddlZddlZddlZ	ddlZ[dZ	ddl
Z
[
dZ	ddlZ[dZ
ejdk(ZdxZZejdk(rddlZnerddlZej$dk(rddlZndZerdndZeed	�xrej$j-d
�aexr	eed�ZdZgd
�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Z Gd�de!�Z"Gd�de!�Z#d�Z$d�Z%efd�Z&dqd�Z'd �Z(d!�Z)d"�Z*dd#�d$�Z+dd#�d%�Z,eed&�rdd#�d'�Z-nd(�Z-dd#�d)�Z.dd#�d*�Z/dd#�d+�Z0d,�Z1	drd-�Z2dde0ddfd.�Z3eejhd/�rd0�Z5nd1�Z5d2�Z6d3�Z7ejpejejrejthejvkxr2ejxejzvxrejej|vZ?dsddd4�d5�Z@e?e@_Ad6�ZBe0fd7�ZCd8�ZDd9�ZEd:�ZFd;�ZG		dtd<�ZH		dud=�ZIdeH_JdeI_Jd>eHd?gd@fiZKereHdAgdBfeKdC<eIgdDfeKdE<er	eHdFgdGfeKdH<e
r	eHdIgdJfeKdK<dL�ZLdvdM�ZMdN�ZN		dwdO�ZOdP�ZPdQ�ZQ		dvdR�ZRdS�ZSdT�ZTdU�ZUddV�dW�ZVdXgeVgd@fdYgeUgdDfdZ�ZWerd[d\geVgdBfeWdC<erd]d^geVgdGfeWdH<e
rd_d`geVgdJfeWdK<da�ZXdxddV�db�ZYeedc�r[ej�dd�ej�dedf�Z\dge\j�_^dhe\j�_^die\j�_^dj�Zan)er'ej�dd�ej�dedf�Z\dk�Zadxdl�Zbdydm�Zcdn�Zddo�Zeej�ej�zdfdp�Zhy#e	$rdZY��dwxYw#e	$rdZY��jwxYw#e	$rdZ
Y��pwxYw)z�NTF�nt�posix�win32ii�sendfile�linux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC)�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc��eZdZy)rN��__name__�
__module__�__qualname__���-/opt/alt/python312/lib64/python3.12/shutil.pyrrCs��r(rc��eZdZy)r!Nr#r'r(r)r!r!Fs��?r(r!c��eZdZy)rNr#r'r(r)rrIs��;r(rc��eZdZy)rNr#r'r(r)rrMs��5r(rc��eZdZy)�	ReadErrorNr#r'r(r)r.r.Ps��/r(r.c��eZdZy)�
RegistryErrorNr#r'r(r)r0r0Ss��&r(r0c��eZdZy)�_GiveupOnFastCopyNr#r'r(r)r2r2Ws��r(r2c��		|j�}|j�}	tj|||�y#t$r}t|��d}~wwxYw#t
$ra}|j|_|j|_|jtjtjhvrt|��|d�d}~wwxYw�N)�fileno�	Exceptionr2rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errs      r)�_fastcopy_fcopyfilerD\s����%��{�{�}�����
�� �
����u�e�,��	�%���$�$��%��
� ��y�y����	�	��
��9�9����u�}�}�5�5�#�C�(�(��4���
 �s-� <�A�	A�A�A�	C�!AB=�=Cc���		|j�}|j�}	tt	j
|�jd�}tjdkrt|d�}d}		t	j||||�}|dk(ry||z
}�%#t$r}t|��d}~wwxYw#t$rd}Y�pwxYw#t$r�}|j|_
|j|_|jtj k(r
dat|��|jtj$k(r|d�|dk(r3t	j&|dtj(�dk(rt|��|�d}~wwxYw)Ni�ili@rF)r5r6r2�max�os�fstat�st_sizer7�sys�maxsize�minrr8r9r:r;�ENOTSOCK�_USE_CP_SENDFILE�ENOSPC�lseek�SEEK_CUR)r>r?rArBrC�	blocksize�offset�sents        r)�_fastcopy_sendfilerUps[���%��{�{�}�����
���������.�.��8�	�
�{�{�W���	�7�+�	�
�F�
�	��;�;�u�d�F�I�>�D�,�q�y���d�N�F�5��%�%���$�$��%�����	����	��9�9�C�L� �I�I�C�M��y�y�E�N�N�*�$)� �'��,�,��y�y�E�L�L�(��t�#���{�r�x�x��q�"�+�+�>�!�C�'��,�,��I��'	�sA� B�)B0�0C�	B-�B(�(B-�0B>�=B>�	E5�
B&E0�0E5c��	|j}|j}tt|��5}	||�}|sn%||kr|d|5}||�ddd�n	||��0ddd�y#1swY�xYw#1swYyxYwr4)�readinto�write�
memoryview�	bytearray)r>r?�length�
fsrc_readinto�
fdst_write�mv�n�smvs        r)�_copyfileobj_readintora�s����
�M�M�M����J�	�I�f�%�	&�"���b�!�A����V�����V�s��s�O����2���
'�	&��V��

'�	&�s#�A5�	A)�A5�)A2	�.A5�5A>c��	|st}|j}|j}||�x}r||�||�x}r�yyr4)�COPY_BUFSIZE�readrX)r>r?r[�	fsrc_readr]�bufs      r)r	r	�sH��G�����	�	�I����J��6�"�
"�#�
"��3���6�"�
"�#�
"r(c��t|tj�r\ttjd�rB	tjj|j
�tj|��Sttjd�r!	tjj||�Stjjtjj|��tjjtjj|��k(S#t$rYywxYw#t$rYywxYw)N�samestatF�samefile)�
isinstancerG�DirEntry�hasattr�pathrh�statr7ri�normcase�abspath��src�dsts  r)�	_samefilert�s����#�r�{�{�#������(D�	��7�7�#�#�C�H�H�J������=�=��r�w�w�
�#�	��7�7�#�#�C��-�-�

�G�G���R�W�W�_�_�S�1�2��G�G���R�W�W�_�_�S�1�2�
3�4���	��	���	��	�s$�AD+�D:�+	D7�6D7�:	E�Ec��t|tj�r|j�Stj|�Sr4)rjrGrkrn��fns r)�_statrx�s(��"�2�r�{�{�3�2�7�7�9�D������Dr(c��t|tj�r|j�Stjj|�Sr4)rjrGrk�
is_symlinkrm�islinkrvs r)�_islinkr|�s-��(��R�[�[�9�2�=�=�?�Q�r�w�w�~�~�b�?Q�Qr(��follow_symlinksc
��	tjd||�t||�rtdj	||���d}t||g�D]\}}	t
|�}tj|j�r6t|tj�r|jn|}td|z��ts�n|dk(s�t|j }��|s6t%|�r+tj&tj(|�|�|St+|d�5}	t+|d�5}t,r0	t/||t0j2�|cddd�cddd�St6r!	t9||�|cddd�cddd�Str4|dkDr/t;||t=|t>��|cddd�cddd�StA||�ddd�ddd�|S#t"$rY���wxYw#t4$rY�9wxYw#t4$rY�HwxYw#1swY�AxYw#tB$r4}	tjjE|�stGd|���|	��d}	~	wwxYw#1swY|SxYw)Nzshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wbzDirectory does not exist: )$rJ�auditrtr!�format�	enumeraterxrn�S_ISFIFO�st_moderjrGrkrmr�_WINDOWSrIr7r|�symlink�readlink�open�_HAS_FCOPYFILErDr�_COPYFILE_DATAr2rNrUrarLrcr	�IsADirectoryError�exists�FileNotFoundError)
rrrsr~�	file_size�irw�str>r?�es
          r)r
r
�s6����I�I���c�*���c���=�D�D�S�#�N�O�O��I��C��:�&���2�	'��r��B��}�}�R�Z�Z�(� *�2�r�{�{� ;�R�W�W���&�'=��'B�C�C��A��F��J�J�	�'��w�s�|�
�
�
�2�;�;�s�#�S�)�D�J�A�#�t�_��
��#�t�_��%�!�/��d�E�<P�<P�Q�#&�,�,�	�	�*�!�.�t�T�:�#&�,�,�	�	�&"�i�!�m�-�d�D�#�i��:V�W�"�',�,�	�	�. ��d�+�+%��@�J��]�	��	��, 1�!� �!�� 1�!� �!��%�_��0%�
��w�w�~�~�c�*�+�.H���,N�O�UV�V���	
��5�@�J�s��G�I�H�#H�+G)�	H�H�!
G8�.	H�'H�(	H�;H�H�	G&�%G&�)	G5�2H�4G5�5H�8	H�H�H�H�H	�H�	I�/I�I�I�Ic��	tjd||�|s�t|�r�tjj|�rftjdk(r!tjtj}}n�ttd�r!tjtj}}njytjdk(r@tjj|�r!tjj|d��}ttj}}||�}||tj|j��y)Nzshutil.copymoder�lchmodT��strict)rJr�r|rGrmr{r8�lstat�chmodrlr��realpathrxrn�S_IMODEr�)rrrsr~�	stat_func�
chmod_funcr�s      r)rr&s�����I�I���c�*��w�s�|������s�0C�
�7�7�d�?�$&�H�H�b�h�h�z�I�
�R��
"�$&�H�H�b�i�i�z�I��
�7�7�d�?�r�w�w�~�~�c�2��'�'�"�"�3�t�"�4�C� %�r�x�x�:�	�	�3��B��s�D�L�L����,�-r(�	listxattrc�,�		tj||��}|D]4}	tj|||��}tj||||���6y#t$rF}|jtjtj
tjfvr�Yd}~yd}~wwxYw#t$rd}|jtjtjtj
tjtjfvr�Yd}~��d}~wwxYw�Nr})rGr�r7r;r=�ENODATAr<�getxattr�setxattr�EPERM�EACCES)rrrsr~�namesr�r8�values       r)�
_copyxattrr�@s���	�	��L�L��o�F�E�
�D�
����C���O�����C��u�o�N���	�	��w�w�u�}�}�e�m�m�U�\�\�J�J����	���
��7�7�5�;�;��
�
�u�}�}�#(�<�<����#?�?��?��
�s/�A�1B&�	B#�<B�B#�&	D�/AD�Dc��yr4r'��args�kwargss  r)r�r�X���r(c���
�	tjd||�ddd�d��
|xs-t|�xrtjj|�}|r�
fd�}n�
fd�}t
|tj�r|j|��}n|d�||��}tj|j�}|d�||j|jf|��t|||��|d	�}tjd
k(rF|rAtjj|�r%tjj|d��}nd
�}	||||��t#|d�r	|d�||j$|��yy#t $rY�5wxYw#t&$rB}dD]2}	t#t(|	�s�|j(t+t(|	�k(s�2n�Yd}~yd}~wwxYw)Nzshutil.copystat)�nsr~c��yr4r')r�r~r�s   r)�_nopzcopystat.<locals>._nopir�r(c�&��tt|��Sr4)�getattrrG)r8r�s �r)�lookupzcopystat.<locals>.lookupps����2�t�T�*�*r(c�R��tt|��}|tjvr|S�Sr4)r�rG�supports_follow_symlinks)r8rwr�s  �r)r�zcopystat.<locals>.lookupus)�����T�4�(�B��R�0�0�0��	��Kr(r}rn�utimer�rTr�c�(�tj|�yr4)rGr�r�s  r)�_chmodzcopystat.<locals>._chmod�s
�����$�r(�st_flags�chflags)�
EOPNOTSUPPr=)rJr�r|rGrmr{rjrkrnr�r��st_atime_ns�st_mtime_nsr�r8r��NotImplementedErrorrlr�r7r;r�)rrrsr~�followr�r��moder��whyrCr�s          @r)rr[s����
��I�I���c�*��T�
��
J�W�S�\�%I�b�g�g�n�n�S�6I� J�F�
�	+�
	��#�r�{�{�#�
�X�X�f�X�
-��
�V�F�^�C��
8���<�<��
�
�#�D��F�7�O�C�R�^�^�R�^�^�<�� ��s�C��0�
�G�_�F�	�w�w�$����w�w�~�~�c�"��g�g�&�&�s�4�&�8��
 �

��s�D�&�1��r�:��	��F�9��c�2�;�;��G����
�	
�
���	�.���5�#�&�3�9�9���s�8K�+K��/����	�s6�F�*F�	F�F�	G!�G�5G�G�G!c��	tjj|�r=tjj|tjj	|��}t|||��t
|||��|Sr�)rGrm�isdir�join�basenamer
r)rrrsr~s   r)r
r
�sY��
�
�w�w�}�}�S���g�g�l�l�3���� 0� 0�� 5�6���S�#��7��S�#��7��Jr(c��	tjj|�r=tjj|tjj	|��}ttd�ritj|�}tj|�}tj}|s|tjz}	t
j|||�|St|||��t!|||��|S#t$rI}|jtjk(r|sn|jtjk(rn�Yd}~�kd}~wwxYw)N�	CopyFile2r})rGrmr�r�r�rl�_winapi�fsdecode�%COPY_FILE_ALLOW_DECRYPTED_DESTINATION�COPY_FILE_COPY_SYMLINKr�r7�winerror�ERROR_PRIVILEGE_NOT_HELD�ERROR_ACCESS_DENIEDr
r)rrrsr~�src_�dst_r@�excs       r)rr�s��	�
�w�w�}�}�S���g�g�l�l�3���� 0� 0�� 5�6���w��$��{�{�3����{�{�3����=�=����W�3�3�3�E�	����d�D�%�0��J�
�S�#��7��S�#��7��J���	����� @� @�@�'������!<�!<�<�����	�s�>C5�5	E�>?E�Ec���	�fd�}|S)Nc�v��g}�D]'}|jtj||���)t|�Sr4)�extend�fnmatch�filter�set)rmr��
ignored_names�pattern�patternss    �r)�_ignore_patternsz)ignore_patterns.<locals>._ignore_patterns�s6����
��G�� � �����w�!?�@� ��=�!�!r(r')r�r�s` r)rr�s���&�"�
�r(c
�X�|�5|tj|�|D�cgc]}|j��c}�}	nd}	tj||��g}
|tuxs|t
u}|D�]|}|j|	vr�tjj||j�}
tjj||j�}|r|n|
}	|j�}|rDtjdk(r1|jd��}|jtjk(rd}|r�tj|
�}|r&tj||�t|||��nztjj|�s|r��&|j!�rt#|||||||�n5|||�n+|j!�rt#|||||||�n	|||���	t||�|
rt%|
��|Scc}w#t$$r)}|
j'|j(d�Yd}~���d}~wt*$r(}|
j-|
|t/|�f�Yd}~���d}~wwxYw#t*$r4}t1|dd��|
j-||t/|�f�Yd}~��d}~wwxYw)Nr')�exist_okrFr}rr�)rG�fspathr8�makedirsrr
rmr�rzrn�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTr�r�rr��is_dirrrr�r�r7�append�strr�)�entriesrrrs�symlinks�ignore�
copy_function�ignore_dangling_symlinks�
dirs_exist_ok�xr��errors�use_srcentry�srcentry�srcname�dstname�srcobjrzr��linktorCr�s                     r)�	_copytreer��sQ��
���r�y�y��~��/H��1�����/H�I�
��
��K�K��m�,�
�F� �E�)�B�]�d�-B�L����=�=�M�)���'�'�,�,�s�H�M�M�2���'�'�,�,�s�H�M�M�2��)��w��&	8�!�,�,�.�J��b�g�g��o�!�
�
�e�
�<���'�'�4�+J�+J�J�!&�J�����W�-����J�J�v�w�/��V�W�(�l�K��7�7�>�>�&�1�6N� ����(� ���(�F�!.�0H�!.�0�&�f�g�6����"����(�F�M�1�=�B��f�g�.��M�Z0���c��
��F�m���J��{0I��b�	'��M�M�#�(�(�1�+�&�&���	8��M�M�7�G�S��X�6�7�7��	8���0��3�
�D�)�1��M�M�3��S��X�.�/���0�sI�H
�B6H�
AH�(I,�	I)�H5�5I)�I$�$I)�,	J)�5*J$�$J)c
���	tjd||�tj|�5}t	|�}ddd�t|||||||��S#1swY�xYw)Nzshutil.copytree)r�rrrsr�r�r�r�r�)rJr�rG�scandir�listr�)	rrrsr�r�r�r�r��itrr�s	         r)rr-s^��%�L�I�I���c�*�	���C��C��s�)��
��W�#�3��"�-�.F�#0�2�2�
��s�A�A�st_file_attributesc��	tj|�}tj|j�xs<|j
tjzxr|jtjk(S#t$rYywxYw)NF)
rGr�rn�S_ISLNKr�r��FILE_ATTRIBUTE_REPARSE_POINTr�r�r7)rmr�s  r)�_rmtree_islinkr�^sr��	����$��B��L�L����,�K��&�&��)J�)J�J�J��&�&�$�*I�*I�I�
L���	��	�s�A1A4�4	B�?Bc�@�tjj|�Sr4)rGrmr{)rms r)r�r�gs���w�w�~�~�d�#�#r(c����fd�}tj|d|tj��}|D]�\}}}|D]8}tjj	||�}	tj
|��:|D]8}tjj	||�}	tj|��:��	tj
|�y#t$r"}	�tj
||	�Yd}	~	��d}	~	wwxYw#t$r"}	�tj||	�Yd}	~	��d}	~	wwxYw#t$r"}	�tj
||	�Yd}	~	yd}	~	wwxYw)Nc�J���tj|j|�yr4)rGr�r9)rC�onexcs �r)�onerrorz_rmtree_unsafe.<locals>.onerrorls���
�b�j�j�#�,�,��,r(F)�topdownr�followlinks)rG�walk�_walk_symlinks_as_filesrmr��rmdirr7�unlink)
rmrr�results�dirpath�dirnames�	filenamesr8�fullnamerCs
 `        r)�_rmtree_unsaferks���-��g�g�d�E�7��Hb�Hb�c�G�(/�$���9��D��w�w�|�|�G�T�2�H�
/�����"���D��w�w�|�|�G�T�2�H�
0��	�	�(�#��)0�#�
�������
/��b�h�h��#�.�.��
/���
0��b�i�i��3�/�/��
0���#�
�b�h�h��c�"�"��#�sH�C
�C8�4D&�
	C5�C0�0C5�8	D#�D�D#�&	E�/E�Ec���|j�\}}}}|�|n|j}	|tjurtj|�y|tjurtj||��y|�tj
||��}n|j
d��}tj}tj|tjtjz|��}tjj}	tjj|tj|��std��|jtj|||f�|jtj|||f�tj }tj |�5}	t#|	�}
ddd�
D]�}tjj%||j�}	|j'd��r$|jtj
|||f��d		tj(|j|����y#|jtj|||f�wxYw#1swY��xYw#t$rY�dwxYw#t$r"}
|tj(||
�Yd}
~
��d}
~
wwxYw#t$r}
||
_||||
�Yd}
~
yd}
~
wwxYw)N)�dir_fdFr}�%Cannot call rmtree on a symbolic link)�popr8rG�closerr�rnr��O_RDONLY�
O_NONBLOCKrmr{rhrHr7r�r�r�r�r�rr9)�stackr�func�dirfdrm�
orig_entryr8�orig_st�topfd�
scandir_itr��entryr
rCs              r)�_rmtree_safe_fdr�s5��%*�I�I�K�!�D�%��z��%�4�:�?�?�D�.��2�8�8���H�H�U�O���2�8�8���H�H�T�%�(��
���h�h�t�E�2�G� �o�o�e�o�<�G��w�w������b�k�k�B�M�M�9�%�H���w�w�~�~��	>��7�7�#�#�G�R�X�X�e�_�=��E�F�F��L�L�"�(�(�E�4��<�=��L�L�"�(�(�E�4��<�=��z�z��
�Z�Z��
�*��:�&�G���E��w�w�|�|�D�%�*�*�5�H�
��<�<��<�6��L�L�"�(�(�E�8�U�!C�D��7�
0��	�	�%�*�*�U�3���
�L�L�"�(�(�E�4��<�=���
���
��
���
0��b�i�i��3�/�/��
0�������
�d�D�#�����s��'K�)K�9B
K�A!I�(AK�0I8�<7K�45J�)K�,!J�
K�%I5�5K�8J�=K�	J�
K�J�K�	J>�J9�4K�9J>�>K�	K%�
K � K%)rrc���	tjd||�|rd�}n��|�d�}n
|���d�}n�fd�}tr�t|t�rtj|�}t
j||dfg}	|rt||�|r�|rB|j�\}}}}|t
jur�*	tj|�|r�Ayy|�td��	t|�rtd��	t!||�S#t$r"}	|t
j||	�Yd}	~	�\d}	~	wwxYw#|rq|j�\}}}}|t
jur�*	tj|�n.#t$r"}	|t
j||	�Yd}	~	nd}	~	wwxYw|r�pwwxYw#t$r,}	|t
jj||	�Yd}	~	yd}	~	wwxYw)Nz
shutil.rmtreec��yr4r'�r�s r)rzrmtree.<locals>.onexc�s��r(c���r4r'r!s r)rzrmtree.<locals>.onexc�s��r(c���r4r'r!s r)rzrmtree.<locals>.onexc�s��r(c�^��|\}}}|�d}nt|�||jf}�|||�S)N)NNN)�type�
__traceback__)r�rrmr��exc_infors     �r)rzrmtree.<locals>.onexc�s=���"&���d�C��;�/�H�#�C�y�#�s�/@�/@�@�H��t�T�8�4�4r(z#dir_fd unavailable on this platformr)rJr��_use_fd_functionsrj�bytesrGr�r�rrrr7r�r�rmr{r)
rm�
ignore_errorsrrrrr�fdrrCs
  `       r)rr�s�����(�I�I�o�t�V�,��	�	��U�]�	�	���?�
�
5���d�E�"��;�;�t�$�D��(�(�F�D�$�/�0��	/����u�-���(-�	�	��%��b�$���r�x�x�'��/��H�H�R�L����%�&K�L�L�	��d�#��E�F�F�$��d�E�*�*���/��"�(�(�D�#�.�.��/��
�(-�	�	��%��b�$���r�x�x�'��/��H�H�R�L���/��"�(�(�D�#�.�.��/��
���	��"�'�'�.�.�$��,���	�sl�6D+�2C=�F#�=	D(�D#�#D(�++F �E-�,F �-	F�6F�F �F�F �F �#	G�,"G�Gc��	tj|�}tjjtjjxsdz}tjj|j
|��S�N�)rGr�rm�sep�altsepr��rstrip)rmr/s  r)�	_basenamer2sS����9�9�T�?�D�
�'�'�+�+������-�2�
.�C�
�7�7���D�K�K��,�-�-r(c�~�	tjd||�|}tjj	|�r�t||�r6tjj
|�stj||�ytjj|t|��}tjj|�rtd|z��	tj||�|S#t$�rGtjj
|�rCtj|�}tj||�tj|�Y|Stjj	|�r�t!||�rtd|�d|�d���t#|�sLtj$|tj&�s:tj(|�r%tj*dk(rt-d|�d|�d���t/|||d	�
�t1|�Y|S|||�tj|�Y|SwxYw)Nzshutil.movez$Destination path '%s' already existszCannot move a directory 'z' into itself 'z'.�darwinz%Cannot move the non-empty directory 'z ': Lacking write permission to 'T)r�r�)rJr�rGrmr�rtr{�renamer�r2r�rr7r�r�r�
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)rrrsr��real_dstr�s     r)rr%s����2�I�I�m�S�#�&��H�	�w�w�}�}�S���S�#��r�w�w�~�~�c�':�
�I�I�c�3����7�7�<�<��Y�s�^�4��
�7�7�>�>�(�#��>��I�J�J��
�	�	�#�x� �,�O��+��
�7�7�>�>�#���[�[��%�F��J�J�v�x�(��I�I�c�N�"�O�!�W�W�]�]�3�
��#�s�#��(+�S�2�3�3��c�"��I�I�c�2�7�7�3��
�
�3���L�L�H�4�%�),�c�'3�4�4�
�S�(�-�"�
$��3�K��O�
�#�x�(��I�I�c�N��O�+�s �C+�+A)H<�CH<�H<�;H<c��tjj|�}tjj|�}|jtjj�s|tjjz
}|jtjj�s|tjjz
}|j|�Sr4)rGrmrp�endswithr/�
startswithrqs  r)r6r6gs���
�'�'�/�/�#�
�C�
�'�'�/�/�#�
�C��<�<������$��r�w�w�{�{����<�<������$��r�w�w�{�{����>�>�#��r(c��t|�}tjtjg}t	|d�xr|j
|vS)Nr�)rxrn�UF_IMMUTABLE�SF_IMMUTABLErlr�)rrr��immutable_statess   r)r7r7ps>��	�s��B��)�)�4�+<�+<�=���2�z�"�F�r�{�{�6F�'F�Fr(c�z�	|�y	ddlm}	||�}|�|dSy#t$rYywxYw#t$rd}Y�$wxYw)Nr)�getgrnam�)�grprF�ImportError�KeyError)r8rF�results   r)�_get_gidrLu�a��,��|��� ���$������a�y���������
��������,�	)�)�:�:c�z�	|�y	ddlm}	||�}|�|dSy#t$rYywxYw#t$rd}Y�$wxYw)Nr)�getpwnamrG)�pwdrPrIrJ)r8rPrKs   r)�_get_uidrR�rMrNc	�0�����	|�d}	nDtr|dk(rd}	n6tr|dk(rd}	n(tr|dk(rd}	ntdj	|���ddl}
|rd	|	znd}|d
z|z}tjj|�}
|
rJtjj|
�s+|�|jd|
�|st
j|
�|�|jd�t���t�������fd
�}|s^|
j|d|	z�}|}|� tjj||�}	|j!|||��|j#�|�tjj%|�}|S#|j#�wxYw)Nr.�gzip�gz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivec�H�����|_�|_���|_�|_|Sr4)�gid�gname�uid�uname)�tarinfor]�group�ownerr_s ����r)�_set_uid_gidz#_make_tarball.<locals>._set_uid_gid�s.����?��G�K�!�G�M��?��G�K�!�G�M��r(zw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorr��tarfilerGrm�dirnamer��infor�rRrLr�r��addrrp)�	base_name�base_dir�compress�verbose�dry_runrcrb�logger�root_dir�tar_compressionrj�compress_ext�archive_name�archive_dirrd�tar�arcnamer]r_s     ``          @@r)�
_make_tarballr{�sw���
�����	�X��/���	�H��/���	�X��-����+�+1�6�(�+;�=�	=��,4�3��(�"�L��v�%��4�L��'�'�/�/�,�/�K��2�7�7�>�>�+�6����K�K�
�{�3���K�K��$������*�+�
�5�/�C�
�5�/�C����l�l�<��/�)A�B�������w�w�|�|�H�h�7�H�	��G�G�H�g�l�G�;��I�I�K����w�w���|�4�����	
�I�I�K�s�<F�Fc�
�	ddl}|dz}	tjj|�}
|
rJtjj	|
�s+|�|jd|
�|stj|
�|�|jd|	|�|�sH|j|	d|j��5}tjj|�}|� tjj||�}tjj|�}|tjk7r&|j||�|�|jd|�tj|�D�]n\}
}}|
}|� tjj||�}tjj|�}t|�D]i}tjj|
|�}tjj||�}|j||�|��X|jd|��k|D]�}tjj|
|�}tjj|�}tjj!|�s�btjj||�}|j||�|���|jd|�����q	ddd�|�tjj#|	�}	|	S#1swY�,xYw)Nr�.zipr[z#creating '%s' and adding '%s' to it�w)�compressionzadding '%s')�zipfilerGrmrkr�rlr��ZipFile�ZIP_DEFLATED�normpathr��curdirrXr�relpath�sorted�isfilerp)rnrorqrrrsrcrbrtr��zip_filenamerx�zfrzr
rr�
arcdirpathr8rms                   r)�
_make_zipfiler��s_���
��v�%�L��'�'�/�/�)�,�K��2�7�7�>�>�+�6����K�K�
�{�3���K�K��$�
�����9� �(�	,��
�_�_�\�3�)0�)=�)=��?�BD��g�g�&�&�x�0�G��#��7�7�<�<��(�;���w�w�'�'��1�H��"�)�)�#�����7�+��%��K�K�
�x�8�02����0A�,���9�$�
��'�!#������X�!F�J��W�W�-�-�j�9�
�"�8�,�D��7�7�<�<���6�D� �g�g�l�l�:�t�<�G��H�H�T�7�+��)����M�4�8�-�&�D��7�7�<�<���6�D��7�7�+�+�D�1�D��w�w�~�~�d�+�"$�'�'�,�,�z�4�"@������w�/�!�-�"�K�K�
�t�<�&�1B�?�<���w�w���|�4����A?�?�s �,EK9�	A7K9�4K9�6K9�9Lry)rpNzuncompressed tar file)rprTzgzip'ed tar-file�gztarzZIP file�zip)rprVzbzip2'ed tar-file�bztar)rprXzxz'ed tar-file�xztarc��	tj�D��cgc]\}}||df��}}}|j�|Scc}}w)NrG)�_ARCHIVE_FORMATS�items�sort)r8�registry�formatss   r)rr1sR���
 �%�%�'�)�'�(6�t�X��h�q�k�"�'��)��L�L�N��N��)s�?c��	|�g}t|�std|z��t|ttf�std��|D]1}t|ttf�rt|�dk7s�(td��|||ft|<y)NzThe %s object is not callablez!extra_args needs to be a sequencerGz+extra_args elements are : (arg_name, value))�callable�	TypeErrorrj�tupler��lenr�)r8�function�
extra_args�description�elements     r)rr;s�������
��H���7�(�B�C�C��j�5�$�-�0��;�<�<����'�E�4�=�1�S��\�A�5E��I�J�J��'�
�K�@��T�r(c��t|=yr4)r��r8s r)rrPs
����r(c	�j�	tjd||||�	t|}	||||d�}
|	d}|	dD]
\}}
|
|
|<�|�t
j}t|dd�}d}|��tj|�j}tj|�sttjd|��|rtj|�}||
d	<n^tj�}|�|j!d
|�t
j"j%|�}|stj&|�	|||fi|
��}|�)|�|j!d|�tj&|�|S#t$rt	d|z�d�wxYw#|�*|�|j!d|�tj&|�wwxYw)Nzshutil.make_archivezunknown archive format '%s')rrrsrcrbr��supports_root_dirFzNot a directoryrtzchanging into '%s'zchanging back to '%s')rJr�r�rJrirGr�r�rnr��S_ISDIR�NotADirectoryErrorr;�ENOTDIRr��getcwd�debugrmrp�chdir)rnr�rtrorqrrrcrbrs�format_infor�r�arg�valr��save_cwd�stmdr9s                  r)rrSs���� �I�I�#�Y���(�K�K�&�v�.��!�F��u�.�F��q�>�D���N���S���s��#����9�9����&9�5�A���H����w�w�x� �(�(���|�|�D�!�$�U�]�]�4E�x�P�P���	�	�)�,�I�!)�F�:���y�y�{�H��!����1�8�<������	�2�I������"���	�8�6�v�6�����!����4�h�?��H�H�X���O��Q�K��6��?�@�d�J�K��F���!����4�h�?��H�H�X�� �s�	E(�1
F�(F�.F2c��	tj�D��cgc]\}}||d|df��}}}|j�|Scc}}w)Nr�)�_UNPACK_FORMATSr�r�)r8rlr�s   r)rr�sX����$�$�&�(�&�-7�D�$��d�1�g�t�A�w�'�&��(��L�L�N��N��(s�Ac���	i}tj�D]\}}|dD]}|||<�	�|D]}||vs�d}t||||fz��t|�st	d��y)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r�r�r0r�r�)	�
extensionsr�r��existing_extensionsr8rl�ext�	extension�msgs	         r)�_check_unpack_optionsr��s���5���%�+�+�-�
��d���7�C�'+���$��.� �	��+�+�5�C���y�':�9�'E�'G�!G�H�
H� ��H���D�E�E�r(c�B�	|�g}t|||�||||ft|<yr4)r�r�)r8r�r�r�r�s     r)rr�s3������
��*�h�
�;�&��*�k�I�O�D�r(c��	t|=yr4)r�r�s r)rr�s
��4���r(c��	tjj|�}tjj|�stj|�yyr4)rGrmrkr�r�)rmrks  r)�_ensure_directoryr��s8��;��g�g�o�o�d�#�G�
�7�7�=�=��!�
���G��"r(c�p�	ddl}|j|�std|z��|j|�}	|j	�D]�}|j
}|j
d�sd|vr�%tjj|g|jd����}|s�Wt|�|jd�r�t|j|d�5}t|d�5}t||�ddd�ddd���	|j�y#1swY�%xYw#1swY��xYw#|j�wxYw)Nrz%s is not a zip file�/z..�rr�)r��
is_zipfiler.r��infolistr9r@rGrmr��splitr�r?r�r	r)	r9�extract_dirr�r�rlr8�
targetpath�source�targets	         r)�_unpack_zipfiler��s�������h�'��.��9�:�:�
�/�/�(�
#�C���L�L�N�D��=�=�D����s�#�t�t�|�������k�D�D�J�J�s�O�D�J����j�)��=�=��%��X�X�d�C�(�F��Z��.�&����/�/�)�(�#�$	�	�	��/�.��)�(��	�	�	��sB�BD#�;D#�

D�
D�'D�/
D#�D�D�D 	�D#�#D5rec���	ddl}	|j|�}	|j	||��|j�y#|j$rtd|z��wxYw#|j�wxYw)Nrz/%s is not a compressed or uncompressed tar filere)rjr��TarErrorr.�
extractallr)r9r�r�rj�tarobjs     r)�_unpack_tarfiler��s{����J����h�'������+�f��5������
���J��=��H�J�	J�J��	����s�=�A�A�A0rZr})ryr�z.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzc�~�tj�D]&\}}|dD]}|j|�s�|ccS�(y)Nr)r�r�r?)r9r8rlr�s    r)�_find_unpack_formatr�s?��%�+�+�-�
��d��a��I�� � ��+���!�.�r(c��	tjd|||�|�tj�}tj|�}tj|�}|�i}nd|i}|�(	t
|}|d}|||fit|d��|��yt|�}|�tdj|���t
|d}tt
|d�|z}|||fi|��y#t$rtdj|��d�wxYw)Nzshutil.unpack_archiver�zUnknown unpack format '{0}'r�rGzUnknown archive format '{0}')rJr�rGr�r�r�rJrir��dictr�r.)r9r�r�r��
filter_kwargsr�rr�s        r)rrs'���"�I�I�%�x��f�E����i�i�k���)�)�K�(�K��y�y��"�H�
�~��
�!�6�*�
�
��	U�)�&�1�K��1�~���X�{�L�d�;�q�>�&:�L�m�L�%�X�.���>��:�A�A�(�K�L�L��v�&�q�)���o�f�-�a�0�1�M�A���X�{�-�f�-���	U��:�A�A�&�I�J�PT�T�	U�s�&	C#�#%D�statvfs�
disk_usage�usageztotal used freezTotal space in byteszUsed space in byteszFree space in bytesc��	tj|�}|j|jz}|j|jz}|j|j
z
|jz}t
|||�Sr4)rGr��f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rmr��free�total�useds     r)r�r�Rse��	�
�Z�Z��
���{�{�R�[�[�(�����b�k�k�)�����b�j�j�(�B�K�K�7�� ���d�3�3r(c�X�	tj|�\}}||z
}t|||�Sr4)r�
_getdiskusager�)rmr�r�r�s    r)r�r�cs5��	�
�&�&�t�,���t��t�|�� ���d�3�3r(c�z�	tjd|||�|�
|�td��|}|}|�d}n7t|t�r't|�}|�t
dj|���|�d}n7t|t�s't|�}|�t
dj|���tj|||�y)Nzshutil.chownzuser and/or group must be set���zno such user: {!r}zno such group: {!r})rJr�rirjr�rR�LookupErrorr��intrLrGr)rm�userrb�_user�_groups     r)rrns����
�I�I�n�d�D�%�0��|��
��8�9�9��E�
�F��|���	�D�#�	������=��2�9�9�$�?�@�@��}���
��s�
#��%����>��3�:�:�5�A�B�B��H�H�T�5�&�!r(c�8�		ttjd�}	ttjd�}|dks|dkrb	tj
tjj��}|dkr|jxs|d}|dkr|jxs|d}tj||f�S#ttf$rd}Y��wxYw#ttf$rd}Y��wxYw#tttf$rtj|�}Y��wxYw)N�COLUMNSr�LINESr�)r�rG�environrJrir rJ�
__stdout__r5�AttributeErrorr7�
terminal_size�columns�lines)�fallbackr�r��sizes    r)r r �s���&��b�j�j��+�,����B�J�J�w�'�(��
�!�|�u��z�	.��'�'����(=�(=�(?�@�D�
�a�<��l�l�1�h�q�k�G��A�:��J�J�-�(�1�+�E�
���W�e�,�-�-��+
�j�!������

�j�!�������
�G�4�	.��#�#�H�-�D�	.�s4�B?�C�1C-�?C�C�C*�)C*�-)D�Dc��tjj|�xr8tj||�xr tjj	|�Sr4)rGrmr�r8r�)rwr�s  r)�
_access_checkr��sA���G�G�N�N�2��
&�2�9�9�R��#6�
&��G�G�M�M�"�%�%�'r(c��	|tjzxs(tjtj|��Sr4)rG�X_OKr��NeedCurrentDirectoryForExePathr�)�cmdr�s  r)�_win_path_needs_curdirr��s:���
����� �"�W�%K�%K����C� �&"�"r(c�:��	t|t�}tjj	|�\}}|r|g}�n|�8tj
j
dd�}|�	tjd�}|sy|rHtj|�}|j	tjtj��}n4tj|�}|j	tj�}tjdk(rEt!||�r9tj"}|rtj|�}|j%d|�tjdk(�rtj&d�xst(}|j	tj�D�cgc]}|s�|��	}}|r"|D�cgc]}tj|���}}|g|D�cgc]}||z��	c}z}	tjj+|	d�dj-��|tj.zr8t1�fd�|D��s$|	j3|	j5d��n|g}	t7�}
|D]p}tjj9|�}||
vs�'|
j;|�|	D]4}
tjj=||
�}t?||�s�0|ccS�ry#ttf$rtj}Y���wxYwcc}wcc}wcc}w)N�PATH�CS_PATHrr�PATHEXTr�c3�D�K�|]}�|j�k(���y�wr4)�upper)�.0r��suffixs  �r)�	<genexpr>zwhich.<locals>.<genexpr>s�����%O�w��f��	�	��&;�w�s� ) rjr)rGrmr�r��get�confstrr�ri�defpath�fsencode�pathsepr�rJr;r�r��insert�getenv�_WIN_DEFAULT_PATHEXT�splitextr�r��anyr�rr�rormr�r�)r�r�rm�	use_bytesrkr��pathext_sourcer��pathext�files�seen�dir�normdir�thefiler8rs               @r)rr�su�����3��&�I�
�7�7�=�=��%�L�G�S���y���<��:�:�>�>�&�$�/�D��|�&��:�:�i�0�D�����;�;�t�$�D��:�:�b�k�k�"�*�*�5�6�D��;�;�t�$�D��:�:�b�j�j�)�D��<�<�7�"�'=�c�4�'H��Y�Y�F�����V�,���K�K��6�"�
�|�|�w�����9�-�E�1E��"0�"6�"6�r�z�z�"B�J�"B�3�c�3�"B��J��3:�;�7�C�r�{�{�3�'�7�G�;���w�7�w��#��)�w�7�7�����!�!�%��(�+�A�.�4�4�6���"�'�'�>�#�%O�w�%O�"O��L�L����1��&�����5�D����'�'�"�"�3�'���$���H�H�W�� ���w�w�|�|�C��1�� ��t�,��K�!�	���q'�
�3�&��:�:�D�&��6K��<��7s*�!K(�!L�)L�5L�L�(L�
L)r)F)FN)rTrrNNNN)rrNNNNr-)NNrrNNN)NN))�P�)irGrJrnr��collectionsr;�warnings�zlibrfrIrWrg�lzmarhr8r�rrr;r�rcrlr@rNr�r	�__all__r7rr!rrr.r6r0r2rDrUrar	rtrxr|r
rr�rr
rrr�r�stat_resultr�rrr�rr�supports_dir_fdr��supports_fdr�r(r�avoids_symlink_attacksr2rr6r7rLrRr{r�r�r�rrrrrr�rrr�r�r�r�r�rr��
namedtupler�r��__doc__r�r�r�rr r�r��F_OKr�rr'r(r)�<module>r"s;���
�
����������O�����N�����O��7�7�d�?��
�����7�7�g���
�
��<�<�7����G�&�{�I���2�z�*�O�s�|�|�/F�/F�w�/O���7�7�5�,�7��?����	�G�	�@�E�@�;�w�;�6��6�0��0�&�I�&��	��
 �(>�@.:��(�4�$E�R�+/�>�@+/�.�2�2�{��04��0
�+/�H�T'+��$(,�&�P
�7<�@�D!&�d�%�&+�5�.2�`�2�>�>�/�0��$�#�.=�~�g�g�r�w�w��	�	�2�8�8�<��'�'�(�<��Z�Z�2�>�>�1�<��W�W�� ;� ;�;��
G+�T�$�G+�V!2���.�$"'�@�D�G�
�$�$LM�@D�D�L;<�@D�7�r#'�
��"&�
��
�m�0�1�%�'���
�!.�1E�0F� 2�!4��W��,�b�*�=��U���!.�1F�0G� 3�!5��W���!.�1C�0D� 0�!2��W���A�*�KL�;?�=�@	�F�$CG�')�J�,���<6:��(�h���-D�
E��h���Z�
8���
�!*�F� 3�_�b� 2� 4�O�G���!+�W� 5��� 3� 5�O�G���!*�F� 3�_�b� 0� 2�O�G���..�d�..�b�2�y���N�N�<� �.��.�.�w�8I�J��&<����#�%:����"�%:����"�
4���N�N�<� �.��.�.�w�8I�J��4�"�@+.�b'�
"��G�G�b�g�g�%�D�P��w-���O������N������O��s3�N�N�N�N�
N�N�N�N'�&N'

?>