Your IP : 3.145.106.176


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/shutil.cpython-310.opt-2.pyc

o

6��f,��@s,	ddlZddlZddlZddlZddlZddlZz	ddlZ[dZWney-dZYnwz	ddl	Z	[	dZ
WneyBdZ
Ynwz	ddlZ[dZWneyWdZYnwej
dkZdZZej
dkrkddlZnerqddlZerudndZeed�o�ej�d	�aeo�eed
�ZdZgd�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!dd�Z"dd�Z#efdd �Z$d�d!d"�Z%d#d$�Z&d%d&�Z'd'd(�Z(dd)�d*d+�Z)dd)�d,d-�Z*eed.��rdd)�d/d0�Z+nd1d0�Z+dd)�d2d3�Z,dd)�d4d5�Z-dd)�d6d7�Z.d8d9�Z/	d�d:d;�Z0dde.ddfd<d=�Z1eej2d>��r?d?d@�Z3dAdB�Z4ndCd@�Z3dDdB�Z4dEdF�Z5dGdH�Z6ej7ejej8ej9hej:k�oiej;ej<v�oiejej=vZ>d�dIdJ�Z?e>e?_@dKdL�ZAe.fdMdN�ZBdOdP�ZCdQdR�ZDdSdT�ZEdUdV�ZF		d�dXdY�ZG		d�dZd[�ZHd\eGd]gd^dfiZIe�r�eGd_gd`dfeIda<eHgdbdfeIdc<e
�r�eGddgdedfeIdf<e�r�eGdggdhdfeIdi<djdk�ZJd�dmdn�ZKdodp�ZL		d�dqdr�ZMdsdt�ZNdudv�ZO		ld�dwdx�ZPdydz�ZQd{d|�ZRd}d~�ZSdd�d�d��ZTd�geTgd^fd�geSgdbfd��ZUe�r!d�d�geTgd`feUda<e
�r.d�d�geTgdefeUdf<e�r;d�d�geTgdhfeUdi<d�d��ZVd�dd�d�d��ZWeed���rie�Xd��e�Yd�d��ZZd�eZj[_\d�eZj]_\d�eZj^_\d�d��Z_ne�r{e�Xd��e�Yd�d��ZZd�d��Z_d�d�d��Z`d�d�d��Zad�d��ZbejcejdBdfd�d��ZedS)��NTF�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@�eZdZdS)rN��__name__�
__module__�__qualname__�r$r$�-/opt/alt/python310/lib64/python3.10/shutil.pyr;�rc@r)rNr r$r$r$r%r>r&rc@r)rNr r$r$r$r%rAr&rc@r)rNr r$r$r$r%rEr&rc@r)�	ReadErrorNr r$r$r$r%r'Hr&r'c@r)�
RegistryErrorNr r$r$r$r%r(Kr&r(c@r)�_GiveupOnFastCopyNr r$r$r$r%r)Or&r)c
Cs�	z
|��}|��}Wnty}zt|��d}~wwz
t�|||�WdStyJ}z|j|_|j|_|j	t	j
t	jhvrCt|��|d�d}~ww�N)�fileno�	Exceptionr)rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr$r$r%�_fastcopy_fcopyfileTs$����r:c
Cs&	z
|��}|��}Wnty}zt|��d}~wwztt�|�jd�}Wnty2d}Ynwtj	dkr=t
|d�}d}	z
t�||||�}Wn=ty�}z1|j|_
|j|_|jtjkrfdat|��|jtjkro|d�|dkr�t�|dtj�dkr�t|��|�d}~ww|dkr�dS||7}q@)Ni�ili@rTF)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_sendfilehsH���

