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

name : test_zipfile.pyo
�
@��cc@s�yddlZWnek
r)eZnXddlZddlZddlZddlZddlZddlZddl	Z	ddl
m
Z
ddlmZddl
mZm
Z
mZddl	mZddlmZddlmZmZmZmZmZmZmZmZmZyeje�Wneefk
rJeZnXedZ ed	Z!d
Z"ddfd
dfddfddfgZ#d�Z$de	j%fd��YZ&de	j%fd��YZ'de	j%fd��YZ(de	j%fd��YZ)de	j%fd��YZ*de	j%fd��YZ+eed �d!e	j%fd"��Y�Z,d#e	j%fd$��YZ-d%e	j%fd&��YZ.d'e	j%fd(��YZ/d)�Z0e1d*kr�e0�ndS(+i����N(tStringIO(t
TemporaryFile(trandinttrandomtgetrandbits(t
skipUnless(t
script_helper(	tTESTFNtTESTFN_UNICODEtTESTFN_ENCODINGtrun_unittesttfindfiletunlinktrmtreetcheck_warningstcaptured_stdoutt2tdi�t	_ziptest1t
1q2w3e4r5tsziptest2dir/_ziptest2t
qawsedrftgs!ziptest2dir/ziptest3dir/_ziptest3t
azsxdcfvgbs-ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3t
6y7u8i9o0pcCs+ttjdd|td|�f��S(Ns%0*xii(tbytest	bytearraytfromhexR(tsize((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytgetrandbytes(stTestsWithSourceFilecBsNeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%eed�d#��Z&d$�Z'd%�Z(d&�Z)d'�Z*ee+d(�d)��Z,d*�Z-d+�Z.d,�Z/d-�Z0d.�Z1d/�Z2d0�Z3d1�Z4RS(2cCstgtt�D]}d|t�f^q
|_dj|j�d|_ttd��}|j|j�WdQXdS(Ns&Zipfile test line %d. random float: %fs
twb(	txrangetFIXEDTEST_SIZERtline_gentjointdatatopenRtwrite(tselftitfp((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytsetUp,s
,cCsUtj|d|��:}|jtd�|jtt�|jd|j�WdQXdS(Ntwsanother.nametstrfile(tzipfiletZipFileR$RtwritestrR"(R%tftcompressiontzipfp((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytmake_test_archive5sc	Cs�|j||�tj|d|���}|j|jt�|j�|j|jd�|j�|j|jd�|j�t�}tj	}z|t_	|j
�Wd|t_	X|j�}|j�}|jt
|�d�|jd|d�|jd|d�|jd|d�|d	j�\}}	}
}|j|d�|jtj|	d
��|jtj|
d��|j|tt
|j���|j�}|jt
|�d�|jt|�|jd|�|jd|�|j�}
g|
D]}|j^q�}|jt
|�d�|jt|�|jd|�|jd|�x*|
D]"}|j|jt
|j��q`WxUtddfD]D}|j|�}|j|j|�|j|jt
|j��q�W|j�WdQXdS(
Ntrsanother.nameR*is	File NameitModifiedtSizeis%Y-%m-%ds%H:%M:%Si(R1R+R,tassertEqualtreadRR"Rtsyststdouttprintdirtgetvaluet
splitlinestlentassertIntsplitt
assertTruettimetstrptimetstrtnamelisttinfolisttfilenamet	file_sizetgetinfottestzip(R%R.R/R0R'R8t	directorytlinestfntdatettime_RtnamestinfosR&tnmtinfo((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_test<sP			

  cCs7x0tt�t�fD]}|j|tj�qWdS(N(tTESTFN2RRRRR+t
ZIP_STORED(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_storedvsc	Cs|j||�tj|d|���}g}|jt��:}x0trr|jd�}|sbPn|j|�qCWWdQXg}|jd��:}x0tr�|jd�}|s�Pn|j|�q�WWdQX|jdj	|�|j
�|jdj	|�|j
�WdQXdS(NR2isanother.namet(R1R+R,R#RtTrueR6tappendR5R!R"(	R%R.R/R0tzipdata1tzipopen1t	read_datatzipdata2tzipopen2((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
zip_open_testzs$		cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR^R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_open_stored�sc
CsItjtdtj��]}|jdd�tdtf��|jdd�WdQX|j|j�dgd�WdQXtjtd���}|j	�}d}x6|D].}|j
|��}||j�7}WdQXq�W|j|dkp�|d	k�d}x!|D]}||j|�7}qW|j|dkp;|d	k�WdQXdS(
NR)tnametfooRVtbariR2tfoobartbarfoo(
R+R,RSRTR-RtUserWarningR5RCRDR#R6R?(R%R0ROR"RQR.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_open_via_zip_info�s #

cCs�|j||�tj|d|��}}g}|jt��C}x9tr{|jtdd��}|skPn|j|�qCWWdQX|j	dj
|�|j�WdQXdS(NR2iiRV(R1R+R,R#RRWR6RRXR5R!R"(R%R.R/R0RYRZR[((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_random_open_test�s	cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRgR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_random_open_stored�scCs�t�}ddd}tj|dtj��}|jt|�WdQXd}tj|d��=}|jtd��"}x|D]}||7}qWWdQXWdQX|j||jdd	��dS(
Nsa
iiR)RVR2trUs
s
(	RR+R,RTR-RR#R5treplace(R%R.R"R0tdata2tzipopentline((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_universal_readaheads�s	
c
Cs�|j||�tj|d��u}|jt��]}d}xMtr�|j�}|s\Pn||7}|jd�}|sPn||7}q@WWdQXWdQX|j||j	�dS(NR2RVid(
R1R+R,R#RRWtreadlineR6R5R"(R%R.R/R0RlR"R6((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_readline_read_test�s	
c
Cs{|j||�tj|d��S}|jt��;}x1|jD]&}|j�}|j||d�qAWWdQXWdQXdS(NR2s
(R1R+R,R#RR RoR5(R%R.R/R0RlRmtlinedata((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_readline_test�sc
Cs�|j||�tj|d��b}|jt��J}|j�}x4t|j|�D] \}}|j||d�qVWWdQXWdQXdS(NR2s
(	R1R+R,R#Rt	readlinestzipR R5(R%R.R/R0tzotziplinesRmtzipline((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_readlines_test�sc	Cso|j||�tj|d��G}x=t|j|jt��D] \}}|j||d�qAWWdQXdS(NR2s
(R1R+R,RtR R#RR5(R%R.R/R0RmRw((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_iterlines_test�s(cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRpR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readline_read_stored�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRrR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readline_storedscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRxR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readlines_storedscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRyR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_iterlines_stored	ss
requires zlibcCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRRR+tZIP_DEFLATED(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
test_deflated
scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR^R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_open_deflatedscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRgR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_random_open_deflatedscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRpR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readline_read_deflatedscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRrR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readline_deflated"scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRxR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_readlines_deflated'scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRyR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_iterlines_deflated,scCs�tjtdtj��}|jdd�WdQXtjtdtj��Q}|jd��9}|j|jd�d�|j|jd�d�WdQXWdQXdS(	s>Check for cases where compressed data is larger than original.R)R*t12NR2it1R(R+R,RSR~R-R#R5R6(R%R0topenobj((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_low_compression1scCsotjtdtj��}|jtd�WdQXtjtdtj�� }|j|j�dg�WdQXdS(NR)s	/absoluteR2tabsolute(R+R,RSRTR$RR5RC(R%R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_absolute_arcnames>sc	Cs�tjtdtj��}|jtt�WdQXtjtdtj��6}|jd|j�|j|j	�tdg�WdQXdS(s&Test appending to an existing zipfile.R)NtaR*(
R+R,RSRTR$RR-R"R5RC(R%R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_append_to_zip_fileEs
cCs�dd}ttd��}|j|�WdQXtjtdtj��}|jtt�WdQXttd��j}|jt|��tj|d��<}|j	|j
�tg�|j	|jt�|j�WdQXWdQXttd��2}|j	|jt|��|�|j�}WdQXt
j|��T}tj|��<}|j	|j
�tg�|j	|jt�|j�WdQXWdQXdS(s9Test appending to an existing file that is not a zipfile.sI am not a ZipFile!i
RNR�trbR2(R#RSR$R+R,RTRtseekR<R5RCR6R"tiotBytesIO(R%R"R.R0tzipfiledatatbio((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_append_to_non_zip_fileNs"
(cCs�tj��D}tj|dtj��}|jtt�WdQX|j�}WdQXdd}tt	d��!}|j|�|j|�WdQXtjt	��<}|j
|j�tg�|j
|jt�|j
�WdQXdS(NR)sI am not a ZipFile!i
R(R�R�R+R,RTR$RR:R#RSR5RCR6R"(R%R�R0R�R"R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_concatenated_zip_filees

cCs�tj��D}tj|dtj��}|jtt�WdQX|j�}WdQXdd}tt	d��!}|j|�|j|�WdQXtjt	d��3}|j
|j�tg�|jd|j
�WdQXtt	d��2}|j
|jt|��|�|j�}WdQXtj|��s}tj|��[}|j
|j�tdg�|j
|jt�|j
�|j
|jd�|j
�WdQXWdQXdS(NR)sI am not a ZipFile!i@BRR�R*R�(R�R�R+R,RTR$RR:R#RSR5RCR-R"R6R<(R%R�R0R�R"R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt$test_append_to_concatenated_zip_filess&

c	Cs�tjtdtj��}|jtt�WdQXttd��}|jd�WdQXtjtd��}|j|tj�WdQXdS(NR)R�s
R2(R+R,RSRTR$RR#tassertIsInstance(R%R0R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_ignores_newline_at_end�sc	Cs�tjtdtj�� }d|_|jtt�WdQXttd��}|jd�WdQXtjtd��-}|j|tj�|j	|jd�WdQXdS(NR)sthis is a commentR�sabcdef
R2(
R+R,RSRTtcommentR$RR#R�R5(R%R0R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt)test_ignores_stuff_appended_past_comments�s	cCsctjtd��K}|jt�ttd��&}|j|jt�|j��WdQXWdQXdS(s`Check that calling ZipFile.write without arcname specified
        produces the expected result.R)R2N(R+R,RSR$RR#R5R6(R%R0tfid((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_default_name�s
cCs�tjtd��}}|jtdtj�|jtdtj�|jd�}|jd�}|j|j	tj�|j|j	tj�WdQXdS(sUCheck that files within a Zip archive can have different
        compression options.R)tstoremet	deflatemeN(
R+R,RSR$RRTR~RGR5t
compress_type(R%R0tsinfotdinfo((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_per_file_compression�sc	Csftjtdd��}|jdd�WdQXtjtdd��}|jt|jt�WdQXdS(s]Check that trying to call write() on a readonly ZipFile object
        raises a RuntimeError.tmodeR)ssomefile.txttbogusNR2(R+R,RSR-tassertRaisestRuntimeErrorR$R(R%R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_to_readonly�sc
Cs$tjtdtj��.}x$tD]\}}|j||�q"WWdQXtjtd���}x�tD]�\}}|j|�}tjj	tj
�|�}tjj|�}|j||�t
|d��}|j||j��WdQXtj|�qdWWdQXttjj	tj
�d��dS(NR)R2R�tziptest2dir(R+R,RSRTtSMALL_TEST_DATAR-textracttostpathR!tgetcwdtnormpathR5R#R6tremoveR
(R%R0tfpathtfdatatwrittenfiletcorrectfileR�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract�sc
Cs�tjtdtj��.}x$tD]\}}|j||�q"WWdQXtjtd��~}|j�xjtD]b\}}tjj	tj
�|�}t|d��}|j||j
��WdQXtj|�qnWWdQXttjj	tj
�d��dS(NR)R2R�R�(R+R,RSRTR�R-t
extractallR�R�R!R�R#R5R6R�R
(R%R0R�R�toutfileR�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract_all�s
cCsK|jtjj|��t|d��}|j|j�|�WdQXdS(NR�(R?R�R�tisfileR#R5R6(R%REtcontentR.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
check_file�ss1No Unicode filesystem semantics on this platform.c	Cs�dtjjt�g}d}tjtdtj��(}x|D]}|j||�q@WWdQXtjtd���}xw|D]o}|j	|�}tjj
tj�|�}tjj|�}|j
||�|j||�tj|�q|WWdQXdS(Nufoo.txtsTest for unicode filenameR)R2(R�R�tbasenameRR+R,RSRTR-R�R!R�R�R5R�R�(R%tfnamesR�R0tfnameR�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract_unicode_filenames�s

c
Cs�d1d2d3d4d5d6d7d8g}tjjd
kry|jd9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKg�n|jdLdMdNg�xI|D]A\}}d%|j�}tjtd&tj��5}tj	�}||_
dO|_|j||�WdQX|j
tjd)�}tjjd*d+d,�}tjj||jd)��}tjtd-��3}|j||�}	|j|	|d.d/|�WdQX|j||�td*�tjtd-��}|j|�WdQX|j||�td*�tjjtj�|jd)��}tjtd-��0}|j|�}	|j|	|d.d/|�WdQX|j||�t|jd)�d0�tjtd-��}|j�WdQX|j||�t|jd)�d0�tjt�q�WdS(PNs
../foo/barsfoo/bars
foo/../bars
foo/../../bars
foo/bar/..s./../foo/bars/foo/bars/foo/../bars/foo/../../bars\s
..\foo\bars..\/foo\/barsfoo/\..\/barsfoo\/../\bars	C:foo/bars
C:/foo/barsC://foo/bars
C:\foo\bars//conky/mountpoint/foo/bars\\conky\mountpoint\foo\bars///conky/mountpoint/foo/barsconky/mountpoint/foo/bars\\\conky\mountpoint\foo\bars//conky//mountpoint/foo/bars\\conky\\mountpoint\foo\bars//?/C:/foo/bars\\?\C:\foo\barsC:/../C:/foo/bars
C_/foo/barsa:b\c<d>e|f"g?h*isb/c_d_e_f_g_h_is../../foo../../ba..rs	foo/ba..rs	//foo/barsfoo../ba..rs
foo/..\barRcR)i�it/ttargettsubdirtsubsubR2tmsgs
extract %ri(s
../foo/barsfoo/bar(s
foo/../barsfoo/bar(s
foo/../../barsfoo/bar(s
foo/bar/..sfoo/bar(s./../foo/barsfoo/bar(s/foo/barsfoo/bar(s/foo/../barsfoo/bar(s/foo/../../barsfoo/bar(s
..\foo\barsfoo/bar(s..\/foo\/barsfoo/bar(sfoo/\..\/barsfoo/bar(sfoo\/../\barsfoo/bar(s	C:foo/barsfoo/bar(s
C:/foo/barsfoo/bar(sC://foo/barsfoo/bar(s
C:\foo\barsfoo/bar(s//conky/mountpoint/foo/barsfoo/bar(s\\conky\mountpoint\foo\barsfoo/bar(s///conky/mountpoint/foo/barsconky/mountpoint/foo/bar(s\\\conky\mountpoint\foo\barsconky/mountpoint/foo/bar(s//conky//mountpoint/foo/barsconky/mountpoint/foo/bar(s\\conky\\mountpoint\foo\barsconky/mountpoint/foo/bar(s//?/C:/foo/barsfoo/bar(s\\?\C:\foo\barsfoo/bar(sC:/../C:/foo/bars
C_/foo/bar(sa:b\c<d>e|f"g?h*isb/c_d_e_f_g_h_i(s../../foo../../ba..rs	foo/ba..r(s	//foo/barsfoo/bar(s../../foo../../ba..rsfoo../ba..r(s
foo/..\bars
foo/..\bari�(R�R�tseptextendtencodeR+R,RSRTtZipInfoREt
external_attrR-RjR!R>R�R5R�R
R�R�R�(
R%t	hacknamestarcnamet	fixednameR�R0tzinfot
targetpathR�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract_hackers_arcnames�s�	

		

$cCs�tjtd�}|jdddtj�trM|jdddtj�n|jd�}|j|j	tj�tr�|jd�}|j|j	tj�ndS(NR)sa.txtshello worldR�sb.txt(
R+R,RSR-RTtzlibR~RGR5R�(R%R0RQ((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_writestr_compressionJscCsQ|j||�tj|d��)}|jd�}|j|jd�WdQXdS(NR2R*i�ii�(R1R+R,RGR5R�(R%R.R/R0R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzip_test_writestr_permissionsXscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_writestr_permissionsascCs�tjtd��G}x=tD]5\}}|j||�|j|jdk	d�qWWdQX|j|jdkd�tjtd�� }|j|jdk	d�WdQX|j|jdkd�dS(s8Check that the zipfile is closed after the 'with' block.R)szipfp is not openNszipfp is not closedR2(R+R,RSR�R-R?R'tNone(R%R0R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
test_closees#cCs�tjtd��.}x$tD]\}}|j||�qWWdQXy+tjtd��}tj��WdQXWn-tjk
r�|j|jdkd�nXdS(sWCheck that the zipfile is closed if an exception is raised in the
        'with' block.R)NR2szipfp is not closed(	R+R,RSR�R-t
BadZipfileR?R'R�(R%R0R�R�tzipfp2((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_close_on_exceptionqscCsEtjtd�tjtd��}|jt|jt�WdQXdS(NiR)(ii(	R�tutimeRR+R,RSR�t
ValueErrorR$(R%R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_add_file_before_1980~scCstt�tt�dS(N(RRRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttearDown�s
(5t__name__t
__module__R(R1RRRUR^R_RfRgRhRnRpRrRxRyRzR{R|R}RR�RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RR�R�R�R�R�R�R�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR+s`				:									
	
					
								
							Q						
	tTestZip64InSmallFilescBs�eZd�Zd�Zd�Zd�Zd�Zd�Zee	d�d��Z
d�Zd	�Zd
�Z
d�Zd�ZRS(
cCs�tj|_tj|_dt_dt_d�tdt�D�}dj|�|_t	t
d��}|j|j�WdQXdS(Ni�i	css|]}d|VqdS(sTest of zipfile line %d.N((t.0R&((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pys	<genexpr>�sis
R(R+tZIP64_LIMITt_limittZIP_FILECOUNT_LIMITt_filecount_limittrangeRR!R"R#RR$(R%R R'((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR(�s		c	Cs>tj|d|��#}|jtj|jtd�WdQXdS(NR)sanother.name(R+R,R�tLargeZipFileR$R(R%R.R/R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytlarge_file_exception_test�sc	CsAtj|d|��&}|jtj|jd|j�WdQXdS(NR)sanother.name(R+R,R�R�R-R"(R%R.R/R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytlarge_file_exception_test2�scCsJxCtt�t�fD],}|j|tj�|j|tj�qWdS(N(RSRRR�R+RTR�(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_large_file_exception�sc
Cs9tj|d|dt��:}|jtd�|jtt�|jd|j�WdQXtj|d|���}|j|jt�|j�|j|jd�|j�|j|jd�|j�t	�}t
j}z|t
_|j�Wd|t
_X|j
�}|j�}|jt|�d�|jd|d�|jd	|d�|jd
|d�|dj�\}}	}
}|j|d�|jtj|	d��|jtj|
d
��|j|tt|j���|j�}|jt|�d�|jt|�|jd|�|jd|�|j�}
g|
D]}|j^qE}|jt|�d�|jt|�|jd|�|jd|�x*|
D]"}|j|jt|j��q�WxUtddfD]D}|j|�}|j|j|�|j|jt|j��q�W|j�WdQXdS(NR)t
allowZip64sanother.nameR*R2is	File NameiR3R4is%Y-%m-%ds%H:%M:%Si(R+R,RWR$RR-R"R5R6RR7R8R9R:R;R<R=R>R?R@RARBRCRDRERFRGRH(R%R.R/R0R'R8RIRJRKRLRMRRNROR&RPRQ((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRR�sV			

  cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRRR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRU�ss
requires zlibcCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRRR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�scCsutjtdtjdt��}|jtd�WdQXtjtdtj�� }|j|j�dg�WdQXdS(NR)R�s	/absoluteR2R�(	R+R,RSRTRWR$RR5RC(R%R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��s
cCstjtdddt�}d|_d}x4t|�D]&}|jd|d|dd	�q7W|jt|j	��|�|j
�tjtdd
�}|jt|j	��|�xCt|�D]5}|jd|�}|j|d|dd	�q�W|j
�dS(NR�R)R�idisfoo%08ds%dii9R2(R+R,RRWtdebugR�R-R5R<RCtcloseR6(R%tzipftnumfilesR&tzipf2R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_too_many_files�s	$
 cCs�tjtdddt�}d|_d}x4t|�D]&}|jd|d|dd	�q7W|jt|j	��|�|j
tj��|jd|d
�WdQX|jt|j	��|�|j�tjtdddt�}d|_|jt|j	��|�|j
tj��|jd|d
�WdQX|jt|j	��|�|j�tjtdddt
�}d|_|jt|j	��|�d}x7t||�D]&}|jd|d|dd	�q�W|jt|j	��|�|j�tjtdd
�}|jt|j	��|�xCt|�D]5}|jd|�}|j|d|dd	�qGW|j�dS(NR�R)R�idi	sfoo%08ds%dii9RVR�iR2(R+R,RtFalseR�R�R-R5R<RCR�R�R�RWR6(R%R�R�R&t	numfiles2R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_too_many_files_appends>	$
	
	$
 c
Cs�tjtddt��}|jd|j�WdQXtjtddt��}|jd�}|j}WdQXtjtddt��}|jd|j�WdQXtjtddt��)}|jd�}|j|j|�WdQXdS(NR)R�R*R2R�tstrfile2(	R+R,RSRWR-R"RGtextraR5(R%R0R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_append/scCs0|jt_|jt_tt�tt�dS(N(R�R+R�R�R�RRRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�=s
(R�R�R(R�R�R�RRRURR�RR�R�R�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��s					>				$	tPyZipFileTestscBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs�tj|tj�s%|jd�ntjj|d�}y-tj|tjtjB�}tj	|�Wnt
k
r�|jd�nXt|�dS(Ns/requires write access to the installed locationstest_zipfile.try(R�taccesstW_OKtskipTestR�R!R#tO_WRONLYtO_CREATR�t	ExceptionR(R%R�REtfd((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytrequiresWriteAccessEs
c	Cs�|jtjjt��tjt�d���}t}|jd�sU|jd�rb|d }n|j	|�tjj
|�}|j||j��|j
|d|j�kp�|d|j�k�WdQXtjt�d���}t}|jd	�r
|d }n|j	|d�ddtjj
|�f}|j||j��|j
|d|j�kp{|d|j�k�WdQXdS(
NR)s.pycs.pyoi����totcttestpackages%s/%s(s.pycs.pyo(R�R�R�tdirnamet__file__R+t	PyZipFileRtendswithtwritepyR�tassertNotInRCR?(R%R0RKtbn((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_pyfilePs&


cCs�ddl}tjj|j�}|j|�tjt�d��^}|j	|�|j
�}|jd|kpzd|k�|jd|kp�d|k�WdQXdS(Ni����R)semail/__init__.pyosemail/__init__.pycsemail/mime/text.pyosemail/mime/text.pyc(temailR�R�RRR�R+RRRRCR?(R%R
t
packagedirR0RN((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_python_packagejs


cCs;tjt�zttjjtd�d��}|jd�WdQXttjjtd�d��}|jd�WdQXttjjtd�d��}|jd�WdQXtjt	�d�}|j
t�|j�}|jd|kp�d	|k�|jd
|kpd|k�|j
d|�Wdtt�XdS(Nsmod1.pyR)s
print(42)
smod2.pysprint(42 * 42)
smod2.txtsbla bla bla
smod1.pycsmod1.pyosmod2.pycsmod2.pyo(R�tmkdirRSR#R�R!R$R+RRRRCR?RR
(R%R'R0RN((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_python_directoryzs
!!!
c
Csjtjt�d��O}ttd��}|jd�WdQX|jt|jt�t	j
t�WdQXdS(NR)s!most definitely not a python file(R+RRR#RR$R�R�RR�R�(R%R0R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_non_pyfile�s
(R�R�R�R	RRR(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�Ds
				t
OtherTestscBs�eZidej6dej6Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zeed�d��Zd�Zd�Z eed�d��Z!d�Z"d�Z#eed�d��Z$d �Z%d!�Z&d"�Z'd#�Z(d$�Z)RS(%sxPK ��;:r��afilehello,AworldPK ��;:r���afilePK3/s|PKn}=FAKEnafile�H���W(�/�Iɠ=PKn}=FAKEn�afilePK33cCs�tjtd��D}|jdd�|jdd�|j|j�djt�WdQXtjtd��;}|j|j	djd�|j|j	djd�WdQXdS(	NR)ufoo.txtsTest for unicode filenameuö.txtiR2sfoo.txti(
R+R,RR-R�RDREtunicodeR5tfilelist(R%tzf((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_unicode_filenames�s#cCs�tjjt�r"tjt�nd}d}y/tjtd��}|j||�WdQXWntk
r}|j	d�nX|j
tjjt��tjtd�� }|j|j|�|�WdQXdS(Nstestfile.txts#hello, world. this is some content.R�s1Could not append data to a non-existent zip file.R2(
R�R�texistsRRR+R,R-tIOErrortfailR?R5R6(R%RER�R((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt(test_create_non_existent_file_for_append�s
cCsSttd��}|jd�WdQXytjt�}Wntjk
rNnXdS(NR)sthis is not a legal zip file
(R#RR$R+R,R�(R%R'R((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_close_erroneous_file�scCs�ttd��}|jd�WdQXtjt�}|j|�ttd��$}tj|�}|j|�WdQXt�}|jd�tj|�}|j|�|jdd�tj|�}|j|�dS(s;Check that is_zipfile() correctly identifies non-zip files.R)sthis is not a legal zip file
NR�i(	R#RR$R+t
is_zipfiletassertFalseR?RR�(R%R'tchk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_is_zip_erroneous_file�s
	
cCs�tj�}tj|dd��}|jdd�WdQX|j�}xFtt|��D]2}tj|| �}|jtj	tj|�qYWdS(sCCheck that zipfiles with missing bytes at the end raise BadZipFile.R�R)sfoo.txtsO, for a Muse of Fire!N(
R�R�R+R,R-R:R�R<R�R�(R%R'R�R�tN((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_damaged_zipfile�scCs�tjtdd��}|jdd�WdQXtjt�}|j|�ttd��?}tj|�}|j|�|jdd�|j�}WdQXt	�}|j
|�tj|�}|j|�|jdd�tj|�}|j|�dS(s7Check that is_zipfile() correctly identifies zip files.R�R)sfoo.txtsO, for a Muse of Fire!NR�i(R+R,RR-RR?R#R�R6RR$(R%R�RR'tzip_contents((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_is_zip_valid_file�s 

	

cCs|jttjt�dS(N(R�RR+R,R(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt%test_non_existent_file_raises_IOErrorscCssttd��}WdQX|jtjtjt�ttd��}|jd�WdQX|jtjtjt�dS(NR)s
short file(R#RR�R+R�R,R$(R%R.R'((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt!test_empty_file_raises_BadZipFile sc	Cs�t�}tj|dd��}|jdd�WdQX|jt|jd�|jt|jd�|jt|j�|jt|jdd�tt	d��*}|j
d�|jt|j
t	�WdQXdS(	s?Verify that testzip() doesn't swallow inappropriate exceptions.R�R)sfoo.txtsO, for a Muse of Fire!Ns	bogus.txtR�szipfile test data(RR+R,R-R�R�R6R#RHRR$(R%R"R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt#test_closed_zip_raises_RuntimeError)s	
cCs|jttjtd�dS(s>Check that bad modes passed to ZipFile constructor are caught.tqN(R�R�R+R,R(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_bad_constructor_mode;sc
Csvtjtdd��}|jdd�WdQXtjtdd��-}|jd�|jt|jdd�WdQXdS(s7Check that bad modes passed to ZipFile.open are caught.R�R)sfoo.txtsO, for a Muse of Fire!NR2R%(R+R,RR-R6R�R�R#(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_bad_open_mode?s

cCs�tjtdd��u}|jdd�|jd��M}x-tt�D]}|j|jd�d�qGW|j|j�d�WdQXWdQXdS(ssCheck that calling read(0) on a ZipExtFile object returns an empty
        string and doesn't advance file pointer.R�R)sfoo.txtsO, for a Muse of Fire!iRVN(	R+R,RR-R#RRR5R6(R%R�R.R&((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
test_read0Isc	Cs;tjtdd�� }|jt|jdd�WdQXdS(sqCheck that attempting to call open() for an item that doesn't
        exist in the archive raises a RuntimeError.R�R)sfoo.txtR2N(R+R,RR�tKeyErrorR#(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_open_non_existent_itemUscCs |jttjtdd�dS(sMCheck that bad compression methods passed to ZipFile.open are
        caught.R)i����N(R�R�R+R,R(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_bad_compression_mode[scCsDd}tjtj|�d��}|jt|jd�WdQXdS(NsfPK.�C�@xPK..�C�@�xPK/!R2tx(R+R,R�R�R�tNotImplementedErrorR#(R%R"R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_unsupported_compression`scCsKtjtdd��0}|jdd�|j|j�dg�WdQXdS(sLCheck that a filename containing a null byte is properly
        terminated.R�R)sfoo.txtqqqsO, for a Muse of Fire!sfoo.txtN(R+R,RR-R5RC(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_null_byte_in_filenamekscCsP|jtjd�|jtjd�|jtjd�|jtjd�dS(sACheck that ZIP internal structure sizes are calculated correctly.ii.i8iN(R5R+tsizeEndCentDirtsizeCentralDirtsizeEndCentDir64tsizeEndCentDir64Locator(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_struct_sizesrscCstjtdd��*}|j|jd�|jdd�WdQXtjtdd��}|j|jd�WdQXd}tjtdd�� }||_|jdd�WdQXtjtdd��}|j|j|�WdQXdjgtd�D]}d|dd
^q��}tjtdd�� }||_|jdd�WdQXtjtdd��}|j|j|�WdQXtjtdd��=}tdt	f��|d|_WdQX|jdd�WdQXtjtdd��}|j|j|�WdQXdS(s8Check that comments on the archive are handled properly.R�R)RVsfoo.txtsO, for a Muse of Fire!NR2s9Bravely taking to his feet, he beat a very brave retreat.iis%dii
toopsii��(
R+R,RR5R�R-R!RRRe(R%R�R�R&tcomment2((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
test_commentsys.	4	cCsltjtdtj�� }|j|j�d|_WdQXtjtd��}|j|jd�WdQXdS(NR�sthis is a commentR2(R+R,RRTRRR�R5(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt$test_change_comment_in_empty_archive�s
c	Cs�tjtdtj��}|jdd�WdQXtjtdtj�� }|j|j�d|_WdQXtjtd��}|j|jd�WdQXdS(NR)sfoo.txtsO, for a Muse of Fire!R�sthis is a commentR2(	R+R,RRTR-R?RR�R5(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt'test_change_comment_in_nonempty_archive�scCsN|j|}tjtj|�dd��}|jd|j��WdQXdS(s>Tests that files with bad CRCs return their name from testzip.R�R2tafileN(tzips_with_bad_crcR+R,R�R�R5RH(R%R/tzipdataR�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytcheck_testzip_with_bad_crc�s
!cCs|jtj�dS(N(R=R+RT(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt test_testzip_with_bad_crc_stored�ss
requires zlibcCs|jtj�dS(N(R=R+R~(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt"test_testzip_with_bad_crc_deflated�scCs#|j|}tjtj|�dd�� }|jtj|jd�WdQXtjtj|�dd��8}|jdd��}|jtj|j�WdQXWdQXtjtj|�dd��Z}|jdd��?}d|_	|jtj��x|jd�rq�WWdQXWdQXWdQXdS(sFTests that files with bad CRCs raise a BadZipfile exception when read.R�R2R:Ni(
R;R+R,R�R�R�R�R6R#t
MIN_READ_SIZE(R%R/R<R�tcorrupt_file((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytcheck_read_with_bad_crc�s
!!"!	cCs|jtj�dS(N(RBR+RT(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_with_bad_crc_stored�scCs|jtj�dS(N(RBR+R~(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_with_bad_crc_deflated�scCs�x�d	D]�}|d}t|�}tjtj�d|��W}|jd|�|jdd��,}|j|�}|jt	|�|�WdQXWdQXqWdS(
Nii�iii@R)RaR2(ii�iii@(
RR+R,R�R�R-R#R6R5R<(R%R/t	test_sizeRFtjunkR�R'tbuf((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytcheck_read_return_size�s

cCs|jtj�dS(N(RHR+RT(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_return_size_stored�scCs|jtj�dS(N(RHR+R~(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_return_size_deflated�scCs�tjtdd��}WdQXy#tjtdd�}|j�Wn!tjk
rd|jd�nXtjtdd��}WdQXy#tjtdd�}|j�Wn|jd�nXdS(NR�R)R2s+Unable to create empty ZIP file in 'w' modeR�s+Unable to create empty ZIP file in 'a' mode(R+R,RR�R�R(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_empty_zipfile�scCs8ttd��}WdQX|jtjtjtd�dS(NR)R2(R#RR�R+R�R,(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_open_empty_file�sc
Cs|jttjdd�dS(Nt	seventiesi�ii(i�iiiii(R�R�R+R�(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_create_zipinfo_before_1980s	cCsAd}tjtj|�d��}|j|j��WdQXdS(s>If an extra field in the header is less than 4 bytes, skip it.snPK���@����abcAPK���@������abcPK3%R2N(R+R,R�R�tassertIsNoneRH(R%R<R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt#test_zipfile_with_short_extra_field
scCstt�tt�dS(N(RRRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�s
(*R�R�R+RTR~R;RRRRRR!R"R#R$R&R'R(R*R+R.R/R4R7R8R9R=R>RR�R?RBRCRDRHRIRJRKRLRNRPR�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�sJ
	
	
											
							$													tDecryptionTestscBsfeZdZdZdZdZddZd�Zd�Zd�Z	d	�Z
eed
�d��Z
RS(s�Check that ZIP decryption works. Since the library does not
    support encryption at the moment, we use a pre-generated encrypted
    ZIP file.s�PKn�i.#y�?&test.txt��gly|�-�=�y�r�Z}Lg���|�䋺�)���lPKn�i.#y�?& ��test.txtPK6Ls�PK	�}38xu��zeroUT	֋�Gڋ�GUx���<M�a�X�Y&�{oEם���PKxu��PK	�}38xu��
��zeroUT֋�GUxPK?[szipfile.py encryption testsicCs~ttd��}|j|j�WdQXtjtd�|_ttd��}|j|j�WdQXtjtd�|_	dS(NRR2(
R#RR$R"R+R,RtRSRktzip2(R%R'((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR(8scCs8|jj�tjt�|jj�tjt�dS(N(RtR�R�RRRRRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�@s


cCs6|jt|jjd�|jt|jjd�dS(Nstest.txttzero(R�R�RtR6RR(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_no_passwordFscCsV|jjd�|jt|jjd�|jjd�|jt|jjd�dS(Ntperlstest.txtRS(RttsetpasswordR�R�R6RR(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_bad_passwordLss
requires zlibcCsb|jjd�|j|jjd�|j�|jjd�|j|jjd�|j�dS(Ntpythonstest.txtt12345RS(RtRVR5R6tplainRRtplain2(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_good_passwordRs(R�R�t__doc__R"RkRZR[R(R�RTRWRR�R\(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRQs	
				tTestsWithRandomBinaryFilescBs�eZd�Zd�Zd�Zd�Zd�Zeed�d��Z	d�Z
d�Zeed�d	��Zd
�Z
d�Zeed�d��ZRS(
cCsntdd�dtdd�}djd�t|�D��|_ttd��}|j|j�WdQXdS(Nii@iiRVcss1|]'}tjdt�tdd��VqdS(s<fi���i�N(tstructtpackRR(R�R&((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pys	<genexpr>]sR(RR!RR"R#RR$(R%t	datacountR'((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR([s
 cCstt�tt�dS(N(RRRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�ds
cCsBtj|d|��'}|jtd�|jtt�WdQXdS(NR)sanother.name(R+R,R$R(R%R.R/R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR1hscCs�|j||�tj|d|��d}|jt�}|jt|�t|j��|j||j�|j|jd�|j�WdQXdS(NR2sanother.name(R1R+R,R6RR5R<R"(R%R.R/R0ttestdata((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRRnscCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRRR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRUxss
requires zlibcCs:x3tt�tj�fD]}|j|tj�qWdS(N(RSRR�R�RRR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR|scCsV|j||�tj|d|��+}g}|jt��:}x0trr|jd�}|sbPn|j|�qCWWdQXg}|jd��:}x0tr�|jd�}|s�Pn|j|�q�WWdQXdj|�}	|j	t
|	�t
|j��|j	|	|j�dj|�}
|j	t
|
�t
|j��|j	|
|j�WdQXdS(NR2isanother.nameRV(R1R+R,R#RRWR6RXR!R5R<R"(R%R.R/R0RYRZR[R\R]t	testdata1t	testdata2((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR^�s,		cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR^R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR_�scCs:x3tt�tj�fD]}|j|tj�qWdS(N(RSRR�R�R^R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��scCs�|j||�tj|d|���}g}|jt��C}x9tr{|jtdd��}|skPn|j|�qCWWdQXdj	|�}|j
t|�t|j��|j
||j�WdQXdS(NR2iiRV(
R1R+R,R#RRWR6RRXR!R5R<R"(R%R.R/R0RYRZR[Rb((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRg�s	cCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRRgR+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRh�scCs:x3tt�tj�fD]}|j|tj�qWdS(N(RSRR�R�RgR+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��s(R�R�R(R�R1RRRURR�RR^R_R�RgRhR�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR^Zs					
					s
requires zlibtTestsWithMultipleOpenscBsheZed��Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�ZRS(
cCs*dtd�|_dtd�|_dS(Nt111i't222(Rtdata1Rk(tcls((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
setUpClass�scCsKtj|dtj��-}|jd|j�|jd|j�WdQXdS(NR)tonesttwos(R+R,R~R-RhRk(R%R.R0((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR1�scCs�|jt�tjtdd���}|jd��]}|jd��E}|jd�}|jd�}||j�7}||j�7}WdQXWdQX|j||�|j||j�WdQXdS(NR�R2Rki�(R1RSR+R,R#R6R5Rh(R%R�tzopen1tzopen2RhRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_same_file�s
cCs�|jt�tjtdd���}|jd��]}|jd��E}|jd�}|jd�}||j�7}||j�7}WdQXWdQX|j||j�|j||j�WdQXdS(NR�R2RkRli�(	R1RSR+R,R#R6R5RhRk(R%R�RmRnRhRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_different_file�s
cCs�|jt�tjtdd���}|jd��]}|jd�}|jd��6}|jd�}||j�7}||j�7}WdQXWdQX|j||j�|j||j�WdQXdS(NR�R2Rki�Rl(	R1RSR+R,R#R6R5RhRk(R%R�RmRhRnRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_interleaved�s
cCs�|jt�d}}z{tjtd��%}|jd�}|jd�}WdQX|jd�}|jd�}||j�7}||j�7}Wd|r�|j�n|r�|j�nX|j||j	�|j||j
�dS(NR2RkRli�(R1RSR�R+R,R#R6R�R5RhRk(R%RmRnR�RhRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_after_close�s 


c
Cs�tjtdtj��T}|jd|j�|jd|j�|jd��}|jd�}WdQXWdQX|j	||jd �tjtd��%}|jd�}|jd�}WdQX|j	||j�|j	||j�dS(NR)RkRli�R2(
R+R,RSR~R-RhRkR#R6R5(R%R�RmRhRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_after_write
scCs�tjtdtj��R}|jd|j�|jd��'}|jd�|jd|j�WdQXWdQXtjtd��%}|jd�}|jd�}WdQX|j	||j�|j	||j�dS(NR)Rki�RlR2(
R+R,RSR~R-RhR#R6RkR5(R%R�RmRhRk((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_after_reads
c
Cs�|jt�tjtdd��C}x9td�D]+}|jd�|jd��}WdQXq2WWdQXttj��}|j	|j
�d�WdQXdS(NR�R2idRk(R1RSR+R,R�R6R#R�tdevnullt
assertLesstfileno(R%R�R,RmR.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_many_opens#s

cCstt�dS(N(RRS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�/s(
R�R�tclassmethodRjR1RoRpRqRrRsRtRxR�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRe�s		
	
			
		tTestWithDirectorycBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCstjt�dS(N(R�R
RS(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR(4scCs�tjtd���}|jt�WdQX|jtjjtjj	td���|jtjjtjj	tdd���|jtjj
tjj	tddd���dS(Ns
zipdir.zipR�tbR(R+R,RR�RSR?R�R�tisdirR!R(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract_dir7s
(+cCs*tjtjjtd��|j�dS(NR�(R�R
R�R!RSR}(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
test_bug_6050>sc
Cs�tjjtd�}tj|�tj|�jd@}tjt	d���}|j
|�|jd}|j|j
jd��|j|j|d>dB�|j
|d�|jd}|j|j
d	�|j|j|d>dB�WdQXtjt	d
���}|jd}|j|j
jd��|j|j|d>dB�|jd}|j|j
d	�|j|j|d>dB�tjjtd�}tj|�|j|�|jtjjtjj|d���|jttj|��d�WdQXdS(
NR,i��R)is/x/ityisy/R2R�i(R�R�R!RSR
tstattst_modeR+R,RR$RR?RERR5R�R�R|R<tlistdir(R%tdirpathR�R�R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_write_dirCs0



!



(c
CsEtjtjjtd��tjtd��J}|jdd�|j	d}|j
|jd�|j
|jd�WdQXtjtd���}|j	d}|j
|jjd��|j
|jd
�tjjtd	�}tj|�|j|�|j
tjjtjj|d���|j
tj|�dg�WdQXdS(NR,R)sx/RVii�AiR2R�i�Ai�Ai�Ai�A(R�R
R�R!RSR+R,RR-RR5RER�R?RR�R|R�(R%R�R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_writestr_dir]s



(cCs-tt�tjjt�r)tt�ndS(N(R
RSR�R�RRR(R%((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�ns
(R�R�R(R}R~R�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRz3s					tUniversalNewlineTestscBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
eed�d
��Zeed�d��Zeed�d��Zeed�d��Zeed�d��Zd�ZRS(cCs�gtt�D]}d|^q
|_d|_ii|_|_x�t|j�D]s\}}|j|j�||j|<dt|f|j|<t	|j|d��}|j
|j|�WdQXqRWdS(NsTest of zipfile line %d.s
s
s
s%s-%dR(s
s
s
(RRR tsepstarcdatatarcfilest	enumerateR!RR#R$(R%R&tntsR�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR(us#	cCsLtj|d|��1}x'|jj�D]}|j||�q(WWdQXdS(NR)(R+R,R�tvaluesR$(R%R.R/R0RK((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR1�sc
Cs�|j||�tj|d��e}x[|jj�D]J\}}|j|d��}|j�}WdQX|j|j||�q5WWdQXdS(NR2Ri(	R1R+R,R�titemsR#R6R5R�(R%R.R/R0R�RKR'R<((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt	read_test�sc	Cs�|j||�tj|d�}x�|jj�D]�\}}|j|d��]}d}xMtr�|j�}|sxPn||7}|jd�}|s�Pn||7}q\WWdQX|j	||j
d�q2W|j�dS(NR2RiRVis
(R1R+R,R�R�R#RWRoR6R5R�R�(	R%R.R/R0R�RKRlR"R6((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytreadline_read_test�s 	
c	Cs�|j||�tj|d��v}xl|jj�D][\}}|j|d��;}x1|jD]&}|j�}|j||d�q`WWdQXq5WWdQXdS(NR2Ris
(	R1R+R,R�R�R#R RoR5(	R%R.R/R0R�RKRlRmRq((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
readline_test�sc
Cs�|j||�tj|d���}x{|jj�D]j\}}|j|d��}|j�}WdQXx4t|j|�D] \}}	|j	|	|d�q{Wq5WWdQXdS(NR2Ris
(
R1R+R,R�R�R#RsRtR R5(
R%R.R/R0R�RKR'RvRmRw((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytreadlines_test�sc	Cs�|j||�tj|d��y}xo|jj�D]^\}}|j|d��>}x4t|j|�D] \}}|j||d�qiWWdQXq5WWdQXdS(NR2Ris
(	R1R+R,R�R�R#RtR R5(	R%R.R/R0R�RKR�RmRw((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytiterlines_test�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_stored�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyRz�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR{�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR|�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+RT(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR}�ss
requires zlibcCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_read_deflated�scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��scCs7x0tt�t�fD]}|j|tj�qWdS(N(RSRRR�R+R~(R%R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��scCsEx*|jj�D]\}}tj|�qWtt�tt�dS(N(R�R�R�R�RRRS(R%R�RK((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��s
(R�R�R(R1R�R�R�R�R�R�RzR{R|R}RR�R�R�R�R�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR�ts$			
				
					tCommandLineTestcBsMeZd�Zd�Zd�Zd�Zeed�d��Zd�Z	RS(cOs:tjdd||�\}}}|jtjj�d�S(Ns-mR+s
(Rtassert_python_okRjR�tlinesepR�(R%targstkwargstrctoutterr((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt
zipfilecmd�scGstjdd|�S(Ns-mR+(Rtassert_python_failure(R%R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pytzipfilecmd_failurescCsotd�}|jd|�}|j|j�d�td�}|jd|�\}}}|j|d�dS(Ns
zipdir.zips-tsDone testingstesttar.tarRV(RR�R5trstripR�(R%tzip_nameR�R�R�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_test_commandsc	Cs�td�}t��,}tj|d��}|j�WdQXWdQX|j�jdd�}|jd|dd�}|j||�dS(Ns
zipdir.zipR2tasciitbackslashreplaces-ltPYTHONIOENCODINGsascii:backslashreplace(	RRR+R,R9R:R�R�R5(R%R�ttttftexpectedR�((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_list_commands	s
requires zlibc
CsL|jtt�ttd��}|jd�WdQXtjt�|jtt�ttj	j
td�d��}|jd�WdQXttg}ttdtdg}z�|jdt|�}|j
|d�tjt��W}|j
|j�|�|j
|j|d	�d�|j
|j|d
�d�WdQXWdtt�XdS(NR)stest 1sfile.txtstest 2R�s	/file.txts-cRVii(t
addCleanupRRR#R$R�R
t	TESTFNDIRR
R�R!R�RSR5R+R,RCR6(R%R.tfilesRCR�R((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_create_commands"
!'c
Cs.td�}t}tj|�z�|jd||�}|j|d�tj|���}x�|j�D]�}tj	j
||jjdtj
��}|jjd�r�|jtj	j|��qf|jtj	j|��t|d��&}|j|j�|j|��WdQXqfWWdQXWdt|�XdS(Ns
zipdir.zips-eRVR�R�(RR�R�R
R�R5R+R,RDR�R!RERjR�RR?R|R�R#R6R
(R%R�textdirR�RtziR�R.((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyttest_extract_command-s 
3(
R�R�R�R�R�R�RR�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyR��s					cCs)tttttttttt	t
�
dS(N(R
RR�RR�RQReRzR�R^R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt	test_mainAs	t__main__(2R�tImportErrorR�R�R�R7R@R_R+tunittestRttempfileRRRRRttestRttest.test_supportRRR	R
RRR
RRR�tUnicodeErrort	TypeErrorRSR�RR�RtTestCaseRR�R�RRQR^ReRzR�R�R�R�(((s8/usr/local/python-2.7/lib/python2.7/test/test_zipfile.pyt<module>sZ

@


				��`�U��<hpA�D	
© 2025 GrazzMean