HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.7/__pycache__/tempfile.cpython-37.pyc
B

{a9|
@sdZddddddddd	d
ddd
g
ZddlZddlZddlZddlZ	yddl
ZejZ
Wnpek
rddlZddlZddZddZe	je	je	je	jhe	jkoe	je	jkoe	je	jkZdFddZ
YnXddlZddlm Z!ddl"Z#ddl$Z$e$j%Z&e	j'e	j(Be	j)BZ*e+e	dre*e	j,OZ*e*Z-e+e	dr2e-e	j.OZ-e+e	drFe	j/Z/ndZ/dZ0e&Z1e+e	drhe	j2Zne+e	dr|e	jZnddZd d!Z3d"d#Z4d$d%Z5Gd&d'd'Z6d(d)Z7d*d+Z8da9d,d-Z:d.d/Z;d0d	Z<d1dZ=da>d2dZ?d3d
Z@dGd4dZAdHd5dZBd6e0dfd7dZCGd8d9d9ZDGd:d;d;ZEdId?dZFe	jGd@ksVe	jjHdAkr\eFZIne+e	dBaJdJdCdZIGdDddZKGdEddeLZMdS)KaTemporary 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
TemporaryFileSpooledTemporaryFileTemporaryDirectorymkstempmkdtempmktempTMP_MAX
gettempprefixtempdir
gettempdirgettempprefixbgettempdirbNc	CsLytj|rtdWn(tk
r@|tjj|tdSXg}yt|}Wn&tk
rz|tj|tYnXx|D]}tj||}yt|j	}Wntk
rd}YnXt
|rt||qyt
|Wqtk
r
|tj
|tYqXqWyt|Wn(tk
rF|tj|tYnXdS)Nz%Cannot call rmtree on a symbolic linkr)_ospathislinkOSError_sysexc_infolistdirjoinlstatst_mode_statS_ISDIR_rmtree_unsafeunlinkrmdir)ronerrornamesnamefullnamemoder#/usr/lib/python3.7/tempfile.pyr2s6


rc

Csg}yt|}Wn:tk
rL}z||_|tj|tWdd}~XYnXx|D]x}tj||}ytj||dd}|j	}Wntk
rd}YnXt
|rytj|tj
|d}	Wn&tk
r|tj|tYnXztj|t|	rJt|	||ytj||dWn(tk
rF|tj|tYnXn8ytdWn*tk
r|tjj|tYnXWdt|	XqVytj||dWqVtk
r|tj|tYqVXqVWdS)NF)dir_fdfollow_symlinksr)r%z%Cannot call rmtree on a symbolic link)rrrfilenamerrrrstatrrropenO_RDONLYsamestatfstat_rmtree_safe_fdrrcloser)
topfdrrrerrr r!orig_str"dirfdr#r#r$r-SsD$

r-Fc	Cs^|rdd}n|dkrdd}trPt|tr8t|}yt|}Wn&tk
rl|tj|tdSXyt	|tj
}Wn&tk
r|tj|tdSXztj|t
|rt|||yt|Wn(tk
r|tj|tYnXn8ytdWn*tk
r<|tjj|tYnXWdt|Xn
t||SdS)aRecursively 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.

    cWsdS)Nr#)argsr#r#r$rsz_rmtree.<locals>.onerrorNcWsdS)Nr#)r3r#r#r$rsz%Cannot call rmtree on a symbolic link)_use_fd_functions
isinstancebytesrfsdecoder	Exceptionrrr)r*rr+r,r-rrrr.r)r
ignore_errorsrr1fdr#r#r$_rmtrees<


