Your IP : 18.191.171.72


Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/tempfile.cpython-311.opt-1.pyc

�

c��f�|����dZgd�ZddlZddlZddlZddlZ	ddl
ZddlZ
ddlZddlmZddlZddlZddlZddlZejZe	je	jze	jzZe e	d��r
ee	j!zZeZ"e e	d��r
e"e	j#zZ"e e	d��re	j$Z$ndZ$d	Z%e��Z&d
�Z'd�Z(d�Z)Gd
�d��Z*d�Z+d�Z,da-d�Z.d�Z/d�Z0d�Z1d�Z2d�Z3da4d�Z5d�Z6d�Z7d0d�Z8d1d�Z9de%dfd�Z:Gd�d ��Z;Gd!�d"��Z<			d2dd&�d'�Z=e	j>d(ksej?d)kre=Z@ne e	d*��aA			d3dd&�d+�Z@Gd,�d-ejB��ZCGd.�d/��ZDdS)4a�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�N)�Random�
O_NOFOLLOW�O_BINARYr	i'�tmpc�R�	tj|��dS#t$rYdSwxYw)NTF)�_os�lstat�OSError)�fns �//opt/alt/python311/lib64/python3.11/tempfile.py�_existsrMs?����	�"�
�
�
��t�������u�u����s��
&�&c��d}|D]�}|��t|tj��rtj|��}t|t��r |t
urt
d���t}�h|turt
d���t
}��|�/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.)�
isinstancer�PathLike�fspath�bytes�str�	TypeErrorr)�args�return_type�args   r�_infer_return_typer%Vs����K������;���c�3�<�(�(�	"��*�S�/�/�C��c�5�!�!�		��c�!�!��!3�4�4�4��K�K��e�#�#��!3�4�4�4��K�K����?�j��#�6�6�?��J��L���c���t|||��}|�
|��}|�*|turt}ntjt��}|�&|turt��}nt
��}||||fS)z9Common parameter processing for most APIs in this module.)r%r �templater�fsencoderr)�prefix�suffix�dir�output_types    r�_sanitize_paramsr.ss|��$�V�V�S�9�9�K�
�~������
�~��#����F�F��\�(�+�+�F�
�{��#����,�,�C�C��-�-�C��6�3��+�+r&c�8�eZdZdZdZed���Zd�Zd�ZdS)�_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��krt��|_||_|jS)N�_rng_pid)r�getpid�getattr�_Random�_rngr3)�self�cur_pids  r�rngz_RandomNameSequence.rng�s>���*�,�,���g�d�J��5�5�5�5��	�	�D�I�#�D�M��y�r&c��|S�N��r8s r�__iter__z_RandomNameSequence.__iter__�s���r&c�j�d�|j�|jd�����S)N��)�k)�joinr:�choices�
charactersr>s r�__next__z_RandomNameSequence.__next__�s+���w�w�t�x�'�'���1�'�=�=�>�>�>r&N)	�__name__�
__module__�__qualname__�__doc__rF�propertyr:r?rGr=r&rr0r0�s\������+�+�9�J�
����X�����?�?�?�?�?r&r0c� �g}dD]-}tj|��}|r|�|���.tjdkrV|�tj�d��tj�d��ddddg��n|�gd	���	|�tj����n6#ttf$r"|�tj��YnwxYw|S)
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�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlist�envname�dirnames   r�_candidate_tempdir_listr_�s!���G�+�,�,���*�W�%�%���+�G�N�N�7�+�+�+���x�4��������,�,�-D�E�E���,�,�-A�B�B�#�Y��'�D�	E�	E�	E�	E�	���9�9�9�:�:�:�#����s�z�|�|�$�$�$�$���G�$�#�#�#����s�z�"�"�"�"�"�#�����Ns�1&C�0D�
Dc��t��}t��}|D�]�}|tjkrtj�|��}t
d��D�]?}t|��}tj�||��}	tj	|td��}		tj|d��tj|��n#tj|��wxYw	tj
|��n#tj
|��wxYw|ccS#t$rY��t$rUtjdkrAtj�|��r"tj|tj��rY��.Ynt($rYnwxYw���t+t,jd|z���)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�sblatrQz)No usable temporary directory found in %s)r0r_rr[rV�abspath�range�nextrD�open�_bin_openflags�write�close�unlink�FileExistsError�PermissionErrorrT�isdir�access�W_OKr�FileNotFoundError�_errno�ENOENT)�namerr\r,�seqrT�filename�fds       r�_get_default_tempdirrw�s���
 �!�!�E�%�'�'�G������#�*����(�"�"�3�'�'�C���:�:�	�	�C���;�;�D��x�}�}�S�$�/�/�H�
��X�h���>�>��)�&��	�"�g�.�.�.��	�"�
�
�
�
���	�"�
�
�
�
����
��J�x�(�(�(�(��C�J�x�(�(�(�(�����
�
�
�
�
��"�
�
�
���"�
�
�
��H��$�$������)<�)<�$��J�s�C�H�-�-�%��H�����
�
�
����
�����
�F�M�G�#�$�%�%�%sI�D(�0C�D	�C0�0D	�4D(�	D�D(�(
F�4AF�	F�Fc���t�gt���	t�t��at���n#t���wxYwtS)z7Common setup sequence for all user-callable interfaces.)�_name_sequence�
_once_lock�acquirer0�releaser=r&r�_get_candidate_namesr}�se����������	!��%�!4�!6�!6����� � � � ��J��� � � � �������A�A,c��tj�|��}t��}|turttj|��}tt��D]�}t|��}tj�
|||z|z��}tjd|��	tj
||d��}	nj#t$rY�pt$rRtjdkr@tj�|��r!tj|tj��rY�ɂwxYw|	|fcStt(jd���)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstemprbrQz#No usable temporary file name found)rrVrcr}r�mapr)rdr	rerD�_sys�auditrfrkrlrTrmrnrorq�EEXIST)
r,�pre�suf�flagsr-�namesrtrT�filervs
          r�_mkstemp_innerr��sH���(�
�
�3�
�
�C� �"�"�E��e����C�L�%�(�(���W�~�~�����E�{�{���x�}�}�S�#��*�s�"2�3�3���
�%�t�,�,�,�	���$��u�-�-�B�B���	�	�	��H��	�	�	���D� � �S�X�^�^�C�%8�%8� ��
�3���)�)�!����	�����4�x����
�&�-�?�A�A�As�2C	�	
D0�AD0�.D0c��|tjvr||g|�Rddi�dStjdkstj�|��s||g|�R�dSdS)N�follow_symlinksFrQ)r�supports_follow_symlinksrTrV�islink)�funcrVr"s   r�_dont_follow_symlinksr�s|���s�+�+�+���T�0�D�0�0�0�%�0�0�0�0�0�	��T�	�	������!6�!6�	���T��D�������
�	r&c��	tj}t||d��n#t$rYnwxYwttj|d��dS)Nr�)r�chflagsr�rZ�chmod)rVr�s  r�_resetpermsr�sc��0��+��	�g�t�Q�/�/�/�/���
�
�
���
�����#�)�T�5�1�1�1�1�1s� �
-�-c�4�tjt��S)z7The default prefix for temporary directories as string.)r�fsdecoder(r=r&rr
r
$����<��!�!�!r&c�4�tjt��S)z6The default prefix for temporary directories as bytes.)rr)r(r=r&rr
r
(r�r&c���t�gt���	t�t��at���n#t���wxYwtS)z&Private accessor for tempfile.tempdir.)rrzr{rwr|r=r&r�_gettempdirr�.sb����������	!���.�0�0����� � � � ��J��� � � � �����Nr~c�B�tjt����S)z Returns tempfile.tempdir as str.)rr�r�r=r&rrr:����<��
�
�&�&�&r&c�B�tjt����S)z"Returns tempfile.tempdir as bytes.)rr)r�r=r&rrr>r�r&Fc�v�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_openflagsrgr�)r+r*r,�textr-r�s      rrrBsH��:(8����'L�'L�$�F�F�C����������#�v�v�u�k�B�B�Br&c��t|||��\}}}}t��}|turttj|��}t
t��D]�}t|��}tj	�
|||z|z��}tjd|��	t	j
|d��nj#t$rY�ot$rRtjdkr@tj	�|��r!t	j|tj��rY�ȂwxYw|cStt(jd���)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�rQz(No usable temporary directory name found)r.r}rr�rr)rdr	rerVrDr�r��mkdirrkrlrTrmrnrorqr�)r+r*r,r-r�rtrTr�s        rrrisI��(8����'L�'L�$�F�F�C�� �"�"�E��e����C�L�%�(�(���W�~�~�����E�{�{���x�}�}�S�&�4�-�&�"8�9�9���
�%�t�,�,�,�	��I�d�E�"�"�"�"���	�	�	��H��	�	�	���D� � �S�X�^�^�C�%8�%8� ��
�3���)�)�!����	��������
�&�-�D�F�F�Fs�)B?�?
D&�AD&�$D&rAc�0�|�t��}t��}tt��D]J}t	|��}t
j�|||z|z��}t|��s|cS�Kttjd���)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.
    Nz"No usable temporary filename found)rr}rdr	rerrVrDrrkrqr�)r+r*r,r�rtrTr�s       rrr�s���$�{��l�l�� �"�"�E��W�~�~�����E�{�{���x�}�}�S�&�4�-�&�"8�9�9���t�}�}�	��K�K�K�	��&�-�>�@�@�@r&c�\�eZdZdZdZdZd
