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

name : test_fileio.pyc
�
?��cc@s3ddlmZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddlm
Z
mZmZmZddlmZmZmZdd	lmZdd
lmZdejfd��YZd
ejfd��YZd�Zedkr/e�ndS(i����(tunicode_literalsN(tarray(tproxy(twraps(tUserList(tTESTFNtcheck_warningstrun_unittesttmake_bad_fd(t
py3k_bytestcpython_onlytcheck_py3k_warnings(t
run_python(tFileIOt
AutoFileTestscBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zejejdkd�d��Zd�Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Z ed��Z!d�Z"ed��Z#ed ��Z$ed!��Z%RS("cCsttd�|_dS(Nuw(t_FileIORtf(tself((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pytsetUpscCs*|jr|jj�ntjt�dS(N(RtclosetostremoveR(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttearDowns	cCswt|j�}|jttd���|j|jj�|j��|jj�d|_|j	t
t|d�dS(Ni
utell(RRtwritetbytestrangetassertEqualttellRtNonetassertRaisestReferenceErrortgetattr(Rtp((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWeakRefss
	cCs|jjttd���|j|jj�d�|jjd�|j|jj�d�|jjd�|j|jj�d�|jjdd�|j|jj�d�|jjdd�|j|jj�d�|jjdd�|j|jj�d�dS(	Niii
iiii����i(RRRRRRtseek(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestSeekTell(scCsc|j}|j|jd�|j|jt�x-dD]%}|jttft||d�q6WdS(Nuwbumodeucloseduoops(umodeuclosed(	RRtmodetclosedtFalseRtAttributeErrort	TypeErrortsetattr(RRtattr((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestAttributes6s	
cCsw|jjd�|jj�tdd�}ttd�|_|jj|�}|jtdddg�|| �dS(	Nstbtxi
uriit
xxxxxxxxxx(RRRRRRtreadintoR(Rtatn((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestReadintoBs
cCs^ddg}|jj|�|jj�ttd�|_|jj�}|j|d�dS(Nt123t456urbt123456(Rt
writelinesRRRtreadR(Rtltbuf((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWritelinesListKs
cCsdtddg�}|jj|�|jj�ttd�|_|jj�}|j|d�dS(NR3R4urbR5(RRR6RRRR7R(RR8R9((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWritelinesUserListSs
cCs?|jt|jjdddg�|jt|jjd�dS(Niii(RR(RR6R(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWritelinesError[s"cCs�|jjd�|jj�ttd�|_|j|jjd�d�|jjd�|j|jj	d�d�|j|jj
d�ddg�dS(Ns
hi
bye
abcurishi
sbye
tabc(RRRRRRR7RR"treadlinet	readlines(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttest_none_args_s
cCs$t��|jjd�WdQXdS(Nu(RRR(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWriteUnicodehs
cCs�|jt|j�d|jj|jjf�|j`|jt|j�d|jj�|jjf�|jj�|jt|j�d�dS(Nu<_io.FileIO name=%r mode='%s'>u<_io.FileIO fd=%r mode='%s'>u<_io.FileIO [closed]>(RtreprRtnameR$tfilenoR(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestReprls	
cCs�|j}|j|j��|j|j�|jt|jd�|j�|j|j�t	t
d�}|jt|jd�|j|j�|j�|j|j�dS(Ni
uru(
RtassertFalsetisattyR%Rt
ValueErrorR7Rt
assertTrueRRR(R/(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
testErrorsus	

cCseddddddddd	d
ddg}tjjd
�rL|jd�n|jj�|j|jj�x0|D](}t|j|�}|j	t
|�qsW|j	t
|jj�|j	t
|jjtd��|j	t
|jj
�|j	t
|jj
d�|j	t
|jj�|j	t
|jjd�|j	t|jj�|j	t
|jjd�dS(Nufilenouisattyuseekableureadableuwritableureadureadallureadlineu	readlinesutellutruncateuflushuatheosiit(tsystplatformt
startswithRRRRIR%RRRHR/t	bytearrayR"RR(R6(Rtmethodst
methodnametmethod((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestMethods�s$

cCs^ytdd�Wn9tk
rL}|j|jd�|j|jd�nX|jd�dS(Nu.uriuShould have raised IOError(RtIOErrortassertNotEqualterrnoRtfilenametfail(Rte((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestOpendir�suntu&test only works on a POSIX-like systemcCsdtjdtj�}|jt��}t|d�WdQXtj|�|j|jj	t	j
�dS(Nu.ur(RtopentO_RDONLYRRTRRRt	exceptionRVtEISDIR(Rtfdtcm((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
testOpenDirFD�s

cst���fd��}|S(NcsZ|j}tj|j��z�||�Wdy|jj�Wntk
rTnXXdS(N(RRRRDRT(RR(tfunc(s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pytwrapper�s	
(R(RbRc((Rbs7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pytClosedFD�scst���fd��}|S(Ncs�|j}tj|j��zNy�||�Wn)tk
r[}|j|jtj�nX|jd�Wdy|jj�Wntk
r�nXXdS(NuShould have raised IOError(	RRRRDRTRRVtEBADFRX(RRRY(Rb(s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyRc�s	
(R(RbRc((Rbs7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pytClosedFDRaises�scCs|j�dS(N(R(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClose�scCs|jd�dS(NR0(R(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedWrite�scCs|jd�dS(Ni(R"(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedSeek�scCs|j�dS(N(R(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedTell�scCs|jd�dS(Ni(ttruncate(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedTruncate�scCs|j�dS(N(tseekable(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedSeekable�scCs|j�dS(N(treadable(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadable�scCs|j�dS(N(twritable(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedWritable�scCs|j�dS(N(RD(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedFileno�scCs|j|j�t�dS(N(RRGR&(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedIsatty�scCsTy|jj�Wntk
r$nXttd�|_tj|jj��|jS(Nur(RRRTRRRRD(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
ReopenForRead�s
cCs|j�}|jd�dS(Ni(RuR7(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadscCs|j�}|j�dS(N(Rutreadall(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadall	scCs,|j�}tdd�}|j|�dS(NR,R-i
R.(RuRR/(RRR0((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadintos(&t__name__t
__module__RRR!R#R+R2R:R;R<R@RARERJRSRZtunittesttskipIfRRCRaRdRfRgRhRiRjRlRnRpRrRsRtRuRvRxRy(((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyRs@																			$
				tOtherFileTestscBs�eZd�Zejejdkd�d��Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
ed
��Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�ZRS(cCs@z+ttd�}|j|j�t�|j|j�t�|j|j�t�|j�ttd�}|j|j�t�|j|j�t�|j|j�t�|j�ttd�}|j|j�t�|j|j�t�|j|j�t�|j|j	�t�|j�Wdt
jt�XdS(Nuwurua+(RRRRoR&RqtTrueRmRRGRtunlink(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt	testAbless$

uwin32uno ttys on WindowscCs�ytdd�}Wntk
r3|jd�n�X|j|j�t�|j|j�t�tj	dkr�dtj	kr�tj	j
d�r�|j|j�t�n|j|j�t�|j
�dS(	Nu/dev/ttyuau
need /dev/ttyudarwinubsdusunosuaix(usunosuaix(RtEnvironmentErrortskipTestRRoR&RqRRLRMRNRmRGR(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestAblesOnTTY-s
cCsWxPdD]H}ytt|�}Wntk
r3qX|j�|jd|�qWdS(NuuaUuwU+urwurtu%r is an invalid file mode(uuaUuwU+urwurt(RRRHRRX(RR$R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestInvalidModeStringsAs


c
Cs�zlxeddddddddddddgD]9}tt|d
��}|j|j|d�WdQXq.WWdtjjt�r�tjt�nXdS(Nuwuwbuwb+urb+uw+buauabuab+ua+bururbur+bii(uwuwb(uwbuwb(uwb+urb+(uw+burb+(uauab(uabuab(uab+uab+(ua+buab+(ururb(urburb(urb+urb+(ur+burb+(RRRR$RtpathtexistsR�(RtmodesR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestModeStringsLs		%cCs0ttt�d�}|j�tjt�dS(Nuw(RtstrRRRR�(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestUnicodeOpen[s
cCs�ytjd�}Wn"tk
r7|jdt�nXt|d�}zI|jd�|j�ttd��}|j|j	�d�WdQXWdt
jt�XdS(Nuasciiucould not encode %r to asciiuwR=urb(RtencodetUnicodeEncodeErrorR�RRRR[RR7RR�(RtfnR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
testBytesOpenas


 cCs?d}|jtt|d�|jtt|jd�d�dS(Nufoobaruwuascii(RR(RR�(Rtfn_with_NUL((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestConstructorHandlesNULCharspscCsd|jttd�|jttt��tjdkr`ddl}|jt|j	t��ndS(Ni����uwin32i����(
RRHRtOSErrorRRLRMtmsvcrtRTt
get_osfhandle(RR�((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
testInvalidFdus
cCsDddl}|jtt|jd�|jtt|jd�dS(Ni����i(t	_testcapiRR(RtINT_MAXtINT_MIN(RR�((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestInvalidFd_overflow|scCs�d}ytt|�}Wnatk
r|}|jddkr�t|�}t|ksb||kry|jd|�qyq�nX|j�|jd|�dS(Nuqwertyiu&bad error message for invalid mode: %suno error for invalid mode: %s(RRRHtargsR�RXR(Rtbad_modeRtmsgts((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestBadModeArgument�s
cCs�ttd�}|jtttd����|j|j�d�|jd�|j|j�d�|j|j	dt
j�d�|jd�|j|j�d�|j|j	dt
j�d�|j�dS(Nuwi
iii(
RRRRRORRRRkR"RtSEEK_ENDR(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestTruncate�s

cs/�fd�}z|�Wdtjt�XdS(Ncsttd�}|jttd���|j�ttd�}|jd�}|ttd��kr|�jd|�n|j�dkr��jd|j��n|j	�|j�dkr��jd|j��n|j�t
jjt�}|dkr�jd|�ndS(	Nuwiur+iu(Read on file opened for update failed %ruFile pos after read wrong %du!File pos after ftruncate wrong %du"File size after ftruncate wrong %d(
RRRRRRR7RXRRkRR�tgetsize(Rtdatatsize(R(s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt	bug801631�s 


(RR�R(RR�((Rs7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestTruncateOnWindows�scCs�z�ttd�}|jd�|j�ttd�}|jd�|j�ttd�}|j�}|j�|j|d�Wdytjt�WnnXXdS(Nuwbtspamuabteggsurbtspameggs(R[RRRR7RRR�(RRtd((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt
testAppend�s




cCs|jttddd�dS(Nu1i(RR(R(R((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestInvalidInit�sc	Cs~tdt��i}|j|jg�|jttg�|j|jg�|jttdd�|j|jg�WdQXdS(Ntquietu/some/invalid/nameurt(RRRtwarningsRR(RRH(Rtw((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestWarnings�scCs�d}yt|��WdQXWnttfk
r6nXttj�}d|d<tdd|d|�\}}d|kr�d|kp�d	|kr�|jd
|�ndS(Nu�.txttCtLC_CTYPEu-cuimport _io; _io.FileIO(%r)tenvuUnicodeEncodeErroru,IOError: [Errno 2] No such file or directoryu$IOError: [Errno 22] Invalid argumentuBad output: %r(RR�RTtdictRtenvironRRX(RRWR�t_tout((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttest_surrogates�s



csndtfd��Y�dtf��fd��Y�tjttj�}|j��|�tj|�dS(NtMyExceptioncBseZRS((RzR{(((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyR��stMyFileIOcseZ��fd�ZRS(cs4|dkr�d��nt�|�j||�S(Nunameublocked setting name(tsupert__setattr__(RRCtvalue(R�R�(s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyR��s(RzR{R�((R�R�(s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyR��s(t	ExceptionRRR[t__file__R\RR(RR_((R�R�s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyttestUnclosedFDOnException�s
(RzR{R�R|R}RLRMR�R�R�R�R�R�R�R
R�R�R�R�R�R�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyR~s"	$													cCs;zttt�Wdtjjt�r6tjt�nXdS(N(RRR~RR�R�RR�(((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt	test_main�su__main__(t
__future__RRLRRVR|RtweakrefRt	functoolsRRttest.test_supportRRRRR	RR
Rttest.script_helperRt_ioR
RtTestCaseRR~R�Rz(((s7/usr/local/python-2.7/lib/python2.7/test/test_fileio.pyt<module>s$"��		
© 2025 GrazzMean