AlkantarClanX12

Your IP : 18.189.143.1


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/shutil.cpython-39.opt-2.pyc

a

R�f&��@shddlZddlZddlZddlZddlZddlZzddlZ[dZWneyXdZYn0zddl	Z	[	dZ
Wney�dZ
Yn0zddlZ[dZWney�dZYn0zddl
mZWney�dZYn0zddlmZWney�dZYn0ejdkZdZZejdk�r&ddlZne�r4ddlZe�r>dnd	Zeed
��oXej�d�ae�oheed�Zd
Zgd�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de#�Z$Gdd�de#�Z%dd�Z&dd �Z'efd!d"�Z(d�d#d$�Z)d%d&�Z*d'd(�Z+d)d*�Z,dd+�d,d-�Z-dd+�d.d/�Z.eed0��r\dd+�d1d2�Z/nd3d2�Z/dd+�d4d5�Z0dd+�d6d7�Z1dd+�d8d9�Z2d:d;�Z3d�d<d=�Z4dde2ddfd>d?�Z5eej6d@��r�dAdB�Z7dCdD�Z8ndEdB�Z7dFdD�Z8dGdH�Z9dIdJ�Z:ej;ejej<ej=hej>k�o(ej?ej@v�o(ejejAvZBd�dKdL�ZCeBeC_DdMdN�ZEe2fdOdP�ZFdQdR�ZGdSdT�ZHdUdV�ZIdWdX�ZJd�dZd[�ZKd�d\d]�ZLd^eKd_gd`fiZMe�r�eKdagdbfeMdc<eLgddfeMde<e
�r�eKdfgdgfeMdh<e�r�eKdigdjfeMdk<dldm�ZNd�dodp�ZOdqdr�ZPd�dsdt�ZQdudv�ZRdwdx�ZSd�dydz�ZTd{d|�ZUd}d~�ZVdd��ZWdd��d�d��ZXd�geXgd`fd�geWgddfd��ZYe�r~d�d�geXgdbfeYdc<e
�r�d�d�geXgdgfeYdh<e�r�d�d�geXgdjfeYdk<d�d��ZZd�dd��d�d��Z[eed���re�\d��e�]d�d��Z^d�e^j__`d�e^ja_`d�e^jb_`d�d��Zcn$e�r2e�\d��e�]d�d��Z^d�d��Zcd�d�d��Zdd�d�d��Zed�d��ZfejgejhBdfd�d��ZidS)��NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_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@seZdZdS)rN��__name__�
__module__�__qualname__�r%r%�+/opt/alt/python39/lib64/python3.9/shutil.pyrEsrc@seZdZdS)r Nr!r%r%r%r&r Hsr c@seZdZdS)rNr!r%r%r%r&rKsrc@seZdZdS)rNr!r%r%r%r&rOsrc@seZdZdS)�	ReadErrorNr!r%r%r%r&r'Rsr'c@seZdZdS)�
RegistryErrorNr!r%r%r%r&r(Usr(c@seZdZdS)�_GiveupOnFastCopyNr!r%r%r%r&r)Ysr)c
Cs�z|��}|��}Wn,ty@}zt|��WYd}~n
d}~00zt�|||�WnVty�}z>|j|_|j|_|j	t	j
t	jhvr�t|��n|d�WYd}~n
d}~00dS�N)�fileno�	Exceptionr)rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr%r%r&�_fastcopy_fcopyfile^s
r:c
CsFz|��}|��}Wn,ty@}zt|��WYd}~n
d}~00ztt�|�jd�}Wntynd}Yn0tj	dkr�t
|d�}d}zt�||||�}Wn�t�y(}zr|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�WYd}~q�d}~00|dk�r8�qB||7}q�dS)Ni�ili@rF)r+r,r)�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr%r%r&�_fastcopy_sendfilers8


 
rFc	Cs�|j}|j}tt|���j}||�}|s*qtq||krj|d|��}|�|�Wd�qr1s^0Yq||�qWd�n1s�0YdSr*)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr%r%r&�_copyfileobj_readinto�s*rNcCs0|st}|j}|j}||�}|s"q,||�qdSr*)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr%r%r&r�srcCs�t|tj�rHttjd�rHztj�|��t�|��WStyFYdS0ttjd�rzztj�||�WStyxYdS0tj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr%r%r&�	_samefile�s�r]cCst|tj�r|��St�|�Sr*)rSr<rTrW��fnr%r%r&�_stat�sr`cCs t|tj�r|��Stj�|�Sr*)rSr<rT�
is_symlinkrV�islinkr^r%r%r&�_islink�src��follow_symlinksc
Cs^t�d||�t||�r(td�||���d}t||g�D]h\}}zt|�}Wnty^Yq80t�	|j
�r�t|tj
�r~|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n�t|d���x}�zt|d����}t�r4z2t||tj�|WWd�WWd�St�y0Yn0n�t�r�z.t||�|WWd�WWd�St�y|Yn0nDt�r�|dk�r�t||t|t��|Wd�WWd�St ||�Wd�n1�s�0YWnHt!�y8}	z.tj�"|��s"t#d|���|	�n�WYd}	~	n
d}	~	00Wd�n1�sP0Y|S)Nzshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wbzDirectory does not exist: )$r?�auditr]r �format�	enumerater`r-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rc�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr)rBrFrNrArOr�IsADirectoryError�exists�FileNotFoundError)
r[r\re�	file_size�ir_�str4r5�er%r%r&r	�sP
$
$".8r	cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)Nzshutil.copymode�lchmod)r?rhrcr<rVrbrU�lstatryr`�chmodrW�S_IMODErl)r[r\reZ	stat_funcZ
chmod_funcrwr%r%r&r
*s
r
�	listxattrcCs�ztj||d�}Wn>tyP}z&|jtjtjtjfvr:�WYd}~dSd}~00|D]l}z&tj|||d�}tj||||d�WqVty�}z(|jtj	tjtjtjfvr��WYd}~qVd}~00qVdS�Nrd)
r<r}r-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\re�namesrxr.�valuer%r%r&�
_copyxattr@s	�r�cOsdSr*r%)�args�kwargsr%r%r&r�Xsc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d�}n|d	�||d�}t�	|j
�}|d
�||j|jf|d�t
|||d�z|d�|||d�Wnty�Yn0t|d��r\z|d
�||j|d�WnXt�yZ}z>dD]*}tt|��r|jtt|�k�r�qF�q�WYd}~n
d}~00dS)Nzshutil.copystat)�nsrecWsdSr*r%)r�rer�r%r%r&�_nopiszcopystat.<locals>._nopcstt|��Sr*)�getattrr<�r.�r�r%r&�lookuppszcopystat.<locals>.lookupcstt|��}|tjvr|S�Sr*)r�r<�supports_follow_symlinks)r.r_r�r%r&r�us
rdrW�utimer{�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rhrcr<rVrbrSrTrWr|rl�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\reZfollowr�rw�mode�whyr9r%r�r&r[s4�
rcCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Sr~)r<rV�isdir�join�basenamer	r
�r[r\rer%r%r&r�s
rcCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Sr~)r<rVr�r�r�r	rr�r%r%r&r
�s
r
cs�fdd�}|S)Ncs(g}�D]}|�t�||��qt|�Sr*)�extend�fnmatch�filter�set)rVr��
ignored_names�pattern��patternsr%r&�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr%)r�r�r%r�r&r�srcCsD|dur$|t�|�dd�|D��}nt�}tj||d�g}	|tupJ|tu}
|D�]�}|j|vrbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPt�y�}z|	�|jd�WYd}~qPd}~0t�y�}z |	�||
t|�f�WYd}~qPd}~00qPzt||�WnLt�y0}z2t|d	d�du�r|	�||t|�f�WYd}~n
d}~00|	�r@t|	��|S)
NcSsg|]
}|j�qSr%r�)�.0�xr%r%r&�
<listcomp>��z_copytree.<locals>.<listcomp>)�exist_okrFrd)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rarW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrornrrs�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrarz�linktor9r�r%r%r&�	_copytree�s^




