%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/__pycache__/tempfile.cpython-312.pyc

�

���f֑���dZgd�ZddlZddlZddlZddlZ		ddl
ZejZ
ddlZddlm Z!ddlZddl"Z#ddl$Z%ddl&Z&e&jNZ(e	jRe	jTze	jVzZ,e-e	d�re,e	j\zZ,e,Z/e-e	d	�re/e	j`zZ/e-e	d
�r
e	jbZ1ndZ1dZ2e(�Z3d
�Z4d�Z5d�Z6Gd�d�Z7d�Z8d�Z9da:d�Z;d�Z<d�Z=d�Z>d�Z?d�Z@daAd�ZBd�ZCd�ZDd2d�ZEd3d�ZFde2dfd �ZGGd!�d"�ZHGd#�d$�ZI			d4dd%d&�d'�ZJe	j�d(k7sej�d)k(reJZMne-e	d*�aN			d5dd+�d,�ZMGd-�d.ej��ZPGd/�d0�ZQy#e$r�ddlZddlZd�Zd�Ze	j*e	j"e	j,e	j.he	j0kxr2e	j2e	j4vxre	j"e	j6vZd1d�Z
Y���wxYw)6a�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
)
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�Nc��	tjj|�rtd��	g}	tj|�}|D]z}tjj||�}	tj|�j}tj|�r
t||��e	tj|��|	tj|�y#t$r7|tjj|t	j
��YywxYw#t$r.|tj|t	j
��Y��wxYw#t$rd}Y��wxYw#t$r.|tj|t	j
��Y��XwxYw#t$r-|tj|t	j
��YywxYw)N�%Cannot call rmtree on a symbolic linkr)�_os�path�islink�OSError�_sys�exc_info�listdir�join�lstat�st_mode�_stat�S_ISDIR�_rmtree_unsafe�unlink�rmdir)r�onerror�names�name�fullname�modes      �/usr/lib/python3.12/tempfile.pyrr2sn����8�8�?�?�4� ��A�B�B�!�
�E�4����D�!���?���8�8�=�=��t�,��	��9�9�X�&�.�.�D��=�=����8�W�-�
?��
�
�8�$�?�2��	�	�$���/���������t�}�}��7�����4�����T�4�=�=�?�3�4���	��D�	���
?���
�
�H�d�m�m�o�>�
?���2���	�	�4�����1�2�sX�*C�D�+E�-E)�F#�=D�D�3E�E�E&�%E&�)3F �F �#3G�Gc�<�g}	tj|�}|D�]}tjj||�}	tj||d��}|j}tj|�r�	tj|tj|��}		tjjtj|	��r&t!|	||�	tj"||��n	td��tj&|	���	tj(||����y#t$r<}||_|tj|t	j
��Yd}~��`d}~wwxYw#t$rd}Y��+wxYw#t$r-|tj"|t	j
��Y��wxYw#t$r8|tjj$|t	j
��Y��wxYw#tj&|	�wxYw#t$r.|tj|t	j
��Y��EwxYw#t$r.|tj(|t	j
��Y��wxYw)NF)�dir_fd�follow_symlinksr)r(r)rrr�filenamerrrr�statrrr�open�O_RDONLY�samestat�fstat�_rmtree_safe_fdr r�closer)
�topfdrr!r"�errr#r$�orig_str%�dirfds
          r&r0r0Ss����E�4����E�"���#?���8�8�=�=��t�,��	��h�h�t�E�5�I�G��?�?�D��=�=���
%�����s�|�|�E�B��%��x�x�(�(��#�)�)�E�2B�C�'��x��A�J��I�I�d�5�9�P�#*�+1�#2�2�
�I�I�e�$�
?��
�
�4��.�C#?���4��������T�4�=�=�?�3�3��4���	��D�	�� '�J�#�C�I�I�x�����I�J�� '�P�#�C�H�H�O�O�X�t�}�}��O�P���I�I�e�$��)�
=�����(�D�M�M�O�<�
=��0�
?���
�
�H�d�m�m�o�>�
?�s��D9�$F�:&H*�!AH�"F�9H�;G�I$�9	E>�1E9�9E>�F�F�3G	�H�G	�	H�=H
�	H�H
�
H�H'�*3I!� I!�$3J�Jc��|rd�}n|�d�}tr�t|t�rtj|�}	tj
|�}	tj|tj�}	tjj|tj|��r$t|||�	tj|�n	t!d��tj$|�yt'||�S#t$r-|tj
|tj��YywxYw#t$r-|tj
|tj��YywxYw#t $r-|tj|tj��Y��wxYw#t $r8|tjj"|tj��Y��
wxYw#tj$|�wxYw)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    c��y�N���argss r&r!z_rmtree.<locals>.onerror�s���Nc���r8r9r:s r&r!z_rmtree.<locals>.onerror�s��r<r)�_use_fd_functions�
isinstance�bytesr�fsdecoder�	Exceptionrrr,r-rr.r/r0r rrr1r)r�
ignore_errorsr!r4�fds     r&�_rmtreerE�sx���	�	��	���d�E�"��<�<��%�D�	��i�i��o�G�	����$����-�B�	��x�x� � ��#�)�)�B�-�8���D�'�2�>��I�I�d�O�D�!�"I�J�J�
�I�I�b�M��d�G�,�,��1�	��C�I�I�t�T�]�]�_�5��	��
�	��C�I�I�t�T�]�]�_�5��	���>��C�I�I�t�T�]�]�_�=�>���D��C�H�H�O�O�T�4�=�=�?�C�D��
�I�I�b�M�sr�C8�$D1�3AG'�4E*�	G'�F#�83D.�-D.�13E'�&E'�*3F �G'�F � G'�#=G$� G'�#G$�$G'�'G>)�Random�
O_NOFOLLOW�O_BINARYr	i'�tmpc�N�	tj|�y#t$rYywxYw)NTF)rrr)�fns r&�_existsrL�s+����	�	�"�
����������	$�$c�R�d}|D]w}|��t|tj�rtj|�}t|t�r|t
urt
d��t}�_|turt
d��t
}�y|�&t�ttt
�rt
StS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)r?r�PathLike�fspathr@�str�	TypeErrorr)r;�return_type�args   r&�_infer_return_typerU�s����K�����;���c�3�<�<�(��*�*�S�/�C��c�5�!��c�!��!3�4�4��K��e�#��!3�4�4��K�!�"���?�j��#�6��J��L��r<c���t|||�}|�|�}|�(|turt}ntjt�}|�|turt�}n
t
�}||||fS)z9Common parameter processing for most APIs in this module.)rUrQ�templater�fsencoderr)�prefix�suffix�dir�output_types    r&�_sanitize_paramsr]�sf��$�V�V�S�9�K�
�~����
�~��#���F��\�\�(�+�F�
�{��#���,�C��-�C��6�3��+�+r<c�0�eZdZdZdZed��Zd�Zd�Zy)�_RandomNameSequencea,An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.�%abcdefghijklmnopqrstuvwxyz0123456789_c��tj�}|t|dd�k7rt�|_||_|jS)N�_rng_pid)r�getpid�getattr�_Random�_rngrb)�self�cur_pids  r&�rngz_RandomNameSequence.rngs8���*�*�,���g�d�J��5�5��	�D�I�#�D�M��y�y�r<c��|Sr8r9�rgs r&�__iter__z_RandomNameSequence.__iter__!s���r<c�n�dj|jj|jd���S)N��)�k)rri�choices�
charactersrks r&�__next__z_RandomNameSequence.__next__$s)���w�w�t�x�x�'�'����1�'�=�>�>r<N)	�__name__�
__module__�__qualname__�__doc__rr�propertyrirlrsr9r<r&r_r_s*��+�9�J�
�����?r<r_c��g}dD]+}tj|�}|s�|j|��-tjdk(rR|j	tj
j
d�tj
jd�ddddg�n|j	gd	��	|jtj��|S#ttf$r#|jtj�Y|SwxYw)
z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)�TMPDIR�TEMP�TMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmp)z/tmpz/var/tmpz/usr/tmp)r�getenv�appendr#�extendr�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlist�envname�dirnames   r&�_candidate_tempdir_listr�'s����G�+�,���*�*�W�%���G�N�N�7�+�,�
�x�x�4��������,�,�-D�E����,�,�-A�B�#�Y��'�D�	E�	���9�:�#����s�z�z�|�$��N��
�G�$�#����s�z�z�"��N�#�s�,#C�.D�Dc�|�t�}t�}|D]�}|tjk7rtjj|�}t
d�D]�}t|�}tjj||�}	tj|td�}		tj|d�tj|�	tj|�|ccS��t+t,j.d|z��#tj|�wxYw#tj|�wxYw#t$rY��t$r^tj dk(rFtjj#|�r'tj$|tj&�rY��SY���t($rY���wxYw)aqCalculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized.�d�sblatr}z)No usable temporary directory found in %s)r_r�rr�r�abspath�range�nextrr,�_bin_openflags�writer1r�FileExistsError�PermissionErrorr#�isdir�access�W_OKr�FileNotFoundError�_errno�ENOENT)�namerr�r[�seqr#r*rDs       r&�_get_default_tempdirr�BsS��
 �!�E�%�'�G�����#�*�*���(�(�"�"�3�'�C���:�	�C���;�D��x�x�}�}�S�$�/�H�
��X�X�h���>��)�&��	�	�"�g�.��	�	�"�
��J�J�x�(��
�	�	�8�F�M�M�G�#�$�%�%���	�	�"�
���J�J�x�(��"�
��"�
��H�H��$�������)<��J�J�s�C�H�H�-����
��
�sI�D>�#D
�9D$�D>�
D!�!D$�$D;�;D>�>	F;�	AF;�.F;�:F;c���t�?tj�	t�
t�atj	�tStS#tj	�wxYw)z7Common setup sequence for all user-callable interfaces.)�_name_sequence�
_once_lock�acquirer_�releaser9r<r&�_get_candidate_namesr�psP��������	!��%�!4�!6����� ���>���
��� ���A�A"c��tjj|�}t�}|turttj|�}tt�D]f}t|�}tjj|||z|z�}tjd|�	tj||d�}	|	|fcStt(j*d��#t$rY��t$rZtj dk(rEtjj#|�r&tj$|tj&�rY��wxYw)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstempr�r}z#No usable temporary file name found)rrr�r�r@�maprXr�r	r�rr�auditr,r�r�r#r�r�r�r��EEXIST)
r[�pre�suf�flagsr\r"r�r#�filerDs
          r&�_mkstemp_innerr�~s
���(�(�
�
�3�
�C� �"�E��e���C�L�L�%�(���W�~����E�{���x�x�}�}�S�#��*�s�"2�3���
�
�%�t�,�	����$��u�-�B��4�x��!�$�&�-�-�?�A�A���	���	����D� �S�X�X�^�^�C�%8��
�
�3����)���	�s�&C�	E�)AE�	Ec��|tjvr
||g|��ddi�ytjdk(stjj	|�s
||g|���yy)Nr)Fr})r�supports_follow_symlinksr#rr)�funcrr;s   r&�_dont_follow_symlinksr��sO���s�+�+�+��T�0�D�0�%�0�	���T�	�������!6��T��D��"7r<c��	tj}t||d�ttj|d�y#t$rY�'wxYw)Nr�)r�chflagsr�r��chmod)rr�s  r&�_resetpermsr��sB��0��+�+��	�g�t�Q�/��#�)�)�T�5�1��	�
��
�s�;�	A�Ac�4�tjt�S)z7The default prefix for temporary directories as string.)rrArWr9r<r&r
r
�����<�<��!�!r<c�4�tjt�S)z6The default prefix for temporary directories as bytes.)rrXrWr9r<r&r
r
�r�r<c���t�?tj�	t�
t�atj	�tStS#tj	�wxYw)z&Private accessor for tempfile.tempdir.)rr�r�r�r�r9r<r&�_gettempdirr��sL��������	!���.�0����� ��N�7�N��
��� �r�c�<�tjt��S)z Returns tempfile.tempdir as str.)rrAr�r9r<r&rr�����<�<��
�&�&r<c�<�tjt��S)z"Returns tempfile.tempdir as bytes.)rrXr�r9r<r&rr�r�r<c�b�t|||�\}}}}|rt}nt}t|||||�S)a�User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    )r]�_text_openflagsr�r�)rZrYr[�textr\r�s      r&rr�s;��:(8����'L�$�F�F�C��������#�v�v�u�k�B�Br<c��t|||�\}}}}t�}|turttj
|�}t
t�D]�}t|�}tjj|||z|z�}tjd|�	t	j|d�tjj)|�cStt*j,d��#t$rY��t$r[tj dk(rFtjj#|�r't	j$|tj&�rY��	�wxYw)aUser-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    ztempfile.mkdtempr�r}z(No usable temporary directory name found)r]r�r@r�rrXr�r	r�rrrr��mkdirr�r�r#r�r�r�r�r�r�)rZrYr[r\r"r�r#r�s        r&rr�s��(8����'L�$�F�F�C�� �"�E��e���C�L�L�%�(���W�~�&���E�{���x�x�}�}�S�&�4�-�&�"8�9���
�
�%�t�,�	��I�I�d�E�"��x�x����%�%�!&�$�&�-�-�D�F�F���	���	����D� �S�X�X�^�^�C�%8��
�
�3����)���	�s�C+�+	E�6AE�Ernc�
�|�
t�}t�}tt�D]B}t	|�}t
jj|||z|z�}t|�r�@|cSttjd��)a�User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    z"No usable temporary filename found)rr�r�r	r�rrrrLr�r�r�)rZrYr[r"r�r#r�s       r&rrsw��$�{��l�� �"�E��W�~����E�{���x�x�}�}�S�&�4�-�&�"8�9���t�}��K�	��&�-�-�>�@�@r<c�f�eZdZdZdZdZd	d�Zejdk(ejfd�Z
d�Zd�Zy)
�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.Fc�<�||_||_||_||_yr8)r�r#�delete�delete_on_close�rgr�r#r�r�s     r&�__init__z_TemporaryFileCloser.__init__Cs����	���	����.��r<r}c��|jsed|_	|js!d|_|jj�|jr#|r|j
s	||j�yyyy#t$rYywxYw#|jr2|r|j
s#	||j�w#t$rYwwxYwwwxYw�NT)�cleanup_called�close_calledr�r1r�r�r#r�)rg�windowsrs   r&�cleanupz_TemporaryFileCloser.cleanupIs����"�"�"&�D��
��(�(�(,�D�%��I�I�O�O�%��;�;��D�4H�4H���t�y�y�)�5I�;�#��-������;�;��D�4H�4H���t�y�y�)��,�����5I�;�sA�-B�A3�3	A?�>A?�C�B1�0C�1	B=�:C�<B=�=Cc��|jsMd|_	|jj�|jr|jr|j�yyyy#|jr|jr|j�wwwxYwr�)r�r�r1r�r�r�rks r&r1z_TemporaryFileCloser.closeYsm��� � � $�D��
#��	�	���!��;�;�4�#7�#7��L�L�N�$8�;�!��
�;�;�4�#7�#7��L�L�N�$8�;�s�A�,Bc�$�|j�yr8)r�rks r&�__del__z_TemporaryFileCloser.__del__bs�����r<N�TT)
rtrurvrwr�r�r�rr#rr�r1r�r9r<r&r�r�;s;����N��L�/� #�x�x�4�/����� #�r<r�c�6�eZdZdZd	d�Zd�Zd�Zd�Zd�Zd�Z	y)
�_TemporaryFileWrapperz�Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    c�F�||_||_t||||�|_yr8)r�r#r��_closerr�s     r&r�z_TemporaryFileWrapper.__init__ns%����	���	�+�D�$��,;�=��r<c����|jd}t||�}t|d�r2|�tj���fd��}|j
|_|}t
|t�s
t|||�|S)Nr��__call__c����|i|��Sr8r9)r;�kwargsr�s  �r&�func_wrapperz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper|s����T�,�V�,�,r<)	�__dict__rd�hasattr�
_functools�wrapsr�r?�int�setattr)rgr#r��ar�r�s     @r&�__getattr__z!_TemporaryFileWrapper.__getattr__tsy����}�}�V�$���D�$����1�j�!��D�
�
�
�d�
#�
-�$�
-�$(�<�<�L� ��A��!�S�!��D�$��"��r<c�:�|jj�|Sr8)r��	__enter__rks r&r�z_TemporaryFileWrapper.__enter__�s���	�	�����r<c�t�|jj|||�}|jj�|Sr8)r��__exit__r�r�)rg�exc�value�tb�results     r&r�z_TemporaryFileWrapper.__exit__�s/�����#�#�C���3���������
r<c�8�|jj�y)zA
        Close the temporary file, possibly deleting it.
        N)r�r1rks r&r1z_TemporaryFileWrapper.close�s��	
�����r<c#�6K�|jD]}|���y�wr8)r�)rg�lines  r&rlz_TemporaryFileWrapper.__iter__�s �����I�I�	�D��J�	�s�Nr�)
rtrurvrwr�r�r�r�r1rlr9r<r&r�r�fs%���=��*��
�r<r�T)�errorsr�c	�
����
���t����\����t�
tjdk(r|r|	r�
tjz�
d|vrtj|�}d���
����fd�}
	tj�||||||
��}	t|d|�}t|d|�}�|_t|�||	�S#|j��xYw#��,tjdk(r|r|	stj���xYw)a�Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is automatically deleted (default True).
    'delete_on_close' -- if 'delete', whether the file is deleted on close
       (default True) or otherwise either on context manager exit
       (if context manager was used) or on object finalization. .
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.

    On POSIX, NamedTemporaryFiles cannot be automatically deleted if
    the creating process is terminated abruptly with a SIGKILL signal.
    Windows can delete the file even in this case.
    r}�bNc�,��t������\}�|Sr8)r�)r;rDr[r�r#r\rYrZs  ������r&�openerz"NamedTemporaryFile.<locals>.opener�s���!�#�v�v�u�k�J���D��	r<��	buffering�newline�encodingr�r��buffer�raw)r]r�rr#�O_TEMPORARY�_io�
text_encodingr,rdr�r1r)r%r�r�r�rZrYr[r�r�r�r�r�r�r�r#r\s    ```      @@@r&rr�s���6(8����'L�$�F�F�C���E��x�x�4��F��
���� ��
�$���$�$�X�.���D�����x�x��T�Y� '�(�6�%�'��	��$��$�/�C��#�u�c�*�C��C�H�(��t�V�_�M�M��	��J�J�L�������H�H����O��J�J�t��
�s�/C�.B;�;C�C�1D�posix�cygwin�	O_TMPFILE�r�c	��������
�d|vrtj|�}t����\����
t�trId����fd�}	tj
�||||||��}	t
|	d|	�}
t
|
d|
�}
�|
_|	Sd�����
��fd�}tj
�||||||��}	t
|	d|	�}
t
|
d|
�}
�|
_|	S#t$rdaY�Xt$rY�bwxYw)	a�Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        r�Nc����tjztjz}tj�|d���S)Nr�)rr�O_CREATr,)r;�flags2r[rDr�s  ���r&r�zTemporaryFile.<locals>.openers3����#�-�-�/�C�K�K�<�?���X�X�c�6�5�1���	r<r�r�r�Fc���t������\�}	tj|��S#t$r}tj���d}~wwxYwr8)r�rr�
BaseExceptionr1)	r;r#�er[rDr�r\rYrZs	   ������r&r�zTemporaryFile.<locals>.opener'sQ���%�c�6�6�5�+�N�H�B��
��
�
�4� ��I��!�
��	�	�"�
���
�s�,�	A�A�A)
r�r�r]r��_O_TMPFILE_WORKSr,rdr#�IsADirectoryErrorr)r%r�r�r�rZrYr[r�r�r�r�rDr�r\s    ```    @@@r&rr�s���$�d�?��(�(��2�H�+;�F�F�C�+P�(����[�����B�
�

��x�x��T�Y�(/�(�'-�f�>���d�H�d�3���c�5�#�.�������&��	�	��x�x��T�Y� '�(�6�%�'���d�H�d�+���c�5�#�&��������E%�
)�$)� ��
��
�s�>C�C*�C*�)C*c�D�eZdZdZdZ			d%dd�d�Zeej�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zed
��Zed��Zed��Zd�Zd�Zd�Zed��Zed��Zed��Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d&d �Z%d!�Z&d"�Z'd#�Z(d$�Z)y)'rz�Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    FNrc		��d|vrtj�|_nEtj|�}tjtj�||	|��|_||_d|_||||||||	d�|_y)Nr�)r�r�r�F)r%r�rZrYr�r�r[r�)r��BytesIO�_filer��
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
rg�max_sizer%r�r�r�rZrYr[r�s
          r&r�zSpooledTemporaryFile.__init__?sy���$�;�����D�J��(�(��2�H��*�*�3�;�;�=�%-�f�$+�-�D�J�"������+/�i�-3�v�/7�G�*-��#A��r<c��|jry|j}|r%|j�|kDr|j�yyyr8)rr�tell�rollover)rgr�rs   r&�_checkzSpooledTemporaryFile._checkRs4���<�<���>�>����	�	��h�.��M�M�O�/�8r<c��|jry|j}tdi|j��x}|_|`|j	�}t|d�r8|jj|j�j��n|j|j��|j|d�d|_y)Nr�rTr9)rrrrrr�r�r��detach�getvalue�seek)rgr��newfile�poss    r&rzSpooledTemporaryFile.rolloverXs����<�<���z�z��,�G�t�/F�/F�G�G��$�*��#��i�i�k���7�H�%��N�N� � �����!7�!7�!9�:��M�M�$�-�-�/�*����S�!����r<c�H�|jjrtd��|S)Nz%Cannot enter context with closed file)r�closed�
ValueErrorrks r&r�zSpooledTemporaryFile.__enter__ms ���:�:����D�E�E��r<c�8�|jj�yr8�rr1�rgr�r�r�s    r&r�zSpooledTemporaryFile.__exit__r����
�
���r<c�6�|jj�Sr8)rrlrks r&rlzSpooledTemporaryFile.__iter__v����z�z�"�"�$�$r<c��|js=tjdj|�td|��|j�yy)NzUnclosed file {!r}�)�
stacklevel�source)r �	_warnings�warn�format�ResourceWarningr1rks r&r�zSpooledTemporaryFile.__del__ys<���{�{��N�N�$�+�+�D�1����	
�
�J�J�L�r<c�8�|jj�yr8r#rks r&r1zSpooledTemporaryFile.close�r%r<c�.�|jjSr8)rr rks r&r zSpooledTemporaryFile.closed�����z�z� � � r<c�.�|jjSr8)rr�rks r&r�zSpooledTemporaryFile.encoding�����z�z�"�"�"r<c�.�|jjSr8)rr�rks r&r�zSpooledTemporaryFile.errors�r2r<c�V�|j�|jj�Sr8)rr�filenorks r&r7zSpooledTemporaryFile.fileno�s���
�
���z�z� � �"�"r<c�8�|jj�yr8)r�flushrks r&r9zSpooledTemporaryFile.flush�r%r<c�6�|jj�Sr8)r�isattyrks r&r;zSpooledTemporaryFile.isatty�����z�z� � �"�"r<c�l�	|jjS#t$r|jdcYSwxYw)Nr%)rr%r�rrks r&r%zSpooledTemporaryFile.mode�s5��	3��:�:�?�?�"���	3��*�*�6�2�2�	3�s��3�3c�N�	|jjS#t$rYywxYwr8)rr#r�rks r&r#zSpooledTemporaryFile.name�s'��	��:�:�?�?�"���	��	�rMc�.�|jjSr8)r�newlinesrks r&r@zSpooledTemporaryFile.newlines�r4r<c�6�|jj�Sr8)r�readablerks r&rBzSpooledTemporaryFile.readable�r'r<c�4�|jj|�Sr8)r�read�rgr;s  r&rDzSpooledTemporaryFile.read�����t�z�z����%�%r<c�4�|jj|�Sr8)r�read1rEs  r&rHzSpooledTemporaryFile.read1�s���t�z�z����&�&r<c�8�|jj|�Sr8)r�readinto�rgr�s  r&rJzSpooledTemporaryFile.readinto�s���z�z�"�"�1�%�%r<c�8�|jj|�Sr8)r�	readinto1rKs  r&rMzSpooledTemporaryFile.readinto1�s���z�z�#�#�A�&�&r<c�4�|jj|�Sr8)r�readlinerEs  r&rOzSpooledTemporaryFile.readline�s��"�t�z�z�"�"�D�)�)r<c�4�|jj|�Sr8)r�	readlinesrEs  r&rQzSpooledTemporaryFile.readlines�s��#�t�z�z�#�#�T�*�*r<c�6�|jj�Sr8)r�seekablerks r&rSzSpooledTemporaryFile.seekable�r'r<c�4�|jj|�Sr8)rrrEs  r&rzSpooledTemporaryFile.seek�rFr<c�6�|jj�Sr8)rrrks r&rzSpooledTemporaryFile.tell�s���z�z��� � r<c��|�|jj�S||jkDr|j�|jj|�Sr8)r�truncaterr)rg�sizes  r&rWzSpooledTemporaryFile.truncate�sD���<��:�:�&�&�(�(��d�n�n�$��
�
���:�:�&�&�t�,�,r<c�6�|jj�Sr8)r�writablerks r&rZzSpooledTemporaryFile.writable�r'r<c�b�|j}|j|�}|j|�|Sr8)rr�r)rg�sr��rvs    r&r�zSpooledTemporaryFile.write�s)���z�z��
�Z�Z��]�����D���	r<c�b�|j}|j|�}|j|�|Sr8)r�
writelinesr)rg�iterabler�r]s    r&r_zSpooledTemporaryFile.writelines�s*���z�z��
�_�_�X�
&�����D���	r<c�6�|jj�Sr8)rrrks r&rzSpooledTemporaryFile.detach�r<r<)r�w+b���NNNNNr8)*rtrurvrwrr��classmethod�_types�GenericAlias�__class_getitem__rrr�r�rlr�r1rxr r�r�r7r9r;r%r#r@rBrDrHrJrMrOrQrSrrrWrZr�r_rr9r<r&rr8s.����G�9;�(,�/3�A�?C�A�"$�F�$7�$7�8���
�*�
�%����!��!��#��#��!��!�#��#��3��3������#��#�%�&�'�&�'�*�+�%�&�!�-�%���#r<rc��eZdZdZ		ddd�d�Zed
d��Zedd��Zd�Zd	�Z	d
�Z
d�Zeej�Zy)raCreate and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed (unless delete=False is passed or an exception
    is raised during cleanup and ignore_cleanup_errors is not True).

    Optional Arguments:
        suffix - A str suffix for the directory name.  (see mkdtemp)
        prefix - A str prefix for the directory name.  (see mkdtemp)
        dir - A directory to create this temp dir in.  (see mkdtemp)
        ignore_cleanup_errors - False; ignore exceptions during cleanup?
        delete - True; whether the directory is automatically deleted.
    NT)r�c���t|||�|_||_||_t	j