r;)Random
O_NOFOLLOWO_BINARYi'Ztmprr(cCst|tj}t|dS)N)rr)r*r.)fnr:r#r#r$rsrcCs*yt|Wntk
r dSXdSdS)NFT)rr)r?r#r#r$_existss
r@cGs`d}xJ|D]B}|dkrq
t|tr8|tkr2tdt}q
|tkrHtdt}q
W|dkr\tS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)r5r6str	TypeError)r3Zreturn_typeargr#r#r$_infer_return_types

rDcCsdt|||}|dkr|}|dkr:|tkr0t}n
tt}|dkrX|tkrRt}nt}||||fS)z9Common parameter processing for most APIs in this module.N)rDrAtemplaterfsencoderr
)prefixsuffixdiroutput_typer#r#r$_sanitize_paramss
rKc@s0eZdZdZdZeddZddZddZd	S)
_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.Z%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t}|t|ddkr&t|_||_|jS)N_rng_pid)rgetpidgetattr_RandomZ_rngrM)selfZcur_pidr#r#r$rngs
z_RandomNameSequence.rngcCs|S)Nr#)rQr#r#r$__iter__!sz_RandomNameSequence.__iter__cs0|j|jjfddtdD}d|S)Ncsg|]}qSr#r#).0Zdummy)cchooser#r$
<listcomp>'sz0_RandomNameSequence.__next__.<locals>.<listcomp>)
charactersrRZchoiceranger)rQZlettersr#)rUrVr$__next__$sz_RandomNameSequence.__next__N)	__name__
__module____qualname____doc__rZpropertyrRrSr\r#r#r#r$rLs
rLc	Csg}x$dD]}t|}|r
||q
Wtjdkr\|tjdtjdddddgn|d	d
dgy|tWn$t	t
fk
r|tjYnX|S)z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)ZTMPDIRZTEMPZTMPntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)rgetenvappendr extendr
expanduser
expandvarsgetcwdAttributeErrorrcurdir)dirlistZenvnamedirnamer#r#r$_candidate_tempdir_list*s



rmcCs4t}t}x|D]}|tjkr0tj|}xtdD]}t|}tj||}y\t	|t
d}z<z*tj	|ddd}|dWdQRXWdt
|XWdt|X|Stk
rYq:tk
rtjdkrtj|rt|tjrw:PYq:tk
rPYq:Xq:WqWttjd	|dS)
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.diwbF)closefdsblatNrbz)No usable temporary directory found in %s)rLrmrrjrabspathr[nextrr)_bin_openflags_iowriter.rFileExistsErrorPermissionErrorr isdiraccessW_OKrFileNotFoundError_errnoZENOENT)ZnamerrkrIseqr r'r:fpr#r#r$_get_default_tempdirEs:	
rcCs2tdkr.tztdkr taWdtXtS)z7Common setup sequence for all user-callable interfaces.N)_name_sequence
_once_lockacquirerLreleaser#r#r#r$_get_candidate_namests

rc
	Cst}|tkrttj|}xttD]}t|}tj	||||}yt
||d}	WnRtk
rnw$Yn>tk
rtj
dkrtj|rt|tjrw$nYnX|	tj|fSWttjddS)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.irbz#No usable temporary file name foundN)rr6maprrFr[rrrrrr)rvrwr rxryrzrqr|EEXIST)
rIZpreZsufflagsrJrr}r filer:r#r#r$_mkstemp_inners$rcCstS)z-The default prefix for temporary directories.)rEr#r#r#r$r	scCsttS)z6The default prefix for temporary directories as bytes.)rrFr	r#r#r#r$rscCs2tdkr.tztdkr taWdtXtS)zAccessor for tempfile.tempdir.N)r
rrrrr#r#r#r$rs

cCsttS)z)A bytes version of tempfile.gettempdir().)rrFrr#r#r#r$r
scCs2t|||\}}}}|rt}nt}t|||||S)aUser-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.  On
    some operating systems, this makes no difference.

    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.
    )rK_text_openflagsrsr)rHrGrItextrJrr#r#r$rs
c	Cst|||\}}}}t}|tkr.ttj|}xttD]}t|}tj	
||||}yt|dWnRtk
rw8Yn>t
k
rtjdkrtj	|rt|tjrw8nYnX|SWttjddS)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.
    irbz(No usable temporary directory name foundN)rKrr6rrrFr[rrrrrmkdirrvrwr rxryrzr|r)rHrGrIrJrr}r rr#r#r$rs&
rYcCs`|dkrt}t}x:ttD].}t|}tj||||}t|s|SqWt	t
jddS)aUser-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)rrr[rrrrrrr@rvr|r)rHrGrIrr}r rr#r#r$r	sc@sLeZdZdZdZdZd
ddZejdkr@ej	fdd	Z
d
dZndd	Z
dS)_TemporaryFileCloserzA separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTcCs||_||_||_dS)N)rr delete)rQrr rr#r#r$__init__1sz_TemporaryFileCloser.__init__rbcCs<|js8|jdk	r8d|_z|jWd|jr6||jXdS)NT)close_calledrr.rr )rQrr#r#r$r.@sz_TemporaryFileCloser.closecCs|dS)N)r.)rQr#r#r$__del__Jsz_TemporaryFileCloser.__del__cCs|jsd|_|jdS)NT)rrr.)rQr#r#r$r.Ns)T)r]r^r_r`rrrrr rr.rr#r#r#r$r)s