���rFc	Cs�	|j}|j}tt|���6}	||�}|sn%||kr6|d|��
}|�|�Wd�n1s0wYn||�qWd�dS1sFwYdSr*)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr$r$r%�_copyfileobj_readinto�s"���"�rNcCs2	|st}|j}|j}	||�}|sdS||�qr*)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr$r$r%r�s�rcCs�t|tj�r$ttjd�r$z
tj�|��t�|��WSty#YdSwttjd�r=ztj�||�WSty<YdSwtj�	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�s rc��follow_symlinksc
Cs<	t�d||�t||�rtd�||���d}t||g�D]4\}}zt|�}Wn	ty0Yqwt�	|j
�rHt|tj
�r@|jn|}td|��trQ|dkrQ|j}q|sct|�rct�t�|�|�|St|d���}z�t|d��u}tr�zt||tj�|WWd�WWd�Sty�YnDwtr�zt||�|WWd�WWd�Sty�Yn!wtr�|dkr�t||t|t��|Wd�WWd�St ||�Wd�n1s�wYWnt!�y
}	ztj�"|��st#d|���|	��d}	~	wwWd�|S1�swY|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�sx
��"����
����������
� � rcCsp	t�d||�|s#t|�r#tj�|�r#ttd�r!tjtj}}ndSt	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�	z	tj||d�}Wnty)}z|jtjtjtjfvr�WYd}~dSd}~ww|D]5}ztj|||d�}tj||||d�Wq,tya}z|jtj	tjtjtjfvrW�WYd}~q,d}~wwdS�Nrd)
r<r}r-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\re�namesrxr.�valuer$r$r%�
_copyxattr6s,�������r�cO�dSr*r$)�args�kwargsr$r$r%r�N�c	
sZ	t�d||�ddd�dd��|pt|�otj�|�}|r&�fdd�}n�fdd�}t|tj�r9|j|d�}n|d	�||d�}t�	|j
�}|d
�||j|jf|d�t
|||d�z|d�|||d�Wn	tyoYnwt|d�r�z
|d
�||j|d�WdSty�}zdD]}tt|�r�|jtt|�kr�nq��WYd}~dSd}~wwdS)Nzshutil.copystat)�nsrecWr�r*r$)r�rer�r$r$r%�_nop_r�zcopystat.<locals>._nopcstt|��Sr*)�getattrr<�r.�r�r$r%�lookupf�zcopystat.<locals>.lookupcstt|��}|tjvr
|S�Sr*)r�r<�supports_follow_symlinks)r.r_r�r$r%r�ks
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	QsB��
�����r	cC�D	tj�|�rtj�|tj�|��}t|||d�t|||d�|Sr~)r<rV�isdir�join�basenamerr�r[r\rer$r$r%r
�sr
cCr�r~)r<rVr�r�r�rr	r�r$r$r%r�s
rcs	�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rcCs2|dur|t�|�dd�|D��}nt�}tj||d�g}	|tup%|tu}
|D]�}|j|vr0q(tj�||j�}tj�||j�}
|
rD|n|}zf|�	�}|r`tjdkr`|j
dd�}|jt
jkr`d}|r�t�
|�}|rxt�||
�t||
|d�n3tj�|�s�|r�Wq(|��r�t||
|||||�n|||
�n|��r�t||
|||||�n|||
�Wq(ty�}z|	�|jd�WYd}~q(d}~wty�}z|	�||
t|�f�WYd}~q(d}~wwzt||�Wn&t�y}zt|dd�du�r|	�||t|�f�WYd}~nd}~ww|	�rt|	��|S)	NcSsg|]}|j�qSr$r�)�.0�xr$r$r%�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFrdrZwinerror)r<�fspathr��makedirsrr
r.rVr�rarW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrornr	rs�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinks�
dirs_exist_okr��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrarz�linktor9r�r$r$r%�	_copytree�sl


��
�� ����r�c	
CsZ	t�d||�t�|��}t|�}Wd�n1swYt||||||||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_attributescCsJz|jdd�}t�|j�o|jtj@o|jtjkWSty$YdSw�NFrd)rW�S_ISDIRrlr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrwr$r$r%�
_rmtree_isdir8s
��r�cCsFzt�|�}t�|j�p|jtj@o|jtjkWSt	y"YdSw)NF)
r<rzrW�S_ISLNKrlr�r�r�r�r-)rVrwr$r$r%�_rmtree_islinkAs

��r�cCs$z|jdd�WStyYdSwr�)r�r-)r�r$r$r%r�Js
�cCstj�|�Sr*)r<rVrb)rVr$r$r%r�Pr�c	Cs*zt�|��}t|�}Wd�n1swYWnty/|tj|t���g}Ynw|D]F}|j}t|�r_z
|��rDtd��WntyX|tjj	|t���Yq2wt
||�q2zt�|�Wq2tyx|tj|t���Yq2wzt�|�WdSty�|tj|t���YdSw)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�Ts>
�������r�c
CsDzt�|��}t|�}Wd�n1swYWnty:}z||_|tj|t���WYd}~dSd}~ww|D]�}tj�||j	�}z|j
dd�}WntyZd}Yn$w|r~z|jdd�}	t�|	j
�}Wnty}|tj|t���Yq=w|�rztj|j	tj|d�}
d}Wnty�|tj|t���Yq=wzUtj�|	t�|
��r�t|
||�zt�|
�d}tj|j	|d�Wn*ty�|tj|t���Ynwztd��ty�|tjj|t���YnwW|s�t�|
�q=|�st�|
�wwz
tj|j	|d�Wq=t�y|tj|t���Yq=wdS)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�ssz
�������
���
�����r�c	Cs�	t�d|�|rdd�}n|durdd�}tr�t|t�r"t�|�}zt�|�}Wnty<|tj|t�	��YdSwzt�
|tj�}d}Wnty[|tj
|t�	��YdSwzUtj�
|t�|��r�t|||�zt�|�d}t�|�Wn*ty�|tj|t�	��Ynwztd��ty�|tjj|t�	��YnwW|s�t�|�dSdS|s�t�|�wwz
t|�r�td��Wnty�|tjj|t�	��YdSwt||�S)Nz
shutil.rmtreecWr�r*r$�r�r$r$r%r��r�zrmtree.<locals>.onerrorcWs�r*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�sh



��
�������
rcCs2	t�|�}tjjtjjpd}tj�|�|��S�N�)r<r�rV�sep�altsepr��rstrip)rVr�r$r$r%�	_basename�s

r�c	CsP	t�d||�|}tj�|�r2t||�rt�||�dStj�|t|��}tj�	|�r2t
d|��z	t�||�W|Sty�tj�|�r[t�
|�}t�||�t�|�Y|Stj�|�r�t||�rnt
d||f��t|�s�t�|tj�s�t�|�r�tjdkr�td||f��t|||dd�t|�Y|S|||�t�|�Y|Sw)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�PermissionErrorrr)r[r\r�Zreal_dstr�r$r$r%r
sT
�
�
���
��

��r
cCsVtj�|�}tj�|�}|�tjj�s|tjj7}|�tjj�s&|tjj7}|�|�Sr*)r<rVrY�endswithr��
startswithrZr$r$r%r�Hs
r�cCs(t|�}tjtjg}t|d�o|j|vS)Nr�)r`rW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[rwZimmutable_statesr$r$r%r�Qsr�cC�l	|durdSzddlm}Wn
tyYdSwz||�}Wnty+d}Ynw|dur4|dSdS)Nr)�getgrnam�)Zgrpr��ImportError�KeyError)r.r��resultr$r$r%�_get_gidV� ��r�cCr�)Nr)�getpwnamr�)�pwdr�r�r�)r.r�r�r$r$r%�_get_uidhr�r��gzipc	sX	|durd}	n"tr|dkrd}	ntr|dkrd}	ntr#|dkr#d}	ntd�|���ddl}
|r4d	|	nd}|d
|}tj�|�}
|
r[tj�	|
�s[|durT|�
d|
�|s[t�|
�|durd|�
d�t���t
�������fd
d�}|s�|
�|d|	�}|}|dur�tj�||�}z|j|||d�W|��n|��w|dur�tj�|�}|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�rpr��addr�rY)�	base_name�base_dir�compress�verbose�dry_runrr�logger�root_dirZtar_compressionr	Zcompress_extZarchive_name�archive_dirr�tar�arcnamer$rr%�
_make_tarballzsJ�

	rcCs�	ddl}|d}	tj�|�}