�
�$,*r�c	
CsXt�d||�t�|��}t|�}Wd�n1s60Yt||||||||d�S)Nzshutil.copytree)r�r[r\r�r�r�r�r�)r?rhr<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r%r%r&r
s(&
�r�st_file_attributescCsNz4|jdd�}t�|j�o2|jtj@o0|jtjkWStyHYdS0dS�NFrd)rW�S_ISDIRrlr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrwr%r%r&�
_rmtree_isdirAs
�r�cCsJz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	yDYdS0dS)NF)
r<rzrW�S_ISLNKrlr�r�r�r�r-)rVrwr%r%r&�_rmtree_islinkJs

�r�cCs(z|jdd�WSty"YdS0dSr�)r�r-)r�r%r%r&r�SscCstj�|�Sr*)r<rVrb)rVr%r%r&r�Ysc	Cs2z6t�|��}t|�}Wd�n1s*0YWn(ty^|tj|t���g}Yn0|D]�}|j}t|�r�z|��r�td��Wn*ty�|tjj	|t���YqdYn0t
||�qdzt�|�Wqdty�|tj|t���Yqd0qdzt�|�Wn&t�y,|tj|t���Yn0dS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rarb�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer%r%r&r�]s0*

r�c
Cs`z6t�|��}t|�}Wd�n1s*0YWn>tyt}z&||_|tj|t���WYd}~dSd}~00|D�]�}tj�||j	�}z|j
dd�}Wnty�d}YnP0|�rz|jdd�}	t�|	j
�}Wn*t�y|tj|t���YqzYn0|�rztj|j	tj|d�}
d}Wn&t�yN|tj|t���Yn�0z�tj�|	t�|
���r�t|
||�z"t�|
�d}tj|j	|d�Wn&t�y�|tj|t���Yn0n6ztd��Wn(t�y�|tjj|t���Yn0W|�st�|
�n|�st�|
�0qzztj|j	|d�Wqzt�yX|tj|t���Yqz0qzdS)NFrd)�dir_fdTr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rlrzrp�O_RDONLYrQr=�_rmtree_safe_fd�closer�rbr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdZdirfd_closedr%r%r&r�|s^*



�r�c	Cs�t�d|�|rdd�}n|dur*dd�}t�r�t|t�rDt�|�}zt�|�}Wn&tyx|tj|t�	��YdS0zt�
|tj�}d}Wn&ty�|tj
|t�	��YdS0z�tj�
|t�|���r"t|||�zt�|�d}t�|�Wn&t�y|tj|t�	��Yn0n6ztd��Wn(t�yV|tjj|t�	��Yn0W|�s~t�|�n|�s|t�|�0nLzt|��r�td��Wn*t�y�|tjj|t�	��YdS0t||�SdS)Nz
shutil.rmtreecWsdSr*r%�r�r%r%r&r��szrmtree.<locals>.onerrorcWs�dSr*r%r�r%r%r&r��sFTr�)r?rh�_use_fd_functionsrS�bytesr<�fsdecoderzr,r�rpr�rVrQr=r�r�r�r-rbr�r�)rV�
ignore_errorsr�r��fdZ	fd_closedr%r%r&r�sV



�
rcCs0t�|�}tjjtjjpd}tj�|�|��S)N�)r<r�rV�sep�altsepr��rstrip)rVr�r%r%r&�	_basename�s
r�c	CsRt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�t�yLtj�|�r�t�
|�}t�||�t�|�n�tj�|��r4t||�r�t
d||f��t|��s
t�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�Yn0|S)Nzshutil.movez$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rhr<rVr�r]�renamer�r�rsrr-rbrornr��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r%r%r&rsL


�
�����

rcCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr*)r<rVrY�endswithr��
startswithrZr%r%r&r�Qsr�cCs(t|�}tjtjg}t|d�o&|j|vS)Nr�)r`rW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[rwZimmutable_statesr%r%r&r�Zsr�cCsLtdus|durdSzt|�}Wnty6d}Yn0|durH|dSdS�N�)r�KeyError�r.�resultr%r%r&�_get_gid_s
r�cCsLtdus|durdSzt|�}Wnty6d}Yn0|durH|dSdSr�)rr�r�r%r%r&�_get_uidks
r��gzipcs(|durd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���ddl}	|rfd	|nd}
|d
|
}tj�|�}|r�tj�	|�s�|dur�|�
d|�|s�t�|�|dur�|�
d�t���t
�������fd
d�}
|�s$|	�|d|�}z|j||
d�W|��n
|��0|S)Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dur�|_�|_�dur(�|_�|_|Sr*)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r%r&�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorri�tarfiler<rV�dirnamers�infor�r�r�rp�addr�)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionrZcompress_extZarchive_name�archive_dirr��tarr%r�r&�
_make_tarballws>�

	r