d�Zejdkrej	fd�Z
d�ZdSd	�Z
dS)�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTc�0�||_||_||_dSr<)r�rT�delete�r8r�rTr�s    r�__init__z_TemporaryFileCloser.__init__�s����	���	�����r&rQc���|js`|j�[d|_	|j���|jr||j��dSdS#|jr||j��wwxYwdSdS�NT)�close_calledr�rir�rT)r8rjs  rriz_TemporaryFileCloser.close�s����$�
*���)>�$(��!�*��I�O�O�%�%�%��{�*���t�y�)�)�)�)�)�*�*��t�{�*���t�y�)�)�)�)�*����
*�
*�)>�)>s�A�A%c�.�|���dSr<)rir>s r�__del__z_TemporaryFileCloser.__del__�s���J�J�L�L�L�L�Lr&c�X�|js"d|_|j���dSdSr�)r�r�rir>s rriz_TemporaryFileCloser.close�s7���$�
"�$(��!��	���!�!�!�!�!�
"�
"r&�T)rHrIrJrKr�r�r�rrTrjrir�r=r&rr�r��s����������D��L������x�4��� #�z�	*�	*�	*�	*�	�	�	�	�	�	"�	"�	"�	"�	"r&r�c�8�eZdZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d	S)�_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.
    Tc�\�||_||_||_t|||��|_dSr<)r�rTr�r��_closerr�s    rr�z_TemporaryFileWrapper.__init__�s.����	���	����+�D�$��?�?����r&c���|jd}t||��}t|d��r/|�tj����fd���}|j|_|}t
|t��st|||��|S)Nr��__call__c����|i|��Sr<r=)r"�kwargsr�s  �r�func_wrapperz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper�s����t�T�,�V�,�,�,r&)	�__dict__r5�hasattr�
_functools�wrapsr�r�int�setattr)r8rTr��ar�r�s     @r�__getattr__z!_TemporaryFileWrapper.__getattr__�s�����}�V�$���D�$�����1�j�!�!�	��D�
�
�d�
#�
#�
-�
-�
-�
-�$�
#�
-�$(�<�L� ��A��!�S�!�!�	#��D�$��"�"�"��r&c�8�|j���|Sr<)r��	__enter__r>s rr�z_TemporaryFileWrapper.__enter__�s���	�������r&c�f�|j�|||��}|���|Sr<)r��__exit__ri)r8�exc�value�tb�results     rr�z_TemporaryFileWrapper.__exit__s-����#�#�C���3�3���
�
�����
r&c�8�|j���dS)zA
        Close the temporary file, possibly deleting it.
        N)r�rir>s rriz_TemporaryFileWrapper.close
s��	
��������r&c#�&K�|jD]}|V��dSr<)r�)r8�lines  rr?z_TemporaryFileWrapper.__iter__s.�����I�	�	�D��J�J�J�J�	�	r&Nr�)
rHrIrJrKr�r�r�r�rir?r=r&rr�r��s���������@�@�@�@����*������
�������r&r��w+b���T��errorsc	������
��t�����\����t�tjdkr|r�tjz�d|vrtj|��}d�
���
���fd�}		tj�||||||	���}
	t|
d|
��}t|d|��}�
|_t|
�
|��S#|
�
���xYw#�
�&tjdkr|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 deleted on close (default True).
    '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.
    rQ�bNc�4��t�������\}�|Sr<)r�)r"rvr,r�rTr-r*r+s  ������r�openerz"NamedTemporaryFile.<locals>.opener?s!���!�#�v�v�u�k�J�J���D��	r&��	buffering�newline�encodingr�r��buffer�raw)r.rgrrT�O_TEMPORARY�_io�
text_encodingrfr5r�rirj)�moder�r�r�r+r*r,r�r�r�r�r�r�rTr-s    ```     @@@rrrsP��������.(8����'L�'L�$�F�F�C���E��x�4���F��
��� ��
�$����$�X�.�.���D�������������x��T�Y� '�(�6�%�'�'�'��	��$��$�/�/�C��#�u�c�*�*�C��C�H�(��t�V�<�<�<��	��J�J�L�L�L���������S�X��%5�%5�&�%5��J�t����
���s�*C�9C�C�C�+D�posix�cygwin�	O_TMPFILEc	�������
�d|vrtj|��}t�����\����
t�trmd����fd�}	tj�||||||���}	t
|	d|	��}
t
|
d|
��}
�|
_|	S#t$rdaYnt$rYnwxYwd�����
��fd�}tj�||||||���}	t
|	d|	��}
t
|
d|
��}
�|
_|	S)	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�n���tjztjz}tj�|d����S)Nrb)rr��O_CREATrf)r"�flags2r,rvr�s  ���rr�zTemporaryFile.<locals>.openerys0����#�-�/�C�K�<�?���X�c�6�5�1�1���	r&r�r�r�Fc���t�������\�}	tj|��n'#t$r}tj����d}~wwxYw�Sr<)r�rrj�
BaseExceptionri)	r"rT�er,rvr�r-r*r+s	   ������rr�zTemporaryFile.<locals>.opener�sj���%�c�6�6�5�+�N�N�H�B��
��
�4� � � � �� �
�
�
��	�"�
�
�
������
�����Is�.�
A�A
�
A)
r�r�r.rg�_O_TMPFILE_WORKSrfr5rT�IsADirectoryErrorr)r�r�r�r�r+r*r,r�r�r�r�rvr�r-s    ```    @@@rrr_s���������$�d�?�?��(��2�2�H�+;�F�F�C�+P�+P�(����[����	��B�
�
�
�
�
�
�
�

��x��T�Y�(/�(�'-�f�>�>�>���d�H�d�3�3���c�5�#�.�.��������$�
)�
)�
)�$)� � � ��
�
�
���
������	�	�	�	�	�	�	�	�	�	��x��T�Y� '�(�6�%�'�'�'���d�H�d�+�+���c�5�#�&�&������s�
AB�B-�!	B-�,B-c�f�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)dS)*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.
    Frr�r�Nr�c		��d|vrtj��|_nBtj|��}tjtj��||	|���|_||_d|_||||||||	d�|_dS)Nr�)r�r�r�F)r�r�r+r*r�r�r,r�)r��BytesIO�_filer��
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r8�max_sizer�r�r�r�r+r*r,r�s
          rr�zSpooledTemporaryFile.__init__�s����$�;�;�����D�J�J��(��2�2�H��*�3�;�=�=�%-�f�$+�-�-�-�D�J�"������+/�i�-3�v�/7�G�*-��#A�#A����r&c��|jrdS|j}|r.|���|kr|���dSdSdSr<)r�r��tell�rollover)r8r�r�s   r�_checkzSpooledTemporaryFile._check�sP���<�����>���	��	�	���h�.�.��M�M�O�O�O�O�O�	�	�.�.r&c��|jrdS|j}tdi|j��x}|_|`|���}t|d��r?|j�|����	����n'|�|�	����|�
|d��d|_dS)Nr�rTr=)r�r�rr�r�r�r�rh�detach�getvalue�seek)r8r��newfile�poss    rr�zSpooledTemporaryFile.rollover�s����<�����z��,�G�G�t�/F�G�G�G��$�*��#��i�i�k�k���7�H�%�%�	+��N� � ������!7�!7�!9�!9�:�:�:�:��M�M�$�-�-�/�/�*�*�*����S�!��������r&c�<�|jjrtd���|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr>s rr�zSpooledTemporaryFile.__enter__�s$���:��	F��D�E�E�E��r&c�8�|j���dSr<�r�ri�r8r�r�r�s    rr�zSpooledTemporaryFile.__exit__�����
�������r&c�4�|j���Sr<)r�r?r>s rr?zSpooledTemporaryFile.__iter__�����z�"�"�$�$�$r&c��|jsFtjd�|��td|���|���dSdS)NzUnclosed file {!r}�)�
stacklevel�source)r��	_warnings�warn�format�ResourceWarningrir>s rr�zSpooledTemporaryFile.__del__�s\���{�	��N�$�+�+�D�1�1����	
�
�
�
�
�J�J�L�L�L�L�L�	�	r&c�8�|j���dSr<rr>s rrizSpooledTemporaryFile.close�rr&c��|jjSr<)r�r�r>s rr�zSpooledTemporaryFile.closed��
���z� � r&c��|jjSr<)r�r�r>s rr�zSpooledTemporaryFile.encoding��
���z�"�"r&c��|jjSr<)r�r�r>s rr�zSpooledTemporaryFile.errorsrr&c�\�|���|j���Sr<)r�r��filenor>s rrzSpooledTemporaryFile.filenos#���
�
�����z� � �"�"�"r&c�8�|j���dSr<)r��flushr>s rrzSpooledTemporaryFile.flushrr&c�4�|j���Sr<)r��isattyr>s rrzSpooledTemporaryFile.isatty����z� � �"�"�"r&c�V�	|jjS#t$r|jdcYSwxYw)Nr�)r�r�rZr�r>s rr�zSpooledTemporaryFile.modes@��	3��:�?�"���	3�	3�	3��*�6�2�2�2�2�	3���s��(�(c�>�	|jjS#t$rYdSwxYwr<)r�rTrZr>s rrTzSpooledTemporaryFile.names3��	��:�?�"���	�	�	��4�4�	���s��
�c��|jjSr<)r��newlinesr>s rrzSpooledTemporaryFile.newlinesrr&c�4�|j���Sr<)r��readabler>s rr!zSpooledTemporaryFile.readable rr&c� �|jj|�Sr<)r��read�r8r"s  rr#zSpooledTemporaryFile.read#����t�z���%�%r&c� �|jj|�Sr<)r��read1r$s  rr'zSpooledTemporaryFile.read1&s���t�z���&�&r&c�6�|j�|��Sr<)r��readinto�r8r�s  rr)zSpooledTemporaryFile.readinto)s���z�"�"�1�%�%�%r&c�6�|j�|��Sr<)r��	readinto1r*s  rr,zSpooledTemporaryFile.readinto1,s���z�#�#�A�&�&�&r&c� �|jj|�Sr<)r��readliner$s  rr.zSpooledTemporaryFile.readline/s��"�t�z�"�D�)�)r&c� �|jj|�Sr<)r��	readlinesr$s  rr0zSpooledTemporaryFile.readlines2s��#�t�z�#�T�*�*r&c�4�|j���Sr<)r��seekabler>s rr2zSpooledTemporaryFile.seekable5rr&c� �|jj|�Sr<)r�r�r$s  rr�zSpooledTemporaryFile.seek8r%r&c�4�|j���Sr<)r�r�r>s rr�zSpooledTemporaryFile.tell;s���z��� � � r&c��|�|j���S||jkr|���|j�|��Sr<)r��truncater�r�)r8�sizes  rr6zSpooledTemporaryFile.truncate>sK���<��:�&�&�(�(�(��d�n�$�$��
�
�����:�&�&�t�,�,�,r&c�4�|j���Sr<)r��writabler>s rr9zSpooledTemporaryFile.writableFrr&c�h�|j}|�|��}|�|��|Sr<)r�rhr�)r8�sr��rvs    rrhzSpooledTemporaryFile.writeIs/���z��
�Z�Z��]�]�����D�����	r&c�h�|j}|�|��}|�|��|Sr<)r��
writelinesr�)r8�iterabler�r<s    rr>zSpooledTemporaryFile.writelinesOs1���z��
�_�_�X�
&�
&�����D�����	r&c�4�|j���Sr<)r�r�r>s rr�zSpooledTemporaryFile.detachUrr&)rr�r�NNNNNr<)*rHrIrJrKr�r��classmethod�_types�GenericAlias�__class_getitem__r�r�r�r�r?r�rirLr�r�r�rrrr�rTrr!r#r'r)r,r.r0r2r�r�r6r9rhr>r�r=r&rrr�s����������G�9;�(,�/3�A�?C�A�A�A�A�A�"$��F�$7�8�8�����
�
�
�*���
���%�%�%��������!�!��X�!��#�#��X�#��!�!��X�!�#�#�#����#�#�#��3�3��X�3�����X���#�#��X�#�%�%�%�&�&�&�'�'�'�&�&�&�'�'�'�*�*�*�+�+�+�%�%�%�&�&�&�!�!�!�-�-�-�-�%�%�%�������#�#�#�#�#r&rc��eZdZdZ		dd�Zedd���Zed
d���Zd�Zd�Z	d	�Z
d
�Zeej
��ZdS)ra+Create 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.
    NFc��t|||��|_||_tj||j|jd�|��|j���|_dS)NzImplicitly cleaning up {!r})�warn_message�
ignore_errors)rrT�_ignore_cleanup_errors�_weakref�finalize�_cleanupr
�
_finalizer)r8r+r*r,�ignore_cleanup_errorss     rr�zTemporaryDirectory.__init__es\���F�F�C�0�0��	�&;��#�"�+��$�-���6�=�=�d�C�C��5�7�7�7����r&c�J���������fd�}tj�|���dS)Nc�J��t|dt���re�r|�kr�rdS�	|�kr,ttj�|����t|��	tj|��dS#t$r��|����Yn�t$r�	tj	|��}n#t$r�rYYdS�wxYwtj|j
��sRtj|j
��r9t|d��r/|jtjzr|jtjkr�rYdS���|�|�k���YnwxYwdSdS#t($rYdSwxYwt|dt(��rdS�s�dS)Nr�rH�st_file_attributes)rH�repeated)�
issubclassrlr�rrVr^rjr��_rmtreerr�_stat�S_ISLNK�st_mode�S_ISDIRr�rR�FILE_ATTRIBUTE_REPARSE_POINT�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrp)r�rV�exc_info�st�clsrHrTrSs    ����r�onerrorz+TemporaryDirectory._rmtree.<locals>.onerrorps*����(�1�+��7�7�.
�������$�����#��t�|�|�#�C�H�$4�$4�T�$:�$:�;�;�;���%�%�%�=��
�4�(�(�(�(�(��,�G�G�G����D�
��F�F�F�F�F�*�=�=�=�"�!$��4���B�B��&�"�"�"�,�'� &����!�"����"�M�"�*�5�5�"� %�
�b�j� 9� 9�"�$�R�)=�>�>�"� �2�U�5W�W�"� �.�%�2R�R�R�,�'� &���!����D�
�.2�d�l�$�=�=�=�=�=�/=����G�F�0=�=��(�����D�D������H�Q�K�):�;�;�
���$����ss�AE2�.B�!E+�%E2�'	E+�1C�E+�C�E+�E2�C�A0E+�E2�E+�(E2�*E+�+E2�2
F�?F)r`)�_shutil�rmtree)r_rTrHrSr`s```` rrUzTemporaryDirectory._rmtreensL������/	�/	�/	�/	�/	�/	�/	�/	�b	��t�W�-�-�-�-�-�-r&c�h�|�||���tj|t��dS�NrQ)rUrrr)r_rTrGrHs    rrLzTemporaryDirectory._cleanup�s0�����D�
��6�6�6���|�_�5�5�5�5�5r&c�L�d�|jj|j��S)Nz	<{} {!r}>)r
�	__class__rHrTr>s r�__repr__zTemporaryDirectory.__repr__�s���!�!�$�.�"9�4�9�E�E�Er&c��|jSr<)rTr>s rr�zTemporaryDirectory.__enter__�s
���y�r&c�.�|���dSr<)�cleanuprs    rr�zTemporaryDirectory.__exit__�s���������r&c���|j���s$tj�|j��r#|�|j|j���dSdSrd)rMr�rrV�existsrTrUrIr>s rrjzTemporaryDirectory.cleanup�s^���?�!�!�#�#�	O�s�x���t�y�'A�'A�	O��L�L���$�2M�L�N�N�N�N�N�	O�	Or&�NNNF)FF)F)rHrIrJrKr�rArUrLrgr�r�rjrBrCrDr=r&rrrYs�������	�	�6:�',�7�7�7�7��2.�2.�2.��[�2.�h�6�6�6��[�6�F�F�F�������O�O�O�$��F�$7�8�8���r&rrm)NNN)r�r�NNNNNT)r�r�NNNNN)ErK�__all__�	functoolsr��warningsr�ior��osr�shutilra�statrV�errnorq�randomrr6�sysr��typesrB�weakrefrJ�_thread�
allocate_lock�_allocate_lock�O_RDWRr��O_EXCLr�r�rrgrr	r(rzrr%r.r0r_rwryr}r�r�r�r
r
rr�rrrrrr�r�rrT�platformrr��IOBaserrr=r&r�<module>r�s����2��������������������������������$�$�$�$�$�$������������������&���*�s�{�*�S�Z�7��
�7�3����&��s�~�%�O� ��
�7�3�
���#��c�l�"�N�
�7�3�	�����k�G�G��G����^�
�
�
�������:,�,�,�$?�?�?�?�?�?�?�?�0���6*%�*%�*%�X�����A�A�A�:���2�2�2�"�"�"�"�"�"���
�
�
�'�'�'�'�'�'�$C�$C�$C�$C�N&F�&F�&F�&F�P�X�4�@�@�@�@�@("�("�("�("�("�("�("�("�V<�<�<�<�<�<�<�<�~;?�9=�(,�7�8<�7�7�7�7�7�r�8�w���$�-�8�3�3�'�M�M��w�s�K�0�0��9=�8<��I�*.�I�I�I�I�I�Vl#�l#�l#�l#�l#�3�:�l#�l#�l#�^\9�\9�\9�\9�\9�\9�\9�\9�\9�\9r&

?>