|
r(tj�|
�s(|dur!|�d|
�|s(t�|
�|dur3|�d|	|�|s�|j|	d|jd���}tj�	|�}|durPtj�
||�}tj�	|�}|tjkrk|�||�|durk|�d|�t�
|�D]l\}
}}|
}|dur�tj�||�}tj�	|�}t|�D] }tj�
|
|�}tj�
||�}|�||�|dur�|�d|�q�|D],}tj�
|
|�}tj�	|�}tj�|�r�tj�
||�}|�||�|dur�|�d|�q�qpWd�n1s�wY|dur�tj�|	�}	|	S)Nr�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr
rsrr��ZipFileZZIP_DEFLATED�normpathr��curdirrH�walk�relpath�sorted�isfilerY)r
rrrrrrrrZzip_filenamerZzfr�dirpathZdirnames�	filenamesZ
arcdirpathr.rVr$r$r%�
_make_zipfile�sj
��
�����r$r)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcC� 	dd�t��D�}|��|S)NcSsg|]
\}}||df�qS)r�r$)r�r.�registryr$r$r%r�sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr$r$r%rs�rr�cCsx	|durg}t|�std|��t|ttf�std��|D]}t|ttf�r-t|�dkr1td��q|||dft|<dS)NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value)F)�callable�	TypeErrorrS�tupler��lenr()r.�function�
extra_args�descriptionZelementr$r$r%rs�rcCs
t|=dSr*)r(r�r$r$r%r/s
rc	
CsH	t�d||||�zt|}	Wntytd|�d�w||||d�}
|	d}|	dD]\}}
|
|
|<q.|dur>tj}|	d}d}|duro|rTt�|�}||
d<nt��}|durb|�	d|�tj
�|�}|sot�|�z|||fi|
��}W|dur�|dur�|�	d	|�t�|�|S|dur�|dur�|�	d	|�t�|�ww)
Nzshutil.make_archivezunknown archive format '%s')rrrrr��rzchanging into '%s'zchanging back to '%s')
r?rhr(r�rr<rr��getcwd�debugrVrY�chdir)r
rirrrrrrr�format_infor��func�arg�valZsupport_root_dirZsave_cwdr/r$r$r%r2sN��




��rcCr&)NcSs"g|]
\}}||d|df�qS)rr4r$)r�r.rr$r$r%r�ts"z&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSr)r*r+r$r$r%rns�rc	Csl	i}t��D]\}}|dD]}|||<qq|D]}||vr+d}t||||f��qt|�s4td��dS)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r<r)r(r,r-)	�
extensionsr0r1Zexisting_extensionsr.r�ext�	extension�msgr$r$r%�_check_unpack_optionsys 
����rAcCs.	|durg}t|||�||||ft|<dSr*)rAr<)r.r=r0r1r2r$r$r%r�s
rcCs	t|=dSr*)r<r�r$r$r%r�s
rcCs,	tj�|�}tj�|�st�|�dSdSr*)r<rVr
r�r�)rVr
r$r$r%�_ensure_directory�s
�rBc	
Cs�	ddl}|�|�std|��|�|�}zd|��D]X}|j}|�d�s(d|vr)qtjj	|g|�
d��R�}|s9qt|�|�d�sr|�
|d��"}t
|d��
}t||�Wd�n1s^wYWd�n1smwYqW|��dS|��w)Nrz%s is not a zip file�/z..�rrg)rZ
is_zipfiler'rZinfolistr/r�r<rVr��splitrBr�rprr�)	r/�extract_dirrr%rr.Z
targetpath�source�targetr$r$r%�_unpack_zipfile�s4


