HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/__pycache__/tempfile.cpython-310.opt-2.pyc
o

�is�@s	gd�ZddlZddlZddlZddlZddl	Z
ddlZddl
mZddlZddlZddlZddlZejZejejBejBZeed�rIeejOZeZeed�rUeej OZeed�r^ej!Z!ndZ!dZ"e�Z#d	d
�Z$dd�Z%d
d�Z&Gdd�d�Z'dd�Z(dd�Z)da*dd�Z+dd�Z,dd�Z-dd�Z.dd�Z/dd �Z0da1d!d"�Z2d#d$�Z3d%d&�Z4dBd(d)�Z5dCd*d+�Z6d,e"dfd-d.�Z7Gd/d0�d0�Z8Gd1d2�d2�Z9			5dDdd6�d7d8�Z:ej;d9ks�ej<d:kr�e:Z=need;�a>			dEdd6�d<d=�Z=Gd>d?�d?�Z?Gd@dA�dA�Z@dS)F)
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYri'�tmpcCs&zt�|�WdStyYdSw)NFT)�_os�lstat�OSError)�fn�r�%/usr/local/lib/python3.10/tempfile.py�_existsLs��rcGs�	d}|D],}|durqt|tj�rt�|�}t|t�r'|tur$td��t}q|tur/td��t}q|durCtdus?ttt�rAtStS|S)Nz1Can't mix bytes and non-bytes in path components.)�
isinstancer�PathLike�fspath�bytes�str�	TypeErrorr
)�args�return_type�argrrr�_infer_return_typeUs&

r#cCsf	t|||�}|dur|�}|dur|turt}nt�t�}|dur-|tur*t�}nt�}||||fS�N)r#r�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsrs
r+c@s.eZdZ	dZedd��Zdd�Zdd�ZdS)	�_RandomNameSequence�%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�krt�|_||_|jS)N�_rng_pid)r�getpid�getattr�_Random�_rngr.)�self�cur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|Sr$r�r3rrr�__iter__�sz_RandomNameSequence.__iter__cCsd�|jj|jdd��S)N��)�k)�joinr5�choices�
charactersr6rrr�__next__�sz_RandomNameSequence.__next__N)�__name__�
__module__�__qualname__r=�propertyr5r7r>rrrrr,�s
r,c	Cs�	g}dD]}t�|�}|r|�|�qtjdkr-|�tj�d�tj�d�ddddg�n|�gd	��z
|�t���W|St	t
fyP|�tj�Y|Sw)
N)�TMPDIR�TEMP�TMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmp)z/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlist�envname�dirnamerrr�_candidate_tempdir_list�s&
�

���rTcCs 	t�}t�}|D]~}|tjkrtj�|�}td�D]l}t|�}tj�||�}z0t�	|t
d�}zz
t�|d�Wt�|�nt�|�wWt�
|�nt�
|�w|WSty`Yqty}tjdkrztj�|�rzt�|tj�rzYqYn
ty�Ynwq	ttjd|��)N�d�sblatrFz)No usable temporary directory found in %s)r,rTrrPrK�abspath�range�nextr;�open�_bin_openflags�write�close�unlink�FileExistsError�PermissionErrorrI�isdir�access�W_OKr�FileNotFoundError�_errno�ENOENT)�namerrQr)�seqrI�filename�fdrrr�_get_default_tempdir�sD
�����rkcC�L	tdur$t��ztdurt�aWt��tSWt��tSt��wtSr$)�_name_sequence�
_once_lock�acquirer,�releaserrrr�_get_candidate_names�s�
�rqc
	Cs�	tj�|�}t�}|turttj|�}tt�D]J}t	|�}tj�
||||�}t�d|�z	t�
||d�}	Wn$tyAYqty\tjdkr[tj�|�r[t�|tj�r[Yq�w|	|fSttjd��)Nztempfile.mkstemprVrFz#No usable temporary file name found)rrKrWrqr�mapr&rXrrYr;�_sys�auditrZr_r`rIrarbrcre�EEXIST)
r)�pre�suf�flagsr*�namesrhrI�filerjrrr�_mkstemp_inner�s0���r{cGsR|tjvr||g|�Rddi�dStjdkstj�|�s'||g|�R�dSdS)N�follow_symlinksFrF)r�supports_follow_symlinksrIrK�islink)�funcrKr rrr�_dont_follow_symlinkss

�r�cCs<ztj}Wn	tyYnwt||d�ttj|d�dS)Nr�)r�chflagsrOr��chmod)rKr�rrr�_resetpermss
�r�cC�	t�t�Sr$)r�fsdecoder%rrrrr	#�
r	cCr�r$)rr&r%rrrrr'r�rcCrlr$)r
rnrorkrprrrr�_gettempdir-s�
�r�cC�	t�t��Sr$)rr�r�rrrrr9�rcCr�r$)rr&r�rrrrr
=r�r
FcCs4	t|||�\}}}}|rt}nt}t|||||�Sr$)r+�_text_openflagsr[r{)r(r'r)�textr*rxrrrrAsrc	Cs�	t|||�\}}}}t�}|turttj|�}tt�D]F}t|�}tj	�
||||�}t�d|�zt�
|d�W|StyGYqtybtjdkratj	�|�rat�|tj�raYq�wttjd��)Nztempfile.mkdtempr�rFz(No usable temporary directory name found)r+rqrrrrr&rXrrYrKr;rsrt�mkdirr_r`rIrarbrcreru)r(r'r)r*ryrhrIrzrrrrhs0���
�rr8cCs^	|durt�}t�}tt�D]}t|�}tj�||||�}t|�s(|Sqt	t
jd��)Nz"No usable temporary filename found)rrqrXrrYrrKr;rr_reru)r(r'r)ryrhrIrzrrrr�s��rc@sLeZdZ	dZdZddd�Zejdkr ejfdd�Z	d	d
�Z
dSdd�Z	dS)
�_TemporaryFileCloserNFTcCs||_||_||_dSr$)rzrI�delete�r3rzrIr�rrr�__init__�s
z_TemporaryFileCloser.__init__rFcCsX|js(|jdur*d|_z|j��W|jr||j�dSdS|jr'||j�wwdSdS�NT)�close_calledrzr]r�rI)r3r^rrrr]�s
���z_TemporaryFileCloser.closecC�|��dSr$)r]r6rrr�__del__��z_TemporaryFileCloser.__del__cCs|js
d|_|j��dSdSr�)r�rzr]r6rrrr]�s��T)r?r@rArzr�r�rrIr^r]r�rrrrr��s


r�c@s@eZdZ	ddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�_TemporaryFileWrapperTcCs$||_||_||_t|||�|_dSr$)rzrIr�r��_closerr�rrrr��sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�r"|�t����fdd��}|j|_|}t|t�s-t|||�|S)Nrz�__call__cs�|i|��Sr$r)r �kwargs�rrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r0�hasattr�
_functools�wrapsr�r�int�setattr)r3rIrz�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr$)rz�	__enter__r6rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr$)rz�__exit__r])r3�exc�value�tb�resultrrrr�sz_TemporaryFileWrapper.__exit__cCs	|j��dSr$)r�r]r6rrrr]	sz_TemporaryFileWrapper.closeccs�|jD]}|VqdSr$)rz)r3�linerrrr7s�
�z_TemporaryFileWrapper.__iter__Nr�)	r?r@rAr�r�r�r�r]r7rrrrr��s
r��w+b���T��errorsc	s�	t����\����t�tjdkr|r�tjO�d|vr"t�|�}d�������fdd�}	z,tj�||||||	d�}
zt|
d|
�}t|d|�}�|_t	|
�|�WWS|
�
���durotjdkrj|sot����)NrF�bcst������\}�|Sr$)r{)r rj�r)rxrIr*r'r(rr�opener:sz"NamedTemporaryFile.<locals>.opener��	buffering�newline�encodingr�r��buffer�raw)r+r[rrI�O_TEMPORARY�_io�
text_encodingrZr0r�r]r^)�moder�r�r�r(r'r)r�r�r�rzr�rr�rrs4


�
r�posix�cygwin�	O_TMPFILEc	s�	d|vr
t�|�}t����\����t�trTd����fdd�}ztj�||||||d�}	t|	d|	�}
t|
d|
�}
�|
_|	WStyKdaYn	t	ySYnwd�������fdd�}tj�||||||d�}	t|	d|	�}
t|
d|
�}
�|
_|	S)	Nr�cs$�tjBtj@}t��|d���S)NrV)rr��O_CREATrZ)r �flags2)r)rjrxrrr�tszTemporaryFile.<locals>.openerr�r�r�Fc
sJt������\�}zt�|�W�Sty$}zt����d}~wwr$)r{rr^�
BaseExceptionr])r rI�e�r)rjrxr*r'r(rrr��s�
��)
r�r�r+r[�_O_TMPFILE_WORKSrZr0rI�IsADirectoryErrorr)r�r�r�r�r(r'r)r�r�rzr�rr�rrZs@

��
	�rc@seZdZ	dZ			d7dd�dd�Zeej�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zedd��Zedd��Zedd��Zdd�Zdd�Zdd �Zed!d"��Zed#d$��Zed%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd8d1d2�Zd3d4�Zd5d6�Z dS)9rFrr�r�Nr�c	
	Cs^d|vr
t��|_nt�|�}tjt��||	|d�|_||_d|_||||||||	d�|_dS)Nr�)r�r�r�F)r�r�r(r'r�r�r)r�)r��BytesIO�_filer��
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r3�max_sizer�r�r�r�r(r'r)r�rrrr��s

��zSpooledTemporaryFile.__init__cCs4|jrdS|j}|r|��|kr|��dSdSdSr$)r�r��tell�rollover)r3rzr�rrr�_check�s

�zSpooledTemporaryFile._checkcCsv|jrdS|j}tdi|j��}|_|`|��}t|d�r)|j�|���	��n|�|�	��|�
|d�d|_dS)Nr�rTr)r�r�rr�r�r�r�r\�detach�getvalue�seek)r3rz�newfile�posrrrr��s


zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr6rrrr��szSpooledTemporaryFile.__enter__cC�|j��dSr$�r�r]�r3r�r�r�rrrr���zSpooledTemporaryFile.__exit__cC�
|j��Sr$)r�r7r6rrrr7��
zSpooledTemporaryFile.__iter__cCr�r$r�r6rrrr]�r�zSpooledTemporaryFile.closecC�|jjSr$)r�r�r6rrrr���zSpooledTemporaryFile.closedcCr�r$)r�r�r6rrrr��r�zSpooledTemporaryFile.encodingcCr�r$)r�r�r6rrrr��r�zSpooledTemporaryFile.errorscCs|��|j��Sr$)r�r��filenor6rrrr��s
zSpooledTemporaryFile.filenocCr�r$)r��flushr6rrrr��r�zSpooledTemporaryFile.flushcCr�r$)r��isattyr6rrrr��r�zSpooledTemporaryFile.isattycCs(z|jjWSty|jdYSw)Nr�)r�r�rOr�r6rrrr��s

�zSpooledTemporaryFile.modecCs z|jjWStyYdSwr$)r�rIrOr6rrrrIs

�zSpooledTemporaryFile.namecCr�r$)r��newlinesr6rrrr�
r�zSpooledTemporaryFile.newlinescG�|jj|�Sr$)r��read�r3r rrrr�r�zSpooledTemporaryFile.readcGr�r$)r��readliner�rrrr�r�zSpooledTemporaryFile.readlinecGr�r$)r��	readlinesr�rrrr�r�zSpooledTemporaryFile.readlinescGr�r$)r�r�r�rrrr�r�zSpooledTemporaryFile.seekcCr�r$)r�r�r6rrrr�r�zSpooledTemporaryFile.tellcCs8|dur|j��dS||jkr|��|j�|�dSr$)r��truncater�r�)r3�sizerrrr� s

zSpooledTemporaryFile.truncatecC�|j}|�|�}|�|�|Sr$)r�r\r�)r3�srz�rvrrrr\(�

zSpooledTemporaryFile.writecCr�r$)r��
writelinesr�)r3�iterablerzr�rrrr�.r�zSpooledTemporaryFile.writelines)rr�r�NNNNNr$)!r?r@rAr�r��classmethod�_types�GenericAlias�__class_getitem__r�r�r�r�r7r]rBr�r�r�r�r�r�r�rIr�r�r�r�r�r�r�r\r�rrrrr�sN��







rc@sbeZdZ			ddd�Zeddd��Zeddd��Zd	d
�Zdd�Zd
d�Z	dd�Z
eej�Z
dS)rNFcCs:t|||�|_||_tj||j|jd�|�|jd�|_dS)NzImplicitly cleaning up {!r})�warn_message�
ignore_errors)rrI�_ignore_cleanup_errors�_weakref�finalize�_cleanup�format�
_finalizer)r3r(r'r)�ignore_cleanup_errorsrrrr�As
�zTemporaryDirectory.__init__cs"���fdd�}tj�|d�dS)Nc	s�t|dt�rAz/|�krttj�|��t|�z	t�|�WWdSttfy3�j|�d�YnwWdSt	y@YdSwt|dt	�rJdS�sM�dS)Nr�r�)
�
issubclassr`r�rrKrSr^r��_rmtreerd)rrK�exc_info��clsr�rIrr�onerrorLs&���z+TemporaryDirectory._rmtree.<locals>.onerror)r)�_shutil�rmtree)rrIr�rrrrrJszTemporaryDirectory._rmtreecCs|j||d�t�|t�dS�Nr�)r�	_warnings�warn�ResourceWarning)rrIr�r�rrrr�bszTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r?rIr6rrr�__repr__gszTemporaryDirectory.__repr__cCs|jSr$)rIr6rrrr�jszTemporaryDirectory.__enter__cCr�r$)�cleanupr�rrrr�mr�zTemporaryDirectory.__exit__cCs2|j��stj�|j�r|j|j|jd�dSdSr)r�r�rrK�existsrIrr�r6rrrrps�zTemporaryDirectory.cleanup�NNNF)F)r?r@rAr�r�rr�r
r�r�rr�r�r�rrrrr5s
�	rr)NNN)r�r�NNNNNT)r�r�NNNNN)A�__all__�	functoolsr��warningsr	�ior��osr�shutilr�errnore�randomrr1�sysrs�typesr��weakrefr��_thread�
allocate_lock�_allocate_lock�O_RDWRr��O_EXCLr�r�rr[rrr%rnrr#r+r,rTrkrmrqr{r�r�r	rr
r�rr
rrrr�r�rrI�platformrr�rrrrrr�<module>s�





	,

'( +?��5
��K