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: 18.218.47.157
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : tempfile.cpython-32.pyc
l
��bc@sdZddddddddd	d
dgZdd
lZdd
lZdd
lZdd
lZ	dd
l
Zddlm
Zydd
lZWnek
r�d�ZYn
Xd�Zydd
lZWnek
r�dd
lZYnXejZe	je	jBe	jBZee	d�r ee	jOZnee	d�r?ee	jOZneZee	d�rdee	jOZnee	d�re	j Z ndZ dZ!e�Z"ee	d�r�e	j#Z$n$ee	d�r�e	j%Z$n	d�Z$d�Z&Gd�d�Z'd�Z(d�Z)d
a+d�Z,d�Z-d �Z.d
a/d!�Z0d"e!d
d0d#�Z2d"e!d
d$�Z3d"e!d
d%�Z4Gd&�d'�Z5d(d1d
d
d"e!d
d2d*�Z7e	j8d+ks�e	jj9d,kr�e7Z:nd(d3d
d
d"e!d
d-�Z:Gd.�d�Z;Gd/�de<�Z=d
S(4u�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  template - the default prefix for all temporary names.
             You may change this to control the default prefix.
  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.
uNamedTemporaryFileu
TemporaryFileuSpooledTemporaryFileuTemporaryDirectoryumkstempumkdtempumktempuTMP_MAXu
gettempprefixutempdiru
gettempdiriN(uRandomcCsdS(N((ufd((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_set_cloexec*scCsXytj|tjd�}Wntk
r0Yn$X|tjO}tj|tj|�dS(Ni(u_fcntlufcntluF_GETFDuIOErroru
FD_CLOEXECuF_SETFD(ufduflags((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_set_cloexec-s

uO_NOINHERITu
O_NOFOLLOWuO_BINARYi'utmpulstatustatcCs<yt|�}Wntk
r-tj�YnX|j�dS(N(uopenuIOErroru_osuerroruclose(ufnuf((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_statZs

cCs2yt|�Wntjk
r)dSYnXdSdS(NFT(u_statu_osuerroruFalseuTrue(ufn((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_existsas
	cBs;|EeZdZdZed��Zd�Zd�ZdS(u*An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is six characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.u%abcdefghijklmnopqrstuvwxyz0123456789_cCsCtj�}|t|dd�kr<t�|_||_n|jS(Nu_rng_pid(u_osugetpidugetattruNoneu_Randomu_rngu_rng_pid(uselfucur_pid((u//usr/local/python-3.2/lib/python3.2/tempfile.pyurngss
cCs|S(N((uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__iter__{scs;|j�|jj���fd�dD�}dj|�S(Ncsg|]}����qS(((u.0udummy(ucuchoose(u//usr/local/python-3.2/lib/python3.2/tempfile.pyu
<listcomp>�s	u123456u(u
charactersurnguchoiceujoin(uselfuletters((ucuchooseu//usr/local/python-3.2/lib/python3.2/tempfile.pyu__next__~s	N(u__name__u
__module__u__doc__u
charactersupropertyurngu__iter__u__next__(u
__locals__((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_RandomNameSequenceis

	u_RandomNameSequencecCs�g}x3dD]+}tj|�}|r
|j|�q
q
Wtjdkrg|jddddg�n|jd	d
dg�y|jtj��Wn+ttjfk
r�|jtj�YnX|S(
u[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.uTMPDIRuTEMPuTMPuntuc:\tempuc:\tmpu\tempu\tmpu/tmpu/var/tmpu/usr/tmp(uTMPDIRuTEMPuTMP(	u_osugetenvuappendunameuextendugetcwduAttributeErroruerrorucurdir(udirlistuenvnameudirname((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_candidate_tempdir_list�s
c	Csbt�}t�}x3|D]+}|tjkrOtjjtjj|��}nx�td�D]�}t|�}tjj	||�}yutj
|td�}zGz2tj
|ddd	��}|jd�WdQXWdtj|�XWdtj|�X|SWq\ttfk
r?}z|jdtjkr-PnWYdd}~Xq\Xq\WqWttjd|��dS(
uqCalculate 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.idi�uwbuclosefdsblatNiu)No usable temporary directory found in %sF(u_RandomNameSequenceu_candidate_tempdir_listu_osucurdirupathunormcaseuabspathurangeunextujoinuopenu_bin_openflagsu_iouFalseuwriteucloseuunlinkuOSErroruIOErroruargsu_errnouEEXISTuENOENT(	unamerudirlistudirusequnameufilenameufdufpue((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_get_default_tempdir�s.			
!	c
CsGtdkrCtj�ztdkr1t�anWdtj�XntS(u7Common setup sequence for all user-callable interfaces.N(u_name_sequenceuNoneu
_once_lockuacquireu_RandomNameSequenceurelease(((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_get_candidate_names�s
c
Cs�t�}x�tt�D]�}t|�}tjj||||�}y9tj||d�}t|�|tjj	|�fSWqt
k
r�}	z |	jtj
kr�wn�WYdd}	~	XqXqWttj
d��dS(u>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.i�Nu#No usable temporary file name found(u_get_candidate_namesurangeuTMP_MAXunextu_osupathujoinuopenu_set_cloexecuabspathuOSErroruerrnou_errnouEEXISTuIOError(
udirupreusufuflagsunamesusequnameufileufdue((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_mkstemp_inner�s	
cCstS(uAccessor for tempdir.template.(utemplate(((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu
gettempprefix�sc
CsGtdkrCtj�ztdkr1t�anWdtj�XntS(uAccessor for tempfile.tempdir.N(utempdiruNoneu
_once_lockuacquireu_get_default_tempdirurelease(((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu
gettempdir�s
ucCs@|dkrt�}n|r't}nt}t||||�S(u'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 specified, the file name will end with that suffix,
    otherwise there will be no suffix.

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

    If 'dir' is specified, 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.  On
    some operating systems, this makes no difference.

    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.
    N(uNoneu
gettempdiru_text_openflagsu_bin_openflagsu_mkstemp_inner(usuffixuprefixudirutextuflags((u//usr/local/python-3.2/lib/python3.2/tempfile.pyumkstemp�s	cCs�|dkrt�}nt�}x�tt�D]�}t|�}tjj||||�}ytj	|d�|SWq.t
k
r�}z |jtj
kr�w.n�WYdd}~Xq.Xq.Wttj
d��dS(uUser-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.
    i�Nu(No usable temporary directory name found(uNoneu
gettempdiru_get_candidate_namesurangeuTMP_MAXunextu_osupathujoinumkdiruOSErroruerrnou_errnouEEXISTuIOError(usuffixuprefixudirunamesusequnameufileue((u//usr/local/python-3.2/lib/python3.2/tempfile.pyumkdtemps
	cCs�|dkrt�}nt�}xMtt�D]?}t|�}tjj||||�}t	|�s.|Sq.Wt
tjd��dS(u�User-callable function to return a unique temporary file name.  The
    file is not created.

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

    This function is unsafe and should not be used.  The file name
    refers 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.
    u"No usable temporary filename foundN(
uNoneu
gettempdiru_get_candidate_namesurangeuTMP_MAXunextu_osupathujoinu_existsuIOErroru_errnouEEXIST(usuffixuprefixudirunamesusequnameufile((u//usr/local/python-3.2/lib/python3.2/tempfile.pyumktemp>s	cBsz|EeZdZdd�Zd�Zd�Zd�Zej	dkrmej
Z
d�Zd�Zd�Z
n	d	�Z
d
S(u�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.
    cCs(||_||_d|_||_dS(NF(ufileunameuFalseuclose_calledudelete(uselfufileunameudelete((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__init__ds			cCsB|jd}t||�}t|t�s>t|||�n|S(Nufile(u__dict__ugetattru
isinstanceuintusetattr(uselfunameufileua((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__getattr__js

cCs|jj�|S(N(ufileu	__enter__(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu	__enter__vs
cCs
t|j�S(N(uiterufile(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__iter__{suntcCsB|js>d|_|jj�|jr>|j|j�q>ndS(NT(uclose_calleduTrueufileucloseudeleteuunlinkuname(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuclose�s
		
	cCs|j�dS(N(uclose(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__del__�scCs&|jj|||�}|j�|S(N(ufileu__exit__uclose(uselfuexcuvalueutburesult((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__exit__�s
cCs|jj|||�dS(N(ufileu__exit__(uselfuexcuvalueutb((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__exit__�sNT(u__name__u
__module__u__doc__uTrueu__init__u__getattr__u	__enter__u__iter__u_osunameuunlinkucloseu__del__u__exit__(u
__locals__((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_TemporaryFileWrapper\s
						u_TemporaryFileWrapperuw+bic
Cs�|dkrt�}nt}tjdkrC|rC|tjO}nt||||�\}	}
tj|	|d|d|d|�}t	||
|�S(u�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).
    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 file.name.  The file will be automatically deleted
    when it is closed unless the 'delete' argument is set to False.
    untu	bufferingunewlineuencodingN(
uNoneu
gettempdiru_bin_openflagsu_osunameuO_TEMPORARYu_mkstemp_inneru_iouopenu_TemporaryFileWrapper(umodeu	bufferinguencodingunewlineusuffixuprefixudirudeleteuflagsufdunameufile((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuNamedTemporaryFile�suposixucygwinc
Cs�|dkrt�}nt}t||||�\}}	y3tj|	�tj||d|d|d|�SWntj|��YnXdS(u>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)
        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.
        u	bufferingunewlineuencodingN(	uNoneu
gettempdiru_bin_openflagsu_mkstemp_inneru_osuunlinku_iouopenuclose(
umodeu	bufferinguencodingunewlineusuffixuprefixudiruflagsufduname((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu
TemporaryFile�s

c	Bs.|EeZdZdZddddddedd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed��Zed
��Zd�Zd�Zd�Zed��Zed��Zed��Zd�Zd�Zd�Zd�Zed��Zd�Zd�Zd�Zd�ZdS( u�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.
    iuw+biuc		Cs�d|krtj�|_ntjdd�|_||_d
|_i|d6|d6|d6|d6|d6|d6|d	6|_dS(Nubunewlineu
umodeu	bufferingusuffixuprefixuencodingudirF(u_iouBytesIOu_fileuStringIOu	_max_sizeuFalseu_rolledu_TemporaryFileArgs(	uselfumax_sizeumodeu	bufferinguencodingunewlineusuffixuprefixudir((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__init__�s		cCs?|jr
dS|j}|r;|j�|kr;|j�ndS(N(u_rolledu	_max_sizeutellurollover(uselfufileumax_size((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_check�s
		cCsh|jr
dS|j}t|j�}|_|`|j|j��|j|j�d�d|_dS(NiT(	u_rolledu_fileu
TemporaryFileu_TemporaryFileArgsuwriteugetvalueuseekutelluTrue(uselfufileunewfile((u//usr/local/python-3.2/lib/python3.2/tempfile.pyurollovers		cCs|jjrtd��n|S(Nu%Cannot enter context with closed file(u_fileuclosedu
ValueError(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu	__enter__scCs|jj�dS(N(u_fileuclose(uselfuexcuvalueutb((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__exit__scCs
|jj�S(N(u_fileu__iter__(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__iter__scCs|jj�dS(N(u_fileuclose(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuclosescCs
|jjS(N(u_fileuclosed(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuclosed"scCsKy|jjSWn6tk
rFd|jdkr7�n|jdSYnXdS(Nubumodeuencoding(u_fileuencodinguAttributeErroru_TemporaryFileArgs(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuencoding&s
cCs|j�|jj�S(N(urolloveru_fileufileno(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyufileno/s
cCs|jj�dS(N(u_fileuflush(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuflush3scCs
|jj�S(N(u_fileuisatty(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuisatty6scCs2y|jjSWntk
r-|jdSYnXdS(Numode(u_fileumodeuAttributeErroru_TemporaryFileArgs(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyumode9s
cCs+y|jjSWntk
r&dSYnXdS(N(u_fileunameuAttributeErroruNone(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuname@s
cCsKy|jjSWn6tk
rFd|jdkr7�n|jdSYnXdS(Nubumodeunewline(u_fileunewlinesuAttributeErroru_TemporaryFileArgs(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyunewlinesGs
cGs|jj|�S(N(u_fileuread(uselfuargs((u//usr/local/python-3.2/lib/python3.2/tempfile.pyureadPscGs|jj|�S(N(u_fileureadline(uselfuargs((u//usr/local/python-3.2/lib/python3.2/tempfile.pyureadlineSscGs|jj|�S(N(u_fileu	readlines(uselfuargs((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu	readlinesVscGs|jj|�dS(N(u_fileuseek(uselfuargs((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuseekYscCs
|jjS(N(u_fileu	softspace(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu	softspace\scCs
|jj�S(N(u_fileutell(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyutell`scCs|jj�dS(N(u_fileutruncate(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyutruncatecscCs)|j}|j|�}|j|�|S(N(u_fileuwriteu_check(uselfusufileurv((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuwritefs	
cCs)|j}|j|�}|j|�|S(N(u_fileu
writelinesu_check(uselfuiterableufileurv((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu
writelinesls	
NFi����( u__name__u
__module__u__doc__uFalseu_rolleduNoneutemplateu__init__u_checkurolloveru	__enter__u__exit__u__iter__ucloseupropertyucloseduencodingufilenouflushuisattyumodeunameunewlinesureadureadlineu	readlinesuseeku	softspaceutellutruncateuwriteu
writelines(u
__locals__((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuSpooledTemporaryFile�s8
																			cBs�|EeZdZded	d�Zd�Zd�Zd
d�Z	d�Z
d�Zee
j�Zee
jj�Zee
jj�Zee
jj�Zee
j�Zee
j�Ze
jZejZd�Z d	S(u*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 everthing contained
    in it are removed.
    ucCs+d|_d|_t|||�|_dS(NF(uFalseu_closeduNoneunameumkdtemp(uselfusuffixuprefixudir((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__init__s		cCsdj|jj|j�S(Nu	<{} {!r}>(uformatu	__class__u__name__uname(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__repr__�scCs|jS(N(uname(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu	__enter__�scCs�|jr�|jr�y|j|j�Wnfttfk
r�}z@dt|�krZ�ntdj||�dtj	�dSWYdd}~XnXd|_|r�|jdj|�t�q�ndS(NuNoneu"ERROR: {!r} while cleaning up {!r}ufileuImplicitly cleaning up {!r}T(
unameu_closedu_rmtreeu	TypeErroruAttributeErrorustruprintuformatu_sysustderruTrueu_warnuResourceWarning(uselfu_warnuex((u//usr/local/python-3.2/lib/python3.2/tempfile.pyucleanup�s
	cCs|j�dS(N(ucleanup(uselfuexcuvalueutb((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__exit__�scCs|jdd�dS(Nu_warnT(ucleanupuTrue(uself((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu__del__�scCs�x�|j|�D]�}|j||�}y#|j|�oG|j|�}Wn|jk
rhd}YnX|r|j|�qy|j|�Wq|jk
r�YqXqWy|j|�Wn|jk
r�YnXdS(NF(	u_listdiru
_path_joinu_isdiru_islinku	_os_erroruFalseu_rmtreeu_removeu_rmdir(uselfupathunameufullnameuisdir((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu_rmtree�s #	NF(!u__name__u
__module__u__doc__utemplateuNoneu__init__u__repr__u	__enter__uFalseucleanupu__exit__u__del__ustaticmethodu_osulistdiru_listdirupathujoinu
_path_joinuisdiru_isdiruislinku_islinkuremoveu_removeurmdiru_rmdiruerroru	_os_erroru	_warningsuwarnu_warnu_rmtree(u
__locals__((u//usr/local/python-3.2/lib/python3.2/tempfile.pyuTemporaryDirectoryss 

						Fi����Ti����(>u__doc__u__all__uwarningsu	_warningsusysu_sysuiou_iouosu_osuerrnou_errnourandomuRandomu_Randomufcntlu_fcntluImportErroru_set_cloexecu_threadu
_dummy_threadu
allocate_locku_allocate_lockuO_RDWRuO_CREATuO_EXCLu_text_openflagsuhasattruO_NOINHERITu
O_NOFOLLOWu_bin_openflagsuO_BINARYuTMP_MAXutemplateu
_once_lockulstatu_statustatu_existsu_RandomNameSequenceu_candidate_tempdir_listu_get_default_tempdiruNoneu_name_sequenceu_get_candidate_namesu_mkstemp_inneru
gettempprefixutempdiru
gettempdiruFalseumkstempumkdtempumktempu_TemporaryFileWrapperuTrueuNamedTemporaryFileunameuplatformu
TemporaryFileuSpooledTemporaryFileuobjectuTemporaryDirectory(((u//usr/local/python-3.2/lib/python3.2/tempfile.pyu<module>s�
	
						%				%B		 !			�
© 2025 GrazzMean