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

name : test_tempfile.pyc
�
@��cc@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZ
ejddeddde�eed�r�ddlZd	Znd
ZejejkZeed�Zejd4krdZndZde
jfd��YZgZdefd��YZeje�defd��YZeje�defd��YZ eje �defd��YZ!eje!�defd��YZ"eje"�e	j#d��Z$d�Z%dd5d��YZ&d e&efd!��YZ'eje'�d"efd#��YZ(eje(�d$efd%��YZ)eje)�d&efd'��YZ*eje*�d(e&efd)��YZ+eje+�d*efd+��YZ,eje,�d,efd-��YZ-eje-�d.efd/��YZ.eje.�d0efd1��YZ/ej0ej1k	rneje/�nd2�Z2ed3kr�e2�ndS(6i����N(ttest_supporttignoretcategorytmessagetmktemptmoduletstatiitspawnltopenbsd3topenbsd4i0idtTCcBs,eZejd�Zdd�Zd�ZRS(s[a-zA-Z0-9_-]{6}$cCsA|dkrtj�}n|jd||d|df�dS(Ns%s raised %s: %sii(tNonetsystexc_infotfail(tselftwhattei((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pytfailOnException-sc	Cs�tjj|�\}}|t|� }|t|�t|�}|jtjj|�tjj|�d||f�|j||d||f�|j||d||f�|t|�t|�t|�!}|j|jj|�d|�dS(Nsfile '%s' not in directory '%s's"file '%s' does not begin with '%s's file '%s' does not end with '%s's6random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/(	tostpathtsplittlentassertEqualtabspatht
assertTruet	str_checktmatch(	Rtnametdirtpretsuftndirtnbasetnpretnsuf((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt	nameCheck2s$#N(t__name__t
__module__tretcompileRRRR$(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR
)sttest_exportscBseZd�ZRS(cCs�tj}idd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6dd6}g}x:|D]2}|d
dkri||kri|j|�qiqiW|jt|�d
kd|�dS(NitNamedTemporaryFilet
TemporaryFiletmkstemptmkdtempRtTMP_MAXt
gettempprefixt
gettempdirttempdirttemplatetSpooledTemporaryFileit_sunexpected keys: %s(ttempfilet__dict__tappendRR(Rtdicttexpectedtunexptkey((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR)Gs&	

(R%R&R)(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR)Fsttest__RandomNameSequencecBsVeZdZd�Zd�Zd�Zd�Zeje	e
d�d�d��ZRS(s6Test the internal iterator object _RandomNameSequence.cCstj�|_dS(N(R5t_RandomNameSequencetr(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pytsetUpfscCs)|jj�}|j|ddd�dS(Nt(R>tnextR$(Rts((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_get_six_char_striscCsfi}|j}xPtt�D]B}|j�}|j|ddd�|j||�d||<qWdS(NR@i(R>txranget
TEST_FILESRAR$tassertNotIn(RR8R>tiRB((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt	test_manyns	cCsYd}|j}y/x(|D] }|d7}|dkrPqqWWn|jd�nXdS(Niiit	iteration(R>R(RRGR>RB((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_supports_iterys	

tforks!os.fork is required for this testcCs tj�\}}d}z�tj�}|sytj|�tj|t|j�jd��tj|�tj	d�nt|j�}tj
|t|��jd�}Wd|r�ytj
|tj�Wntk
r�nXtj|d�ntj|�tj|�X|j||�dS(Ntasciii(RtpipeRRKtclosetwriteRAR>tencodet_exittreadRtdecodetkilltsignaltSIGKILLtEnvironmentErrortwaitpidtassertNotEqual(Rtread_fdtwrite_fdtpidtparent_valuetchild_value((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_process_awareness�s(
"
%

(R%R&t__doc__R?RCRHRJtunittestt
skipUnlessthasattrRR_(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR<cs				
ttest__candidate_tempdir_listcBs eZdZd�Zd�ZRS(s3Test the internal function _candidate_tempdir_list.cCsJtj�}|jt|�dk�x|D]}|j|t�q,WdS(Ni(R5t_candidate_tempdir_listtassertFalseRtassertIsInstancet
basestring(Rtcandtc((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_nonempty_list�s
c
Cs�tj���}x<dD]4}tj|�}|stjj|�||<qqWtj�}x<dD]4}tj|�}|s�t�n|j	||�qaWytj
�}Wn#ttjfk
r�tj
}nX|j	||�WdQXdS(NtTMPDIRtTEMPtTMP(RlRmRn(RlRmRn(tsupporttEnvironmentVarGuardRtgetenvRRR5Ret
ValueErrortassertIntgetcwdtAttributeErrorterrortcurdir(RtenvtenvnametdirnameRi((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_wanted_dirs�s 

	
(R%R&R`RkR{(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRd�s		tTestGetDefaultTempdircBseZdZd�ZRS(sTest _get_default_tempdir().csptj��zO�fd�}tjtd|��%tj�|jtj��g�d��tjtd���Y|j	t
��}tj�WdQX|j|jjtj
�|jtj��g�WdQX��fd�}tjtd|��[�|j	t
��}tj�WdQX|j|jjtj
�|jtj��g�WdQXWdQXWdtj��XdS(Ncs�gS(N(((tour_temp_directory(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pytour_candidate_list�sRec_std��dS(Ni����(tOSError(targstkwargs((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
raise_OSError�stopencs�||�}�|_|S(N(RO(R�R�tfp(t	orig_openR�(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
bad_writer�s	(R5R-Rot	swap_attrt_get_default_tempdirRRtlistdirtiotassertRaisestIOErrort	exceptionterrnotENOENTtshutiltrmtree(RR~tcmR�((R�R}R�s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_no_files_left_behind�s(

	)(R%R&R`R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR|�sttest__get_candidate_namescBs eZdZd�Zd�ZRS(s0Test the internal function _get_candidate_names.cCs#tj�}|j|tj�dS(N(R5t_get_candidate_namesRgR=(Rtobj((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_retval	scCs/tj�}tj�}|j||k�dS(N(R5R�R(Rtatb((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_same_things(R%R&R`R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�s	ccsFtj�}z%tjtd|��
dVWdQXWdtj|�XdS(NR1(R5R-RoR�R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt_inside_empty_temp_dirs
cstjtd�fd��S(NR�cs
t��S(N(titer((tnames(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt<lambda>%R@(RoR�R5(R�((R�s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt_mock_candidate_names"s	tTestBadTempdircBs#eZd�Zd�Zd�ZRS(c
Cs�t���tjtj�j}}|tjtjBtjBM}tj	tj|�z�tj
tjtj�r}|jd�n|j
t��}|j�WdQX|j|jjtjtjf�|jtjtj�g�Wdtj	tj|�XWdQXdS(Ns!can't set the directory read-only(R�RRR5R1tst_modetS_IWUSRtS_IWGRPtS_IWOTHtchmodtaccesstW_OKtskipTestR�Rt	make_tempRsR�R�tEPERMtEACCESRR�(RtoldmodetmodeR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_read_only_directory*s
" c
Cs�t��ttjjtjd�}tjtd|��@|jt	��}|j
�WdQX|j|jj
t
j�WdQXWdQXdS(NtnonexistentR1(R�RRtjoinR5R1RoR�R�RR�RR�R�R�(RR1R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_nonexisting_directory9s
c
Cs�t���tjjtjd�}t|d�j�tj	td|��I|j
t��}|j�WdQX|j
|jjtjtjf�WdQXWdQXdS(NtfiletwbR1(R�RRR�R5R1R�RNRoR�R�RR�RsR�R�tENOTDIRR�(RR1R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_non_directoryAs
(R%R&R�R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�(s		ttest__mkstemp_innercBs�eZdZddd��YZddddd�Zd�Zd�Zd�Ze	j
ed	�d
��Ze	j
e
d�d��Ze	j
ed
�d��Zd�Zd�Zd�ZRS(s*Test the internal function _mkstemp_inner.t	mkstempedcBsGeZejZejZejZ	ej
Zd�Zd�Z
d�ZRS(cCsC|r|j}n	|j}tj||||�\|_|_dS(N(t_bflagst_tflagsR5t_mkstemp_innertfdR(RRRRtbintflags((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt__init__Ts	cCstj|j|�dS(N(RROR�(Rtstr((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyROZscCs$|j|j�|j|j�dS(N(t_closeR�t_unlinkR(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt__del__]s(R%R&R5t_bin_openflagsR�t_text_openflagsR�RRNR�tunlinkR�R�ROR�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�Ns						R@icCsk|dkrtj�}ny|j||||�}Wn|jd�nX|j|j|||�|S(NR�(RR5R0R�RR$R(RRRRR�R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt	do_createascCs�|j�jd�|jdd�jd�|jdd�jd�|jdddd�jd�|jdddd�jd�dS(NtblatRR�RR�taas.txt(R�RO(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
test_basicls
cCs7tt�}x$|D]}|jdd�||<qWdS(NRR�(trangeRER�(RtextantRG((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_basic_manyts
cCs>tj�}z|jd|�jd�Wdtj|�XdS(NRR�(R5R-R�RORtrmdir(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_choose_directoryzssos.stat not availablecCsj|j�}tjtj|j�j�}d}tjdkrV|d?}|d
}n|j||�dS(Ni�twin32tos2emxiiii@(R�R�i	iI(	R�RtS_IMODERRR�RtplatformR(RR�R�R9tuser((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_file_mode�s

sos.spawnl not availablecCstjrd}nd}|j�}d|j}y
t}Wntk
r[tjd}nXtj	j
tj	jtj	j|��d�}tj
d
kr�dtj}d|}n	tj}tjtjtj||||�}|j|dkd|�|j|dkd	|�dS(Ntvtqs%distf_inherit_check.pyR�s"%s"s$child process caught fatal signal %ds child process reports failure %d(R�(RotverboseR�R�t__file__t	NameErrorRtargvRRR�RzRR�t
executableRtP_WAITRf(RR�R�R�tmettestert	decoratedtretval((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_noinherit�s&		


$	

	$stext mode not availablecCs|jdd�jd�dS(NR�isblat
(R�RO(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
test_textmode�scCs"tjtj�tjdtj�S(NR@(R5R�R0R2R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��scCs�t���tddd��o|j�\}}tj|�|j|jd��|j�\}}tj|�|j|jd��WdQXWdQXdS(Ntaaatbbb(R�R�R�RRNRtendswith(Rtfd1tname1tfd2tname2((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt!test_collision_with_existing_file�s


cCs�t��utddd��\tj�}|j|jd��|j�\}}tj|�|j|jd��WdQXWdQXdS(NR�R�(	R�R�R5R-RR�R�RRN(RRR�R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt&test_collision_with_existing_directory�s

(N(R%R&R`R�RR�R�R�R�RaRbthas_statR�t
has_spawnlR�thas_textmodeR�R�R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�Ks			%		
ttest_gettempprefixcBs eZdZd�Zd�ZRS(sTest gettempprefix().cCs9tj�}|j|t�|jt|�dk�dS(Ni(R5R/RgRhRR(Rtp((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_sane_template�scCs�tj�d}tjdd�}zjtjj||�}y tj|tjtjB�}Wn|j	d�nXtj
|�tj|�Wdtj|�XdS(Ns
xxxxxx.xxxtprefixR@sos.open(
R5R/R-RRR�R�tO_RDWRtO_CREATRRNR�R�(RR�tdR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_usable_template�s 
(R%R&R`R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s	ttest_gettempdircBs)eZdZd�Zd�Zd�ZRS(sTest gettempdir().cCs_tj�}|jtjj|�p0|tjkd|�|jtjj|�d|�dS(Ns%s is not an absolute paths%s is not a directory(R5R0RRRtisabsRwtisdir(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_directory_existss
$cCsLy'tj�}|jd�|j�Wn|jdtj��nXdS(NR�screate file in %s(R5R*RORNRR0(RR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_directory_writable
s
cCs/tj�}tj�}|j||k�dS(N(R5R0R(RR�R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�s(R%R&R`R�R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s			
ttest_mkstempcBs2eZdZdddd�Zd�Zd�ZRS(sTest mkstemp().R@c	Cs�|dkrtj�}nyotjd|d|d|�\}}tjj|�\}}tjj|�}|j||d||f�Wn|j	d�nXz|j
||||�Wdtj|�tj|�XdS(NRR�tsuffixs+Directory '%s' incorrectly returned as '%s'R,(
RR5R0R,RRRRRRR$RNR�(	RRRRR�RR R!tadir((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�$s$
cCsj|j�|jdd�|jdd�|jdddd�|jdddd�|jdd�dS(	NRR�RR�R�s.txtRt.(R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�6s
cCs5tj�}z|jd|�Wdtj|�XdS(NR(R5R-R�RR�(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�?sN(R%R&R`RR�R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�!s		ttest_mkdtempcBsqeZdZd�Zdddd�Zd�Zd�Zd�Ze	j
ed�d��Zd	�Z
d
�ZRS(sTest mkdtemp().cCs
tj�S(N(R5R-(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�MsR@cCs�|dkrtj�}ny"tjd|d|d|�}Wn|jd�nXy|j||||�|SWntj|��nXdS(NRR�R�R-(RR5R0R-RR$RR�(RRRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�Ps"
cCs�tj|j��tj|jdd��tj|jdd��tj|jdddd��tj|jdddd��dS(NRR�RR�R�s.txt(RR�R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�_s
cCsott�}z+x$|D]}|jdd�||<qWWdx-|D]%}t|t�rAtj|�qAqAWXdS(NRR�(R�RER�t
isinstanceRhRR�(RR�RG((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�gs

cCs>tj�}ztj|jd|��Wdtj|�XdS(NR(R5R-RR�R�(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�rssos.stat not availablecCs�|j�}zetjtj|�j�}|dM}d}tjd	kr`|d?}|d}n|j||�Wdtj|�XdS(Ni�i�R�R�iiii@(R�R�i	iI(	R�RR�RR�RR�RR�(RRR�R9R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt	test_modezs


cCs�t��utddd��\tjdt�}|j�|j|jjd��tj	�}|j|jd��WdQXWdQXdS(NR�R�tdelete(
R�R�R5R*tFalseRNRRR�R-(RR�R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s

cCsqt��btddd��Itj�}|j|jd��tj�}|j|jd��WdQXWdQXdS(NR�R�(R�R�R5R-RR�(Rtdir1tdir2((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s
N(R%R&R`R�RR�R�R�R�RaRbR�RR�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRJs					ttest_mktempcBsTeZdZd�Zd�Zdd	d��YZddd�Zd�Zd�ZRS(
sTest mktemp().cCstj�|_dS(N(R5R-R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR?�scCs)|jr%tj|j�d|_ndS(N(RRR�R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttearDown�s	tmktempedcBs,eZejZejZd�Zd�Z	RS(cCsGtjd|d|d|�|_tjtj|j|jd��dS(NRR�R�i�(R5RRRRNR�R�(RRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s!cCs|j|j�dS(N(R�R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s(
R%R&RR�R�R5R�R�R�R�(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR	�s			R@cCsSy|j|j||�}Wn|jd�nX|j|j|j||�|S(NR(R	RRR$R(RRRR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��scCsZ|j�|jdd�|jdd�|jdddd�|jdddd�dS(NRR�RR�R�s.txt(R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s

cCs7tt�}x$|D]}|jdd�||<qWdS(NRR�(R�RER�(RR�RG((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRH�s
((	R%R&R`R?RR	R�R�RH(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�s		
		ttest_NamedTemporaryFilecBskeZdZddded�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
RS(sTest NamedTemporaryFile().R@c	Csw|dkrtj�}ny(tjd|d|d|d|�}Wn|jd�nX|j|j|||�|S(NRR�R�RR*(RR5R0R*RR$R(RRRRRR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s
cCsZ|j�|jdd�|jdd�|jdddd�|jdddd�dS(NRR�RR�R�s.txt(R�(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR��s

cCs6tj�}|jtjj|j�d|j�dS(Ns$NamedTemporaryFile %s does not exist(R5R*RRRtexistsR(Rtf((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_creates_named�scCsttj�}zStjd|�}|jd�|j�|jtjj|j	�d|j	�Wdtj
|�XdS(NRR�s(NamedTemporaryFile %s exists after close(R5R-R*RORNRfRRRRR�(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_del_on_closes

cCs�tj�}d}zbtjd|dt�}|j}|jd�|j�|jt	j
j|j�d|j�Wd|dk	r�t	j|�nt	j
|�XdS(NRRR�s)NamedTemporaryFile %s missing after close(R5R-RR*RRRORNRRRRR�R�(RRttmpR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_dis_del_on_close
s	

cCsVtj�}|jd�|j�y|j�|j�Wn|jd�nXdS(Nsabc
RN(R5R*RORNR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_multiple_closes


csptj��#�|jtjj�j��WdQX|jtjj�j���fd�}|jt	|�dS(Ncs��WdQXdS(N(((R(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
use_closed-s(
R5R*RRRRRRfR�Rr(RR((Rs9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_context_manager(s
"cs�tj�tj}g���fd�}d�}|t_|t_z-|jttj�|jt��d�Wd�t_|t_XdS(Ncs�|��j|�dS(N(R7(R�(tclosedt	old_close(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRN7s
cWs
t��dS(N(Rr(R�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pytfdopen:si(	RRNRR�RrR5R*RR(Rt
old_fdopenRNR((RRs9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_no_leak_fd2s						c	Cshtj�}|jtj|�|jt��tjddd|�WdQX|jt	j
|�g�dS(NR�R((R5R-t
addCleanupRoR�R�t	TypeErrorR*RRR�(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt
test_bad_modeEs
N(R%R&R`RtTrueR�R�R
RRRRRR(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR
�s
						
	ttest_SpooledTemporaryFilecBs�eZdZddddd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sTest SpooledTemporaryFile().iR@c	Cs^|dkrtj�}ny(tjd|d|d|d|�}Wn|jd�nX|S(Ntmax_sizeRR�R�R3(RR5R0R3R(RRRRRR�((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�Ss(cCsN|j�}|j|j�|jdddddd�}|j|j�dS(NRidRR�Rs.txt(R�Rft_rolled(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�^scCs�tj�}z�tjddd|�}|j|j�|jdd�|j|j�|j}|j�|jt	j
j|�d|�Wdt	j|�XdS(NRi
Rsblat is*SpooledTemporaryFile %s exists after close(
R5R-R3RfRRORRRNRRRR�(RRRtfilename((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRes	
cCsj|jdd�}|j|j�x1td�D]#}|jdd�|jd�q/W|j|j�dS(NRiiitxitxxxxxxxxxxxxxxxxxxxx(R�RfRR�tseekRO(RRRG((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_rewrite_smalltscCs}|jdd�}|j|j�|jd�|j|j�|jd�|j|j�|jd�|j|j�dS(NRiR!ii
R"t
xxxxxxxxxx(R�RfRROR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_write_sequential}s


cCsF|j�}|jd�|jd�|j�}|j|d�dS(NR!tytzitxyz(R!R'R((R�t
writelinesR#RRR(RRtbuf((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_writelines�s


cCsY|jdd�}|jddd	f�|j|j�|jd�|j|j�dS(
NRi#R!ii
iR"R%txxxxx(R�R*RfRROR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_writelines_sequential�s

cCs�|jdd�}|jd	�|jd�|j|j�|jt|j��dgd�|jd�|j|j�|jd�|jt|j��dgdddg�dS(
NRisabc
iisx
ysx
R'sabc
abc
abc
abc
abc
(	R�ROR#RfRRtlistt
xreadlinesR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_xreadlines�s

#

cCsc|jdd�}|j|j�|jdd�|j|j�|jd�|j|j�dS(NRiidiR!(R�RfRR#ROR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_sparse�s
cCsO|jdd�}|j|j�|j|j�dk�|j|j�dS(NRii(R�RfRRtfileno(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_fileno�scCsftj�}|jd�|j|j�|j�y|j�|j�Wn|jd�nXdS(Nsabc
RN(R5R3RORfRRNR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt#test_multiple_close_before_rollover�s


cCsltjdd�}|jd�|j|j�|j�y|j�|j�Wn|jd�nXdS(NRisabc
RN(R5R3RORRRNR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt"test_multiple_close_after_rollover�s


cCs|jdd�}|j}|j}|j}|dd�|dd�|dd�|j|d�ddddk�dS(NRiR�i#R�iiF(R�RRROR#R(RRRRROR#((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_bound_methods�s			
cCs
tjdd�}|jd�|j|j�|j|jd�|j|j�|j	t
��|jWdQX|j	t
��|jWdQX|jd�|j
|j�|j|jd�|j|j�|j	t
��|jWdQX|j	t
��|jWdQXdS(NRi
R!sw+bR%(R5R3RORfRRR�tassertIsNoneRR�RutnewlinestencodingRtassertIsNotNone(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_properties�s"




csntjdd��'�|j�j�|j�j�WdQX|j�j��fd�}|jt|�dS(NRics��WdQXdS(N(((R(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�s(R5R3RfRRRR�Rr(RR((Rs9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt$test_context_manager_before_rollover�scs�tjdd��N�|j�j��jd��j�|j�j�|j�j�WdQX|j�j��fd�}|jt	|�dS(NRisabc
cs��WdQXdS(N(((R(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRs(
R5R3RfRROtflushRRR�Rr(RR((Rs9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt$test_context_manager_during_rollover�s

cs�tjdd���jd��j�|j�j���|j�j�WdQX|j�j��fd�}|jt	|�dS(NRisabc
cs��WdQXdS(N(((R(s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRs(
R5R3ROR>RRRfRR�Rr(RR((Rs9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt#test_context_manager_after_rollover	s

N(R%R&R`RR�R�RR$R&R,R.R1R2R4R5R6R7R<R=R?R@(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRPs$										
							ttest_TemporaryFilecBs)eZdZd�Zd�Zd�ZRS(sTest TemporaryFile().cCs)ytj�Wn|jd�nXdS(NR+(R5R+R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR�scCs}tj�}tjd|�}|jd�ytj|�Wn:tj�}|j�tj|�|j	d|�nXdS(NRR�R�(
R5R-R+RORR�RR
RNR(RRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyttest_has_no_name&s


cCsVtj�}|jd�|j�y|j�|j�Wn|jd�nXdS(Nsabc
RN(R5R+RORNR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyR7s


(R%R&R`R�RBR(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyRAs		cCstjt�dS(N(Rotrun_unittestttest_classes(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt	test_mainHst__main__(RR	((3R5R�R�RRUR�RR'twarningst
contextlibRattestRRotfilterwarningstRuntimeWarningR%RcRR�R�R�R�R�R�REtTestCaseR
RDR)R7R<RdR|R�tcontextmanagerR�R�R�R�R�R�R�RRR
RRAR*R+RE(((s9/usr/local/python-2.7/lib/python2.7/test/test_tempfile.pyt<module>sx
		
I
'
)


	#�

 
&
W
9
k
�
*	
© 2025 GrazzMean