Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 52.15.186.90
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : tempfile.cpython-310.opt-2.pyc
o

^b)o�@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.da/dd�Z0dd �Z1d!d"�Z2d>d$d%�Z3d?d&d'�Z4d(e"dfd)d*�Z5Gd+d,�d,�Z6Gd-d.�d.�Z7			1d@dd2�d3d4�Z8ej9d5ks�ej:d6kr�e8Z;need7�a<			dAdd2�d8d9�Z;Gd:d;�d;�Z=Gd<d=�d=�Z>dS)B)
�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�1/usr/local/python-3.10/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&
�

���rTcCsN	t�}t�}|D]�}|tjkrtj�|�}td�D]�}t|�}tj�||�}zGt�	|t
d�}z2z$tj	|ddd��
}|�d�Wd�n1sIwYWt�
|�nt�
|�wWt�|�nt�|�w|WStywYqty�tjdkr�tj�|�r�t�|tj�r�YqYq�ty�Yq�wq	ttjd|��)	N�d��wbF)�closefdsblatrFz)No usable temporary directory found in %s)r,rTrrPrK�abspath�range�nextr;�open�_bin_openflags�_io�write�close�unlink�FileExistsError�PermissionErrorrI�isdir�access�W_OKr�FileNotFoundError�_errno�ENOENT)�namerrQr)�seqrI�filename�fd�fprrr�_get_default_tempdir�sJ
�������rocC�L	tdur$t��ztdurt�aWt��tSWt��tSt��wtSr$)�_name_sequence�
_once_lock�acquirer,�releaserrrr�_get_candidate_names�s�
�ruc
	Cs�	t�}|turttj|�}tt�D]N}t|�}tj�	||||�}t
�d|�z	t�||d�}	Wn$t
y;YqtyVtjdkrUtj�|�rUt�|tj�rUYq�w|	tj�|�fSt
tjd��)Nztempfile.mkstemprVrFz#No usable temporary file name found)rur�maprr&rZrr[rKr;�_sys�auditr\rbrcrIrdrerfrYrh�EEXIST)
r)�pre�suf�flagsr*�namesrkrI�filermrrr�_mkstemp_inner�s.���rcC�	t�t�Sr$)r�fsdecoder%rrrrr	�
r	cCr�r$)rr&r%rrrrrr�rcCrpr$)r
rrrsrortrrrr�_gettempdirs�
�r�cC�	t�t��Sr$)rr�r�rrrrr)�rcCr�r$)rr&r�rrrrr
-r�r
FcCs4	t|||�\}}}}|rt}nt}t|||||�Sr$)r+�_text_openflagsr]r)r(r'r)�textr*r|rrrr1src	Cs�	t|||�\}}}}t�}|turttj|�}tt�D]F}t|�}tj	�
||||�}t�d|�zt�
|d�W|StyGYqtybtjdkratj	�|�rat�|tj�raYq�wttjd��)Nztempfile.mkdtemp�rFz(No usable temporary directory name found)r+rurrvrr&rZrr[rKr;rwrx�mkdirrbrcrIrdrerfrhry)r(r'r)r*r}rkrIr~rrrrXs0���
�rr8cCs^	|durt�}t�}tt�D]}t|�}tj�||||�}t|�s(|Sqt	t
jd��)Nz"No usable temporary filename found)rrurZrr[rrKr;rrbrhry)r(r'r)r}rkrIr~rrrr�s��rc@sLeZdZ	dZdZddd�Zejdkr ejfdd�Z	d	d
�Z
dSdd�Z	dS)
�_TemporaryFileCloserNFTcCs||_||_||_dSr$)r~rI�delete�r3r~rIr�rrr�__init__�s
z_TemporaryFileCloser.__init__rFcCsX|js(|jdur*d|_z|j��W|jr||j�dSdS|jr'||j�wwdSdS�NT)�close_calledr~r`r�rI)r3rarrrr`�s
���z_TemporaryFileCloser.closecC�|��dSr$)r`r6rrr�__del__��z_TemporaryFileCloser.__del__cCs|js
d|_|j��dSdSr�)r�r~r`r6rrrr`�s��T)r?r@rAr~r�r�rrIrar`r�rrrrr��s

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



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr$)r~�	__enter__r6rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr$)r~�__exit__r`)r3�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs	|j��dSr$)r�r`r6rrrr`�sz_TemporaryFileWrapper.closeccs�|jD]}|VqdSr$)r~)r3�linerrrr7s�
�z_TemporaryFileWrapper.__iter__Nr�)	r?r@rAr�r�r�r�r`r7rrrrr��s
r��w+b���T��errorscCs�	t|||�\}}}}	t}
tjdkr|r|
tjO}
d|vr"t�|�}t||||
|	�\}}ztj||||||d�}
t	|
||�WSt
yPt�|�t�|��w)NrF�b��	buffering�newline�encodingr�)
r+r]rrI�O_TEMPORARYr^�
text_encodingrr\r��
BaseExceptionrar`)�moder�r�r�r(r'r)r�r�r*r|rmrIr~rrrr
s$


�

�r�posix�cygwin�	O_TMPFILEc
Cs�	d|vr
t�|�}t|||�\}}}}t}	trTz|	tjBtj@}
t�||
d�}Wnt	y5daYnt
y=Ynwztj||||||d�WSt�|��t||||	|�\}}zt�
|�tj||||||d�WSt�|��)Nr�rVFr�)r^r�r+r]�_O_TMPFILE_WORKSrr��O_CREATr\�IsADirectoryErrorrr`rra)
r�r�r�r�r(r'r)r�r*r|�flags2rmrIrrrr?s>
�

�


�
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)r3r~r�rrr�_check�s

�zSpooledTemporaryFile._checkcCsv|jrdS|j}tdi|j��}|_|`|��}t|d�r)|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrTr)r�r�rr�r�r�r�r_�detach�getvalue�seek)r3r~�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�rIrOr6rrrrI�s

�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�sr~�rvrrrr_�

zSpooledTemporaryFile.writecCr�r$)r��
writelinesr�)r3�iterabler~r�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�s
�zTemporaryDirectory.__init__cs"���fdd�}tj�|d�dS)Nc	s�t|dt�rEdd�}z/|�kr|tj�|��||�z	t�|�WWdSttfy7�j|�d�YnwWdStyDYdSwt|dt�rNdS�sQ�dS)NrcSs4zt�|d�Wn	tyYnwt�|d�dS)Nrr�)r�chflagsrO�chmod)rKrrr�
resetperms's�z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms�r�)	�
issubclassrcrrKrSrar��_rmtreerg)r�rK�exc_infor���clsr�rIrr�onerror%s(���z+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutil�rmtree)r�rIr�r�rr�rr�#szTemporaryDirectory._rmtreecCs|j||d�t�|t�dS�Nr�)r��	_warnings�warn�ResourceWarning)r�rIr�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�existsrIr�r�r6rrrrPs�zTemporaryDirectory.cleanup�NNNF)F)r?r@rAr�r�r�r�rr�r�rr�r�r�rrrrrs
�	rr
)NNN)r�r�NNNNNT)r�r�NNNNN)?�__all__�	functoolsr��warningsr�ior^�osr�shutilr�errnorh�randomrr1�sysrw�typesr��weakrefr��_thread�
allocate_lock�_allocate_lock�O_RDWRr��O_EXCLr�r�rr]rrr%rrrr#r+r,rTrorqrurr	rr
r�rr
rrrr�r�rrI�platformrr�rrrrrr�<module>s~





	-

'( +?��*
��?
© 2025 GrazzMean