||j|jdj|�|j|j��|_y)NzImplicitly cleaning up {!r})�warn_messagerCr�)	rr#�_ignore_cleanup_errors�_delete�_weakref�finalize�_cleanupr.�
_finalizer)rgrZrYr[�ignore_cleanup_errorsr�s      r&r�zTemporaryDirectory.__init__�s`���F�F�C�0��	�&;��#����"�+�+��$�-�-����6�=�=�d�C��5�5�d�l�l�L��r<c�6���������fd�}t�|��y)Nc�2��t|t�r]�r	|�k(r�ry�	|�k7r(ttjj|��t|�	tj|�yyyt|t�ry�s�y#t$r�j|���Y�4t$r]tjj|�rtjj|�r�rYy��j|�|�k(��Y��wxYw#t$rYywxYw)N�rC)rC�repeated)r?r�r�rrr�rrrEr��
isjunctionr�)r�rr��clsrCr#rus   ����r&�onexcz)TemporaryDirectory._rmtree.<locals>.onexcs����#��/�����$�����t�|�#�C�H�H�$4�$4�T�$:�;���%�=��
�
�4�(�=�G�"�C�!2�3��$��%��+-�G����D�
��F�*�
=� #�x�x�~�~�d�3�s�x�x�7J�7J�4�7P�,� &�!����D�
�.2�d�l�$�=�
=��)����sH�8D
�B�D� D
�"AD�*D
�,D�D
�D�D
�
	D�D)rx)rE)rwr#rCrurxs```` r&rEzTemporaryDirectory._rmtrees���$	�L	��E�"r<c�d�|r.|j||��tj|t�yy�Nrt)rEr,r-r/)rwr#rjrCr�s     r&rozTemporaryDirectory._cleanup/s(����K�K��M�K�:��N�N�<��9�r<c�b�dj|jj|j�S)Nz	<{} {!r}>)r.�	__class__rtr#rks r&�__repr__zTemporaryDirectory.__repr__5s#���!�!�$�.�.�"9�"9�4�9�9�E�Er<c��|jSr8)r#rks r&r�zTemporaryDirectory.__enter__8s���y�y�r<c�>�|jr|j�yyr8)rlr�r$s    r&r�zTemporaryDirectory.__exit__;s���<�<��L�L�N�r<c���|jj�s)tjj	|j
�r(|j
|j
|j��yyrz)rprrr�existsr#rErkrks r&r�zTemporaryDirectory.cleanup?sE���?�?�!�!�#�s�x�x���t�y�y�'A��L�L����$�2M�2M�L�N�(Br<�NNNF)FF)FT)rtrurvrwr�rdrEror}r�r�r�rerfrgr9r<r&rr�sp���&6:�',�L�8<�L��'#��'#�R�:��:�
F���O�$�F�$7�$7�8�r<r)FNr�)NNN)rbrcNNNNNT)rbrcNNNNN)Rrw�__all__�	functoolsr��warningsr,�ior��osr�shutil�_shutil�rmtreerE�ImportError�sysrr+rrr0r,rr �supports_dir_fdr�supports_fdr�r>�errnor��randomrFre�typesre�weakrefrm�_thread�
allocate_lock�_allocate_lock�O_RDWRr�O_EXCLr�r�rGr�rHr	rWr�rLrUr]r_r�r�r�r�r�r�r�r
r
rr�rrrrrr�r�rr#�platformrr
�IOBaserrr9r<r&�<module>r�sl���2������J-���N�N�'�T�$������&�&���*�*�s�{�{�*�S�Z�Z�7��
�3����s�~�~�%�O� ��
�3�
���c�l�l�"�N�
�3�	���k�k�G��G����
�
���:,�$?�?�0�6*%�X���A�:�2�"�"���
�'�'�$C�N&F�P�X�4�@�@(�(�V<�<�|;?�9=�(,�<�8<�'+�<�|�8�8�w��$�-�-�8�3�'�M��s�K�0��9=�8<��I�*.�I�Vl#�3�:�:�l#�^\9�\9��s�G-���2�B*?�X���#�(�(�C�J�J��	�	�B��(�(�)�>��[�[�C�O�O�3�>��X�X��!=�!=�=��
1-�mG-�s�F�BH�
H

Zerion Mini Shell 1.0