c	Cs�ddl}|d}tj�|�}|rNtj�|�sN|dur@|�d|�|sNt�|�|durd|�d||�|�s�|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dur�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dur�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|du�r|�d|	��qq�Wd�n1�sv0Y|S)Nr�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVrrsrr��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrr	r
rZzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r%r%r&�
_make_zipfile�sF
��

2rr)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)NcSsg|]\}}||df�qS)r�r%)r�r.�registryr%r%r&r��r�z'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr%r%r&r�s
�rr�cCst|durg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr%r%r&r�s	
rcCs
t|=dSr*)rr�r%r%r&rsrc	
CsBt�d||||�t��}	|durP|dur6|�d|�tj�|�}|sPt�|�|dur^tj}||d�}
zt	|}Wn t
y�td|�d�Yn0|d}|dD]\}
}||
|
<q�|dkr�||
d<||
d	<z@|||fi|
��}W|du�r>|du�r|�d
|	�t�|	�n,|du�r<|du�r2|�d
|	�t�|	�0|S)Nzshutil.make_archivezchanging into '%s')r	r
zunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rhr<�getcwd�debugrVrY�chdirrrr�r)rriZroot_dirrrr	r�r�r
Zsave_cwdr��format_info�func�arg�valr/r%r%r&rs@




�

rcCsdd�t��D�}|��|S)NcSs"g|]\}}||d|df�qS)r�r%)r�r.rr%r%r&r�Ur�z&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr%r%r&rOs
�rc	Csji}t��D]\}}|dD]}|||<qq|D]$}||vr0d}t||||f��q0t|�sftd��dS)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r0rr(r r!)	�
extensionsr$r%Zexisting_extensionsr.r�ext�	extension�msgr%r%r&�_check_unpack_optionsZs�
r5cCs,|durg}t|||�||||ft|<dSr*)r5r0)r.r1r$r%r&r%r%r&rlsrcCs
t|=dSr*)r0r�r%r%r&r�srcCs&tj�|�}tj�|�s"t�|�dSr*)r<rVrr�r�)rVrr%r%r&�_ensure_directory�sr6c	
Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|vrPq2tjj	|g|�
d��R�}|spq2t|�|�d�s2|�
|d��D}t
|d��}t||�Wd�n1s�0YWd�q21s�0Yq2W|��n
|��0dS)Nrz%s is not a zip file�/z..�rrg)rZ
is_zipfiler'rZinfolistr/r�r<rVr��splitr6r�rprr�)	r/�extract_dirrrrr.Z
targetpath�source�targetr%r%r&�_unpack_zipfile�s(


�Jr=r�cCsbddl}z|�|�}Wn |jy6td|��Yn0z|j||d�W|��n
|��0dS)Nrz/%s is not a compressed or uncompressed tar filer�)rrpZTarErrorr'Z
extractallr�)r/r:r�rZtarobjr%r%r&�_unpack_tarfile�s�
r>r�r)rrz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r0rr�)r/r.rr3r%r%r&�_find_unpack_format�s

r?cCs�t�d|||�|dur t��}t�|�}t�|�}|durBi}nd|i}|dur�zt|}Wn"ty�td�|��d�Yn0|d}|||fit	|d��|��nPt
|�}|dur�td�|���t|d}t	t|d�|B}|||fi|��dS)Nzshutil.unpack_archiver�zUnknown unpack format '{0}'r'r�zUnknown archive format '{0}')r?rhr<r(r�r0r�rri�dictr?r')r/r:rir�Z
filter_kwargsr+r,r�r%r%r&r�s*

 r�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�Sr*)r<rA�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVrw�free�total�usedr%r%r&rB	s

cCs"t�|�\}}||}t|||�Sr*)rZ
_getdiskusagerG)rVrIrHrJr%r%r&rBscCs�t�d|||�|dur(|dur(td��|}|}|dur>d}n(t|t�rft|�}|durftd�|���|durtd}n(t|t�s�t	|�}|dur�td�|���t
�|||�dS)Nzshutil.chownzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rhrrSr�r��LookupErrorri�intr�r<r)rV�userr�Z_userZ_groupr%r%r&r%s$

r��P�c
Cs�zttjd�}Wnttfy,d}Yn0zttjd�}WnttfyZd}Yn0|dksl|dkr�zt�tj���}Wn"t	tt
fy�t�|�}Yn0|dkr�|j}|dkr�|j
}t�||f�S)NZCOLUMNSrZLINES)rMr<�environr�rrr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrVrW�sizer%r%r&rEs$

rcCs&tj�|�o$t�||�o$tj�|�Sr*)r<rVrsr�r�)r_r�r%r%r&�
_access_checkvs�rYc
	s�tj���rt�|�r�SdSt�t�}|durrtj�dd�}|durrzt�d�}Wnt	t
fyptj}Yn0|szdS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rRtj}|r�t�|�}||vr�|�d|�t�d�p�t}dd�|�
tj�D�}|�rdd�|D�}t�fd	d
�|D���r>�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|v�rb|�|
�|D],}tj�|	|�}t||��r�|S�q��qbdS)N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr%r%�r�r2r%r%r&r��r�zwhich.<locals>.<listcomp>cSsg|]}t�|��qSr%)r<�fsencoder\r%r%r&r��r�c3s |]}����|���VqdSr*)�lowerr�r\��cmdr%r&�	<genexpr>�r�zwhich.<locals>.<genexpr>csg|]}�|�qSr%r%r\r_r%r&r��r�)r<rVrrYrSr�rR�get�confstrrTr�defpathr]r9�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r`r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r%r_r&r{sV







r)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rO)jr<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rmrrrOrUr�r�rBrqrh�__all__r-rr rrr'r,r(r)r:rFrNrr]r`rcr	r
r�rrr
rr�r�stat_resultr�r�r�r�rpr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r
rrrrrrrr5rrr6r=r>r0r?rr��
namedtuplerGrI�__doc__rJrHrBrrrY�F_OK�X_OKrr%r%r%r&�<module>s<







@

@B
�
A�
0	
	8�
�
�
BB	�
A
-����

�
8�
�
�
�
�1



 
1