�����rIrcCs^	ddl}z|�|�}Wn|jytd|��wz|j||d�W|��dS|��w)Nrz/%s is not a compressed or uncompressed tar filer)r	rpZTarErrorr'Z
extractallr�)r/rFr�r	Ztarobjr$r$r%�_unpack_tarfile�s��rJr�r)rr%z.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D]\}}|dD]
}|�|�r|SqqdS)Nr)r<r)r�)r/r.rr?r$r$r%�_find_unpack_format�s
��rKcCs�	t�d|||�|durt��}t�|�}t�|�}|dur"i}nd|i}|durUzt|}Wnty?td�|��d�w|d}|||fit	|d��|��dSt
|�}|durdtd�|���t|d}t	t|d�|B}|||fi|��dS)Nzshutil.unpack_archiver�zUnknown unpack format '{0}'r3r�zUnknown archive format '{0}')r?rhr<r5r�r<r�rri�dictrKr')r/rFrir�Z
filter_kwargsr8r9r�r$r$r%r�s.

�"r�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCsB	t�|�}|j|j}|j|j}|j|j|j}t|||�Sr*)r<rM�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVrw�free�total�usedr$r$r%rN-s
cCs$	t�|�\}}||}t|||�Sr*)rZ
_getdiskusagerS)rVrUrTrVr$r$r%rN>scCs�	t�d|||�|dur|durtd��|}|}|dur d}nt|t�r4t|�}|dur4td�|���|dur;d}nt|t�sOt	|�}|durOtd�|���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�userrZ_userZ_groupr$r$r%rIs&

r��P�c
Cs�	z	ttjd�}Wn
ttfyd}Ynwz	ttjd�}Wn
ttfy.d}Ynw|dks7|dkraz
t�tj���}Wnt	tt
fyRt�|�}Ynw|dkrZ|j}|dkra|j
}t�||f�S)NZCOLUMNSrZLINES)rYr<�environr�rrr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)Zfallbackrbrc�sizer$r$r%ris,���rcCs&tj�|�ot�||�otj�|�Sr*)r<rVrsr�r�)r_r�r$r$r%�
_access_check�s�rec
	s�	tj���rt�|�r�SdSt�t�}|dur:tj�dd�}|dur:zt�d�}Wnt	t
fy9tj}Ynw|s>dS|rOt�|�}|�
t�tj��}nt�|�}|�
tj�}tjdkr�tj}|rit�|�}||vrs|�d|�t�d�pyt}dd�|�
tj�D�}|r�dd�|D�}t�fd	d
�|D��r��g}n
�fdd�|D�}n�g}t�}|D](}	tj�|	�}
|
|vr�|�|
�|D]}tj�|	|�}t||�r�|Sq�q�dS)N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr$r$�r�r>r$r$r%r���zwhich.<locals>.<listcomp>cSsg|]}t�|��qSr$)r<�fsencoderhr$r$r%r��sc3s"�|]}����|���VqdSr*)�lowerr�rh��cmdr$r%�	<genexpr>�s� zwhich.<locals>.<genexpr>csg|]}�|�qSr$r$rhrlr$r%r��ri)r<rVr
rerSr�r^�get�confstrr`r�defpathrjrE�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
rmr�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r$rlr%r�s^


�





��r)r)F)FN)r�rrNNNN)rrNNNNr�)NNrrNNN)NN)r[)fr<r?rWr��collectionsr1�zlibrr�r�rZlzmarr.rmrrrOrUr�r�rBrqru�__all__r-rrrrr'r,r(r)r:rFrNrr]r`rcrrr�r	r
rrr�r�stat_resultr�r�r�r�rpr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�r
r�r�r�r�rr$r(rrrrrrArrrBrIrJr<rKrr��
namedtuplerSrU�__doc__rVrTrNrrre�F_OK�X_OKrr$r$r$r%�<module>s>���



@

@B
�B
�0
		8�
�
�
BB	
�F
�?�����


�<
��
�
�
�1




 1

?>