rc@sBeZdZdZdddZddZddZd	d
ZddZd
dZ	dS)_TemporaryFileWrapperzTemporary 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.
    TcCs$||_||_||_t||||_dS)N)rr rr_closer)rQrr rr#r#r$r\sz_TemporaryFileWrapper.__init__cs^|jd}t||}t|drD|tfdd}|j|_|}t|tsZt||||S)Nr__call__cs
||S)Nr#)r3kwargs)funcr#r$func_wrapperjsz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	__dict__rOhasattr
_functoolswrapsrr5intsetattr)rQr rarr#)rr$__getattr__bs



z!_TemporaryFileWrapper.__getattr__cCs|j|S)N)r	__enter__)rQr#r#r$rws
z_TemporaryFileWrapper.__enter__cCs|j|||}||S)N)r__exit__r.)rQexcvaluetbresultr#r#r$r}sz_TemporaryFileWrapper.__exit__cCs|jdS)zA
        Close the temporary file, possibly deleting it.
        N)rr.)rQr#r#r$r.sz_TemporaryFileWrapper.closeccsx|jD]
}|VqWdS)N)r)rQliner#r#r$rSsz_TemporaryFileWrapper.__iter__N)T)
r]r^r_r`rrrrr.rSr#r#r#r$rTs
rw+bTc
Cst|||\}}}}t}	tjdkr0|r0|	tjO}	t||||	|\}
}y tj|
||||d}t|||St	k
rt
|t|
YnXdS)aCreate 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 its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    rb)	bufferingnewlineencodingN)rKrsrr ZO_TEMPORARYrrtr)r
BaseExceptionrr.)
r"rrrrHrGrIrrJrr:r rr#r#r$rs




posixcygwin	O_TMPFILEcCst|||\}}}}t}try$|tjBtj@}	t||	d}
Wn*tk
rXdaYnBtk
rjYn0Xyt	j|
||||dSt
|
YnXt|||||\}
}yt|t	j|
||||dSt
|
YnXdS)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)
        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.
        iF)rrrN)
rKrs_O_TMPFILE_WORKSrrO_CREATr)IsADirectoryErrorrrtr.rr)r"rrrrHrGrIrJrZflags2r:r r#r#r$rs0






c@seZdZdZdZd7ddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
eddZddZddZddZedd Zed!d"Zed#d$Zd%d&Zd'd(Zd)d*Zd+d,Zed-d.Zd/d0Zd8d1d2Zd3d4Zd5d6ZdS)9rzTemporary 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.
    Frw+brNc		CsHd|krt|_ntjdd|_||_d|_|||||||d|_dS)Nb
)rF)r"rrHrGrrrI)rtBytesIO_fileStringIO	_max_size_rolled_TemporaryFileArgs)	rQmax_sizer"rrrrHrGrIr#r#r$rszSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(||kr(|dS)N)rrtellrollover)rQrrr#r#r$_checks
zSpooledTemporaryFile._checkcCsN|jr
dS|j}tf|j}|_|`||||dd|_dS)NrT)rrrrrugetvalueseekr)rQrZnewfiler#r#r$rszSpooledTemporaryFile.rollovercCs|jjrtd|S)Nz%Cannot enter context with closed file)rclosed
ValueError)rQr#r#r$r-szSpooledTemporaryFile.__enter__cCs|jdS)N)rr.)rQrrrr#r#r$r2szSpooledTemporaryFile.__exit__cCs
|jS)N)rrS)rQr#r#r$rS6szSpooledTemporaryFile.__iter__cCs|jdS)N)rr.)rQr#r#r$r.9szSpooledTemporaryFile.closecCs|jjS)N)rr)rQr#r#r$r<szSpooledTemporaryFile.closedcCs8y|jjStk
r2d|jdkr(|jdSXdS)Nrr"r)rrrir)rQr#r#r$r@szSpooledTemporaryFile.encodingcCs||jS)N)rrfileno)rQr#r#r$rIszSpooledTemporaryFile.filenocCs|jdS)N)rflush)rQr#r#r$rMszSpooledTemporaryFile.flushcCs
|jS)N)risatty)rQr#r#r$rPszSpooledTemporaryFile.isattycCs(y|jjStk
r"|jdSXdS)Nr")rr"rir)rQr#r#r$r"SszSpooledTemporaryFile.modecCs"y|jjStk
rdSXdS)N)rr ri)rQr#r#r$r ZszSpooledTemporaryFile.namecCs8y|jjStk
r2d|jdkr(|jdSXdS)Nrr"r)rnewlinesrir)rQr#r#r$raszSpooledTemporaryFile.newlinescGs|jj|S)N)rread)rQr3r#r#r$rjszSpooledTemporaryFile.readcGs|jj|S)N)rreadline)rQr3r#r#r$rmszSpooledTemporaryFile.readlinecGs|jj|S)N)r	readlines)rQr3r#r#r$rpszSpooledTemporaryFile.readlinescGs|jj|dS)N)rr)rQr3r#r#r$rsszSpooledTemporaryFile.seekcCs|jjS)N)r	softspace)rQr#r#r$rvszSpooledTemporaryFile.softspacecCs
|jS)N)rr)rQr#r#r$rzszSpooledTemporaryFile.tellcCs6|dkr|jn||jkr&||j|dS)N)rtruncaterr)rQsizer#r#r$r}s

zSpooledTemporaryFile.truncatecCs|j}||}|||S)N)rrur)rQsrrvr#r#r$rus

zSpooledTemporaryFile.writecCs|j}||}|||S)N)r
writelinesr)rQiterablerrr#r#r$rs

zSpooledTemporaryFile.writelines)rrrNNNNN)N)r]r^r_r`rrrrrrrSr.rarrrrrr"r rrrrrrrrrurr#r#r#r$rs8
		
c@sFeZdZdZdddZeddZddZd	d
ZddZ	d
dZ
dS)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.
    NcCs0t||||_tj||j|jd|d|_dS)NzImplicitly cleaning up {!r})warn_message)rr _weakrefZfinalize_cleanupformat
_finalizer)rQrHrGrIr#r#r$rs
zTemporaryDirectory.__init__cCst|t|tdS)N)r;	_warningswarnResourceWarning)clsr rr#r#r$rszTemporaryDirectory._cleanupcCsd|jj|jS)Nz	<{} {!r}>)r	__class__r]r )rQr#r#r$__repr__szTemporaryDirectory.__repr__cCs|jS)N)r )rQr#r#r$rszTemporaryDirectory.__enter__cCs|dS)N)cleanup)rQrrrr#r#r$rszTemporaryDirectory.__exit__cCs|jrt|jdS)N)rdetachr;r )rQr#r#r$rs
zTemporaryDirectory.cleanup)NNN)r]r^r_r`rclassmethodrrrrrr#r#r#r$rs

)FN)NNNF)NNN)rrNNNNNT)rrNNNNN)Nr`__all__	functoolsrwarningsriortosrZshutilZ_shutilZrmtreer;ImportErrorsysrr(rrr-r)rrsupports_dir_fdrsupports_fdsupports_follow_symlinksr4errnor|Zrandomr<rPweakrefr_thread
allocate_lockZ_allocate_lockO_RDWRrO_EXCLrrr=rsr>rrErrr@rDrKrLrmrrrrr	rr
rr
rrrrrrr platformrrrobjectrr#r#r#r$<module>s
!,3

	-
(
' +?
$

8