python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_tarfile.cpython-312.pyc

Αe+sddlZddlZddlZddlmZddlmZmZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZddlmZddlmZ	ddlZ	ddlZ	ddlZ	ddlZd	Zej<j?ej@d
zZ!e!dzZ"ejFdZ$ej<jKe!d
Z&ej<jKe!dZ'ej<jKe!dZ(ej<jKe!dZ)ej<jKe!dZ*dZ+dZ,GddZ-ej\GddZ/ej`GddZ1ejdGddZ3Gdde-Z4Gdde4ejjZ6Gd d!e/e6Z7Gd"d#e1e6Z8Gd$d%e3e6Z9Gd&d'e4ejjZ:Gd(d)e/e:Z;Gd*d+e1e:Z<Gd,d-e3e:Z=Gd.d/e4Z>Gd0d1e>Z?Gd2d3e?ejjZ@Gd4d5e/e?ejjZAGd6d7e1e?ejjZBGd8d9e3e?ejjZCGd:d;e>ejjZDGd<d=e/eDZEGd>d?e1eDZFGd@dAe3eDZGGdBdCe-ejjZHGdDdEe/eHZIGdFdGe1eHZJGdHdIe3eHZKGdJdKe/ejjZLGdLdMe4ejjZMGdNdOZNGdPdQeNe4ejjZOGdRdSeNe4ejjZPGdTdUe-ZQGdVdWeQejjZRGdXdYe/eRZSGdZd[e1eRZTGd\d]e3eRZUGd^d_eQejjZVGd`dae/eVZWGdbdce1eVZXGdddee3eVZYGdfdge-ZZGdhdie1eZejjZ[Gdjdke1eZejjZ\Gdldme/eZejjZ]Gdndoe/eZejjZ^GdpdqejjZ_GdrdsejjZ`GdtdueQejjZaGdvdweQejjZbGdxdye/ebZcGdzd{e1ebZdGd|d}e3ebZeGd~debZfejeheddGddejjZiGdde`ZjGddZkGddekejjZlGddekejjZmGddekejjZnGddZoGddeoejjZpGdde/eoejjZqGdde1eoejjZrGdde3eoejjZsGddejjZtGddejjZuGddejjZvGddejjZwejeheddGdde4ejjZyGdde1ejjZzdZ{ejeheddejeheddGddejjZ|Gdde4ejjZ}Gdde4Z~Gdde~ejjZGdde~ejjZGdde~ejjZGdde~ejjZGddejjZdZGddZejrdZndZGddejjZdZd„Zedk(rejyy#e$rdZYBwxYw#e$rdZYKwxYw#e$rdZYTwxYw#e$rdZY]wxYw)N)sha256)contextmanager	ExitStack)Random)support)	os_helper)
script_helper)warnings_helperc4t|jSN)r	hexdigest)datas E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_tarfile.py	sha256sumr(s$<!!##z-tardirz
-extract-testztesttar.tarztesttar.tar.gzztesttar.tar.bz2testtar.tar.xzztmp.tartesttar@e09e4bc8b3c9d9177e77256353b36c159f5f040531bbd4b024a8f9b9196c71ce@4f05a776071146756345ceee937b33fc5644f5a96b9780d1c7d6a32cdf164d7bcheZdZeZdZejZejjZ
edZy)TarTestc4|j|jzSr)prefixsuffixselfs rmodezTarTest.modeBs{{T[[((rN)
__name__
__module____qualname__tarnamerioFileIOopentarfileTarFiletaropenpropertyrrrrr<s6G
F
99Doo%%G
))rrc`eZdZeZdZerejndZe	jjZy)GzipTestgzN)
rr r!gzipnamer"rgzipGzipFiler%r&r'gzopenr(r*rrr,r,Fs(G
F 4==dDoo$$Grr,c`eZdZeZdZerejndZe	jjZy)Bz2Testbz2N)
rr r!bz2namer"rr4BZ2Filer%r&r'bz2openr(r*rrr3r3Ms(G
F3;;4Doo%%Grr3c`eZdZeZdZerejndZe	jjZy)LzmaTestxzN)
rr r!xznamer"rlzmaLZMAFiler%r&r'xzopenr(r*rrr9r9Ts(G
F 4==dDoo$$Grr9ceZdZdZdZdZy)ReadTestr:cftj|j|jd|_y)N	iso8859-1rencodingr&r%r"rtarrs rsetUpzReadTest.setUp`s!<<499)46rc8|jjyr)rGclosers rtearDownzReadTest.tearDowndsrN)rr r!rrHrKr*rrr@r@\s
F6rr@ceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZej eed
xr	eedddZy)
UstarReadTestcF|jjd}|jj|5}|j}|j	t||jd|j	t|tddddy#1swYyxYw)N
ustar/regtyperegular file extraction failed)	rG	getmemberextractfilereadassertEquallensizersha256_regtypertarinfofobjrs    rtest_fileobj_regular_filez'UstarReadTest.test_fileobj_regular_filejs(($$_5
XX
!
!'
*	6d99;DSY4
6Yt_n4
6		6	6	6sABB cX|jjdtd|jjd}t	t
jjtdd5}|j}ddd|jj|5}tj|}|j}|j|d|jt|dd|j|ddddddy#1swYxYw#1swYyxYw)	NrOrfilterrzfileobj.readlines() failedrSzOI will gladly admit that Python is not the fastest running scripting language.
)rGextractTEMPDIRrQr%ospathjoin	readlinesrRr#
TextIOWrapperrTrU)rrYfobj1lines1rZfobj2lines2s       rtest_fileobj_readlinesz$UstarReadTest.test_fileobj_readlinesss'&A(($$_5
"'',,w8#
>	'%__&F	'XX
!
!'
*
	2d$$T*E__&FVV0
2S[#0
2VBZ40
2
	2
	2	'	'
	2
	2s,D A+D D D)c|jjdtd|jjd}t	t
jjtdd5}|j}ddd|jj|5}ttj|}|j|ddddy#1swY_xYw#1swYyxYw)NrOrr]r_zfileobj.__iter__() failed)rGrbrcrQr%rdrerfrgrRlistr#rhrT)rrYrirjrkrls      rtest_fileobj_iterzUstarReadTest.test_fileobj_iters'&A(($$_5
"'',,w8#
>	'%__&F	'
XX
!
!'
*	1e"**512FVV/
1	1	1	'	'	1	1s,C 2C'C$'C0c2|jjdtdttj
j
tdd5}|j}ddd|jjd}|jj|5}|j}|jd|jd|jd|jdd|jd|jd|jd	d
|jd|jd|jdd
|jd|jd
|jd}|j|ddd|jdd|j|j|jd|j|jdd|j|jd|jd|jd|jd|j}|jd|j}|j||d|jd|jt|j!|jd|jd|jt|j!dz|jd|jd|j!}|j|j|t|dddddy#1swY xYw#1swYyxYw)NrOrr]rbrzseek() to file's start failediz"seek() to absolute position failediz+seek() to negative relative position failedz+seek() to positive relative position failed
i
zread() after seek failedzseek() to file's end failedrz0read() at file's end did not return empty stringz$relative seek() to file's end failedzreadlines() after seek failedztell() after readline() failedz)tell() after seek() and readline() failedzread() after readline() failed)rGrbrcr%rdrerfrSrQrRseekrTtellrVrgrUreadline)	rrZrrYtextss1s2lines	         rtest_fileobj_seekzUstarReadTest.test_fileobj_seeks' &		(
"'',,w8$
?	499;D	(($$_5
XX
!
!'
*(	;d99;DIIaLQ		8
:IIdAT499;=
?IIeQT499;F
HIIdAT499;F
H		"
AQT$3
5IIaOW\\499;6
8TYY[#K
MIIw||mQ'Q		?
AIIcN!BIIcN!BR8
:IIaLS1499;9
;IIcNS1C7D
FIIaL==?DTYY[$s4yz*:9
;O(	;(	;			(	;(	;sN KN
N

Ncn|jjd5}tj|}|j	jd}|j
t|t	|jddddy#t$r|jdY%wxYw#1swYyxYw)NrOrCdzseeking failed in text mode)rGrRr#rhrSencoderTrrWrxAttributeErrorfailrrZrs   rtest_fileobj_textzUstarReadTest.test_fileobj_texts
XX
!
!/
2		9d##D)D99;%%k2DYt_n=
9		#		9		9"
9		78
9
		9		9s*AB+1BB(%B+'B((B++B4c|jj|5}|jj|5}|j|j|jddddddy#1swYxYw#1swYyxYwr)rGrRrTname)rlnktyperegtypeabs     r_test_fileobj_linkz UstarReadTest._test_fileobj_linksm
XX
!
!'
*	-a
XX
!
!'
*	-./QVVQVV,	-	-	-	-	-	-s"A<'A0A<0A9	5A<<Bc(|jddy)N
ustar/lnktyperOrrs rtest_fileobj_link1z UstarReadTest.test_fileobj_link1Arc(|jddy)N./ustar/linktest2/lnktypeustar/linktest1/regtyperrs rtest_fileobj_link2z UstarReadTest.test_fileobj_link2 ; 9	;rc(|jddy)N
ustar/symtyperOrrs rtest_fileobj_symlink1z#UstarReadTest.test_fileobj_symlink1rrc(|jddy)N./ustar/linktest2/symtyperrrs rtest_fileobj_symlink2z#UstarReadTest.test_fileobj_symlink2rrc(|jddy)Nsymtype2rOrrs rtest_issue14160zUstarReadTest.test_issue14160s
O<rcH|jd|jdy)Nbareaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)add_dir_and_getmemberrs rtest_add_dir_getmemberz$UstarReadTest.test_add_dir_getmembers""5)""7+rgetuidgetgidz'Missing getuid or getgid implementationc	Xd}tj5tjtd5}tj
|_	tj||j||tj|	dddtjt5}|j|j||j|dzddddddy#tj|wxYw#1swYxYw#1swY8xYw#1swYyxYw)Nc"dx|_|_|S)Nr)uidgidrYs rr^z3UstarReadTest.add_dir_and_getmember.<locals>.filters(++GK'+Nrwr]/)
rtemp_cwdr&r%tmpnameUSTAR_FORMATformatrdmkdiraddrmdirrTrQ)rrr^rGs    rrz#UstarReadTest.add_dir_and_getmembers	


!	gs+
#s$11
#HHTNGGDG0HHTN

#g&
#  MM$'MM$*-
		HHTN

#
#

		sRD D
(C.2D!D )4DD .DDD	
D D	D  D)N)rr r!r[rmrprrrrrrrrrunittest
skipUnlesshasattrrdrr*rrrMrMhs|62$1/;b
9-
B;B;=,
XX.H72x3HBDDrrMceZdZy)GzipUstarReadTestNrr r!r*rrrrrrceZdZy)Bz2UstarReadTestNrr*rrrrrrrceZdZy)LzmaUstarReadTestNrr*rrrrrrrc$eZdZdZdZdZdZy)ListTestcdtj|j|j|_y)NrrFrs rrHzListTest.setUps<<499=rctjtjdd}tjt
d|5jjdddd|jj}jd|jd|jd	|jd
|jd|jd|jd
|jd|fd}j|d|j|d|j|d|j|d|j|d|j|djd|jd|y#1swYlxYw)Nascii
newlinestdoutFverboseustar/conttype
ustar/regtypes
ustar/lnktypesustar/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/1234567/longnames./ustar/linktest2/symtypes./ustar/linktest2/lnktypesustar/dirtype/sustar/dirtype-with-size/ct|jjjd}|jddS)Nsurrogateescaperbackslashreplace)decoderGrEr)rr|rs  rconvz ListTest.test_list.<locals>.convs0**,=>A88G%788rsustar/umlauts-s'misc/regtype-hpux-signed-chksum-s)misc/regtype-old-v7-signed-chksum-spax/bad-pax-spax/hdrcharset-s)ustar/conttype ?\r?\nustar/regtype ?\r?\nslink tos->)
r#rhBytesIOr	swap_attrsysrGrodetachgetvalueassertInassertRegexassertNotIn)rtiooutrs`   r	test_listzListTest.test_listsrzz|WdC


sHc
2	)HHMM%M(	)jjl##%

'-

&,

&,

BCH

2C8

2C8

'-

137	9	


dHI3O

d;<=@	B

d;<=@	B

d67=

d9:C@	
7	8	
S)$C	)	)sGGctjtjdd}tjt
d|5|jjdddd|jj}|j|d|jd||jd	||jd
||jd||jd|y#1swYxYw)
NrrrrTrs\?rw-r--r-- tarfile/tarfile\s+7011 \d{4}-\d\d-\d\d\s+\d\d:\d\d:\d\d ustar/\w+type ?\r?\n\?rw-r--r-- tarfile/tarfile\s+7011 \d{4}-\d\d-\d\d\s+\d\d:\d\d:\d\d ustar/\w+type ?\r?\nsustar/symtype -> regtypes1./ustar/linktest2/symtype -> ../linktest1/regtypes;./ustar/linktest2/lnktype link to ./ustar/linktest1/regtypes	gnu/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longlink link to gnu/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longnames	pax/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longlink link to pax/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longname)r#rhrrrrrGrorrrr)rrrs   rtest_list_verbosezListTest.test_list_verbose4srzz|WdC


sHc
2	(HHMM$M'	(jjl##%	
=	>	


137

JCP

347	9

569	;

569	;'	(	(sC66C?ctjtjdd}d}tjt
d|5|jjd||jddd|jj}|jd||jd	|y#1swYLxYw)
Nrrrc3\K|jD]}d|jvs|yw)Nreg)
getmembersr)rGrYs  rmembersz+ListTest.test_list_members.<locals>.membersNs->>+
"GLL(!M
"s",,rF)rrrr)r#rhrrrrrGrorrrr)rrrrs    rtest_list_memberszListTest.test_list_membersLsrzz|WdC	"

sHc
2	DHHMM%1BMC	Djjl##%

&,*C0		D	Ds	.CCN)rr r!rHrrrr*rrrr	s>#%J;0
1rrceZdZy)GzipListTestNrr*rrrrYrrrceZdZy)Bz2ListTestNrr*rrrr]rrrceZdZy)LzmaListTestNrr*rrrrarrrcHeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)CommonReadTestcttd5	ddd|jtjt|jtjtjtttd5}|jtj|ddd|jtjtjdy#1swYxYw#1swYMxYw)Nwbrrsinvalid)	r%rassertFalser&
is_tarfilepathlibPathr#rrrZs  rtest_is_tarfile_erroneousz(CommonReadTest.test_is_tarfile_erroneousgs
'4
 			
++G45	
++GLL,ABC'4
 	7DW//56	7	
++BJJz,BCD			7	7sC3%C?3C<?Dc	`|jtj|j|jtjt	j
|jt
|jd5}|jtj|dddt
|jd5}|jtjtj|jdddy#1swYnxYw#1swYyxYw)Nrr)

assertTruer&rr"rrr%r#rrSrs  rtest_is_tarfile_validz$CommonReadTest.test_is_tarfile_validxs**4<<89	
**7<<+EFG$,,
%	6OOG..t45	6$,,
%	IOOG..rzz$))+/FGH	I	I		6	6	I	Is%D	AD$D!$D-ct|jd5}tj||j	|jddddt|jd5}t
j|j}tj||j	|jddddy#1swYxYw#1swYyxYw)Nrrr)	r%r"r&rrTryr#rrS)rrZ	file_likes   rtest_is_tarfile_keeps_positionz-CommonReadTest.test_is_tarfile_keeps_positions$,,
%	-t$TYY[!,	-$,,
%	2

499;/Iy)Y^^-q1	2	2		-	-	2	2s6C
+AC
CC"ctjt|jj	dd5	ddd	tjt|j}|j|j
|jgjy#1swYoxYw#tj$r|jdYCwxYw#jwxYw)Nr_rz&tarfile.open() failed on empty archive)r&r%rrreplacegetnamesassertListEqualr	ReadErrorrrJrrGs  rtest_empty_tarfilez!CommonReadTest.test_empty_tarfiles
\\'499#4#4S##>
?			,,w		2CLLN
  !126IIK		
  	@II>?	@

IIKs5B%4B14 C%B.1$CCCCC-c|jtd5tjd|jdddy#1swYyxYw)Nxxx)assertRaisesRegexFileNotFoundErrorr&r%rrs rtest_non_existent_tarfilez(CommonReadTest.test_non_existent_tarfiles<
#
#$5u
=	+LL		*	+	+	+s!AA
c2ttd5	ddd|jtjtjt|j
|jtjtjty#1swY{xYwNr)r%rassertRaisesr&rrrs rtest_null_tarfilez CommonReadTest.test_null_tarfilesd'4
 		'++W\\7DIIN'++W\\7C		sB

Bc<tdjd}dD]}|jtd5}|j	|dztjd}t||_|j	|j|j	|dddtjtdd	}	|j|jdgd
|z|jy#1swY^xYw#|jwxYw)Nrrw)arrtfoor_T)rignore_zerosz3ignore_zeros=True should have skipped the %r-blocks)
r	randbytesr%rwriter&TarInforUrVtobufrrrJ)rrcharrZrYrGs      rtest_ignore_zerosz CommonReadTest.test_ignore_zerossay""3'!	D7C(
!D

4$;'!//%0"4y

7==?+

4 
!,,wStDC
$$S\\^eWI		!	
!
!		sA*C=%D	=D		DcdD]}tjtd5}tjd}d|_|j|t
jddddttd5}|j|dddtjt5}|jtjd5|D]}	ddddddtjt5}|j}|jtjd5|j|td	ddd|jtjd5|j|jddddddy#1swYFxYw#1swY)xYw#1swYxYw#1swYxYw#1swYxYw#1swYSxYw#1swYxYw)
N)rwiXrtiw:rrtsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazr+bzunexpected end of datarr])r&r%rrrVaddfiler#rtruncaterrnextrbrcrRrS)rrVrGtrZs     rtest_premature_end_of_archivez,CommonReadTest.test_premature_end_of_archives*	.Dgt,
8OOE*Arzz+67
8
gu%
$

d#
$g&
#++G,=,=?WX 

g&
.#HHJ++G,=,=?WX;KK76K:;++G,=,=?WX.OOA&++-.

.
.	.
8
8

$
$

;;..

.
.sxAF';F4.!G
GG
1G12G(G13 G%G1'F1	4F>	G
G

G	G"G1%G.*G11G;	c|jtjd5tjt	j
d5}	ddddddy#1swYxYw#1swYyxYw)Nz%file could not be opened successfullyz
recursion.tar)rr&rr%rfindfilers  rtest_length_zero_headerz&CommonReadTest.test_length_zero_headersf
#
#G$5$57^
_	g..?@
C
		

		s#)A)
AA)A&	"A))A2c|jjd}|jj|5}|j|jddddy#1swYyxYwNrO)rGrQrRrTr)rfilerZs   rtest_extractfile_namez$CommonReadTest.test_extractfile_namesSxx!!/2
XX
!
!$
'	94TYY8	9	9	9sAA&N)
rr r!rrrrr	r
rrr"r&r*rrrres7E"
I
2"+D,.09rrcZeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZej$eeddej,dZej0dZej0dZdZdZdZdZej>e duddZ!dZ"y)MiscReadTestBasecyrr*rs rrequires_name_attributez(MiscReadTestBase.requires_name_attributesrc|jt|jd5}|j|jt
t
j||j5}|j|jt
|j|jtjj|jddddddy#1swYxYw#1swYyxYwNrrfileobjr)r*r%r"assertIsInstancerstrr&rrTrdreabspathrrZrGs   rtest_no_name_argumentz&MiscReadTestBase.test_no_name_arguments$$&
$,,
%	G!!$))S1d;
Gs%%chh4  277??499+EF
G	G	G
G
G	G	Gs%AC*)A$C
C*C'	#C**C3cTt|jd5}|j}dddtj}|jtt|dtj||j}|j|jy#1swYwxYw)Nrrrr-)r%r"rSr#rrrgetattrr&rassertIsNonerrrZrrGs    rtest_no_name_attributez'MiscReadTestBase.test_no_name_attributesz
$,,
%	99;D	zz$.'4@ll4dii8#((#		sBB'cTt|jd5}|j}dddtj}d|_t
j||j5}|j|j
dddy#1swYkxYw#1swYyxYw)Nrrrr-)	r%r"rSr#rrr&rr6r7s    rtest_empty_name_attributez*MiscReadTestBase.test_empty_name_attributes
$,,
%	99;D	zz$	
\\$TYY
7	(3chh'	(	(				(	(sB-BBB'ctj|jtj}t|d5}|j	|j
ttj||j5}|j|j
ddddddy#1swYxYw#1swYyxYwr,)
rdr%r"O_RDONLYr/rintr&rr6)rfdrZrGs    rtest_int_name_attributez(MiscReadTestBase.test_int_name_attributesWWT\\2;;
/
"d^	,t!!$))S1d;
,s!!#((+
,	,	,
,
,	,	,s$AB6=B*B6*B3	/B66B?c|jtj|j}t	|d5}|j|jttj||j5}|j|jt|j|jtjj|jddddddy#1swYxYw#1swYyxYwr,)
r*rdfsencoder"r%r/rbytesr&rrTrer1)rr"rZrGs    rtest_bytes_name_attributez*MiscReadTestBase.test_bytes_name_attributes$$&++dll+
'4
 	GD!!$))U3d;
Gs%%chh6  277??499+EF
G	G	G
G
G	G	Gs%AC?>A$C3"C?3C<	8C??Dc	Vtj|j}tj||j
5}|j
|jt|j|jtjjtj|ddd|j|5}|j
|jt|j|jtjjtj|dddtjj	||j
5}|j
|jt|j|jtjjtj|ddd|j dk(rtj|d5}|j
|jt|j|jtjjtj|dddyy#1swYxYw#1swYTxYw#1swYxYw#1swYyxYw)Nrrr_)rrr"r&r%rr/rr0rTrdrer1fspathr(r'r)rr"rGs   rtest_pathlike_namez#MiscReadTestBase.test_pathlike_names,,t||,
\\'		
2	Lc!!#((C0SXXrwwryy7I'JK	L\\'
"	Lc!!#((C0SXXrwwryy7I'JK	L__
!
!'		
!
:	Lc!!#((C0SXXrwwryy7I'JK	L;;"s3
Ps%%chh4  277??299W;M+NO
P
P	L	L	L	L	L	L
P
Ps4A-I9A-J'A-JA-J9JJJJ(cttd5	ddd|jtd5|j	td}ddd|jtd5|j	td}ddd|jtd5|j	td}dddy#1swYxYw#1swYxYw#1swYWxYw#1swYyxYw)Nrz
mode must be qrwr)r%rr
ValueErrorr(rs  rtest_illegal_mode_argz&MiscReadTestBase.test_illegal_mode_arg-s
'4
 		

#
#J
@	-,,w,C	-

#
#J
@	.,,w-C	.

#
#J
@	,,,w+C	,	,
			-	-	.	.	,	,s.B;C&CC;CCCC(cBtj|j|j}	|j	|j	}|j
}|j}|j|5}|j}ddd|j|j|j5}|j||j|jd|5}|j	}|j|j
||j|j|j|jdddddddy#1swYxYw#|jwxYw#1swY3xYw#1swYyxYw)NrrArr.zseek back did not work)
r&r%r"rrroffsetrRrSrJrxrTr)rrGrrrNfrrZs        rtest_fileobj_with_offsetz)MiscReadTestBase.test_fileobj_with_offset7sGll4<<dii8	HHJ
A66DXXF#
 qvvx
 
IIKYYt||
$	2IIf$,,T4@
2CHHJ  .   !3!8!8!:D02

2		2	2

 
 
IIK
2
2		2	2sIA	E46E(E4:0F*A-F	F(E1-E44F	F	FFc@|jtjtjt|j
ttd5}|jtjtj||j
dddy#1swYyxYwr,)rr&rr%r"rrs  rtest_fail_compzMiscReadTestBase.test_fail_compSso'++W\\7DIIN
'4
 	<Dg//&*

<	<	<	<s<BBc|jjd}|j|jtj
dy)Nzmisc/dirtype-old-v7zv7 dirtype failed)rGrQrTtyper&DIRTYPErrYs  rtest_v7_dirtypez MiscReadTestBase.test_v7_dirtypeZs6(($$%:;w#	%rc|	|jjdy#t$r|jdYywxYw)Nzmisc/regtype-xstarz3failed to find misc/regtype-xstar (mangled prefix?))rGrQKeyErrorrrs rtest_xstar_typez MiscReadTestBase.test_xstar_typebs9	MHH34	MIIKL	Ms;;c|jD]{}|jt|jdd|jz|jjdsR|j|jdd|jz}y)N鏽>zwrong mtime for %szustar/r&zwrong uname for %s)rGrTr=mtimer
startswithunamerVs  rtest_check_membersz#MiscReadTestBase.test_check_memberskssxx	9GS/(7<<7
9<<**84W]]I(7<<7
9	9rct|j|jjdjddy)Nzmisc/eofzcould not find all members)rTrGrrrs rtest_find_membersz"MiscReadTestBase.test_find_membersts/,,.r277,	.rlinkMissing hardlink implementationcJtjtdd5}|jdtd|jtjtjjtd|jdtd|jtjtjjtdttjjtdd5}|j}ddd|jtt|jd	td|jtjtjjtd	ttjjtd	d5}|j}ddd|jt|tdddy#1swYxYw#1swY=xYw#1swYyxYw)
NrsrC)
errorlevelrErOrr]rrrr)r&r%r"rbrc
addCleanuprunlinkrdrerfrSrTrrW)rrGrOrs    rtest_extract_hardlinkz&MiscReadTestBase.test_extract_hardlinkxsm
\\'a+
F	>#KKK@OOI,,bggll7O.TUKKK@OOI,,bggll7O.TUbggll7O<dC
 qvvx
 Yt_n=KKK@OOI,,bggll7O.TUbggll7O<dC
 qvvx
 Yt_n=	>	>
 
 
 
 	>	>s=C#HHB/HH
'HH
	H
H	HH"ctjtd}tjjtd}tj|	|Dcgc]}|js|}}|j||d|D]}tjj||j}tjdk7rJ|j|jdztj|j dz|jd}tjj#|}d	j%||j&|||}	|j|j&||		|j)t+j,|ycc}w#|j)t+j,|wxYw)
NrCrE
extractall
fully_trustedr]win32ct|tr dj||jSdj|S)Nz{} ({})z
{!r} (int))
isinstancefloatrhex)r]s rformat_mtimez6MiscReadTestBase.test_extractall.<locals>.format_mtimes6!%/(//uyy{CC+22599rz,tar mtime {0} != file time {1} of path {2!a})r&r%r"rdrerfrcrisdirrmrrplatformrTrstatst_modegetmtimerr]rJrrmtree)
rrGDIRrdirectoriesrYreru
file_mtimeerrmsgs
          rtest_extractallz MiscReadTestBase.test_extractallscll7[9ggll7L1

	"&)7QWWY17K7NN3OND&
Dww||C6<<7*$$W\\E%9%'WWT]%:%:U%B%,\\3:
 WW--d3
GNN / ,  
FC#
D&
IIKS!-8*
IIKS!s%F,F'0F'4DF,'F,,'Gcd}tjjtd}tj|	tjtd5}|j|}|j||dtjj||}|jtjj||jtjdk7r2|jtj|j dzd	dddt#j$|y#1swYxYw#t#j$|wxYw)
N
ustar/dirtype
extractdirrCrlrnrer^rorpi)rdrerfrcrr&r%r"rQrbrTrzr]rrwrxryrr{rdirtyper|rGrY	extracteds      rtest_extract_directoryz'MiscReadTestBase.test_extract_directorys!ggll7L1

		"g<
P--0G#oFGGLLg6	  !1!1)!<gmmL<<7*$$RWWY%7%?%?%%GO

P
S!
P
P
S!s$ECD:E:E?EEctjtdz}tj|5tjtd5}|Dcgc]}|js|}}|j||d|D]J}||jz}|jtjj||jL	ddddddycc}w#1swYxYw#1swYyxYw)NrmrCrlrnr])rrrcrtemp_dirr&r%r"rvrmrrTrdrerzr])rr|rGrr}rYres       rtest_extractall_pathlike_namez.MiscReadTestBase.test_extractall_pathlike_namesll7#l2



$	H
\\'K
8	H<?&)7QWWY17K7NN3OND&
HW\\)  !1!1$!7G
H		H	H	H7	H	H	H	Hs<C5C)C$)C$-A%C)C5$C))C2	.C55C>cd}tjtdz}tj|5tjtd5}|j|}|j||d||z}|jtjj||jddddddy#1swYxYw#1swYyxYw)NrrmrCrlrnr)rrrcrrr&r%r"rQrbrTrdrerzr]rs      rtest_extract_pathlike_namez+MiscReadTestBase.test_extract_pathlike_names!ll7#l2



$	I
\\'K
8	I<?mmG,GKKc/KBg
IRWW--i8'--H	I	I	I	I	I	Is$CA$C4CC	
CCctjjtd}t	|d5}|jdddd	tjtj}	|j||jdt!j"|y#1swYfxYw#tj$r(|j|jjY\wxYw#t!j"|wxYw)NemptyrrzReadError not raised)rdrerfrcr%robject__new__r&r'__init__rrrr.closedrri)rrrZrGs    rtest_init_close_fobjz%MiscReadTestBase.test_init_close_fobjsWg.
%
	$JJsO			$..1C
2U#		01U#		$$
4 2 23
4

U#s;B(#C20B4C2(B148C/,C2.C//C22D	c>tj|j5}t||D]Y\}}|j	|j
|j
|j	|j
|j
[	dddy#1swYyxYwr)r&r%r"ziprTrNget_info)rrGm1m2s    rtest_parallel_iterationz(MiscReadTestBase.test_parallel_iterationsx\\$,,
'	?3c3-
?B  BII6  
>
?	?	?	?sA)BBNz
requires zlibc<tjjd5}tj|_|j
tj5tj|jddddddy#1swYxYw#1swYyxYw)Nztarfile.TarInfo.fromtarfile)rmockpatchzliberrorside_effectrr&rr%r")rrs  rtest_zlib_error_does_not_leakz.MiscReadTestBase.test_zlib_error_does_not_leaksx]]
 
 !>
?	+4#zzD""7#4#45
+T\\*
+	+	+
+
+	+	+s#5B B5BB	BBctj}tj|d}|j	|jdtj|d5}|j
|jdddd|jdtj|d5}|j
|jddddy#1swY[xYw#1swYyxYw)Nrr-rr|r_)r#rr&r%rJrxrTr)rr>tfs   rtest_next_on_empty_tarfilez+MiscReadTestBase.test_next_on_empty_tarfiles
ZZ\
\\"3
/




\\"4
0	.BRWWY-	.	

\\"3
/	.2RWWY-	.	.		.	.	.	.s$!C5!C+C(+C4)#rr r!r*r3r8r:r?rCrFrKrPrRrWrZr`rcrrrrdrskip_unless_symlinkrjskip_unless_working_chmodrrrrrrskipIfrrrr*rrr(r(s
G$(,GP ,28<%M9.XV,:<"">#<>$((")">((
")
"HI$&?X__TT\?3+4+.rr(ceZdZdZy)MiscReadTestN)rr r!rRr*rrrrsNrrceZdZy)GzipMiscReadTestNrr*rrrrrrrceZdZdZy)Bz2MiscReadTestc&|jdy)NzBZ2File have no name attributeskipTestrs rr*z'Bz2MiscReadTest.requires_name_attribute	s

67rNrr r!r*r*rrrrs8rrceZdZdZy)LzmaMiscReadTestc&|jdy)NzLZMAFile have no name attributerrs rr*z(LzmaMiscReadTest.requires_name_attribute
s

78rNrr*rrrrs9rrc(eZdZdZdZdZdZdZy)StreamReadTestrc,|jD]O}|js|jj|5}		|jd}sn	dddQy#tj
$r|j
dY6wxYw#1swYxYw)Nrwz6simple read-through using TarFile.extractfile() failed)rGisregrRrSr&StreamErrorr)rrYrZbufs    rtest_read_throughz StreamReadTest.test_read_throughsxx	G==?%%g.
$B"iin

	#..B		#ABB	

s.B
A B
 $BB
BB

B	cD|jj}|jj|5}|j}ddd|j	t|jd|j	t|tdy#1swYPxYw)NrP)	rGrrRrSrTrUrVrrWrXs    rr[z(StreamReadTest.test_fileobj_regular_file%s{((--/
XX
!
!'
*	d99;D	TGLL0	24.0	2			sBBc|jj}|jj|d5}|jtj
|jdddy#1swYyxYwNr)rGrrRrr&rrS)rtarinfosrOs   rtest_provoke_stream_errorz(StreamReadTest.test_provoke_stream_error.s[88&&(
XX
!
!(1+
.	;!g11166:	;	;	;s+A--A6ctjtd}	|j}	|j	}|j	}|n|j|d|j
s|jr:|jtj5|j|ddd|j|}|j|}||j|d|j|j|jd	|jy#1swYxYw#|jwxYw)NrCrlzstream.next() failed.zstream.extractfile() failedzstream extraction failed)r&r%r"rGrassertIsNotNoneislnkissymrrrRrTrSrJ)rtar1tar2t1t2v1v2s       rtest_compare_membersz#StreamReadTest.test_compare_members3s||Gk:	88DYY[YY[:$$R)@A88:**7+>+>?-((,-%%b)%%b):$$R)FG  BGGI24# 
JJL--
JJLs%BD>D20A0D>2D;7D>>EN)rr r!rrr[rrr*rrrrsF 2;
rrceZdZy)GzipStreamReadTestNrr*rrrrNrrrceZdZy)Bz2StreamReadTestNrr*rrrrQrrrceZdZy)LzmaStreamReadTestNrr*rrrrTrrrc*eZdZdZdZdZdZdZy)DetectReadTestc	tj||}|jy#tj$r}|j	Yd}~yd}~wwxYwr)r&r%rJrr)rrrrGes     r_testfunc_filezDetectReadTest._testfunc_fileYsE	,,tT*C
IIK  	IIKK	s)AAAc	t|d5}tj|||}dddjy#1swYxYw#tj$r}|j	Yd}~yd}~wwxYw)Nrrr.)r%r&rJrr)rrrrOrGrs      r_testfunc_fileobjz DetectReadTest._testfunc_fileobjase	dD!
:Qll4q9
:

IIK
:
:  	IIKK	s-AAAA	AA9A44A9c|jr2|jtj5tjt
d|jzddd|jtj5tjt
d|jzddd|jtj5tj|j
dddd|jtj5tj|j
dddd||j
d||j
d|jz||j
d||j
d|jz||j
dy#1swYfxYw#1swY#xYw#1swYxYw#1swYxYw)NrArrr_zr:*r|*)rrr&rr%r")rtestfuncs  r_test_modeszDetectReadTest._test_modesjsW;;""7#4#45
?W4$+++=>
?""7#4#45
?W4$+++=>
?""7#4#45
6T\\5
6""7#4#45
6T\\5
6s#tdkk12u%tdkk12u%
?
?
?
?
6
6
6
6s/)F:=)G
"G"G :GGG G)c:|j|jyr)rrrs rtest_detect_filezDetectReadTest.test_detect_filezs,,-rc:|j|jyr)rrrs rtest_detect_fileobjz"DetectReadTest.test_detect_fileobj}s//0rN)rr r!rrrrrr*rrrrXs& .1rrceZdZy)GzipDetectReadTestNrr*rrrrrrrceZdZdZy)Bz2DetectReadTestcttd5}|j}dddtjt
dd5}|j
ddd|jt
dy#1swYVxYw#1swY,xYw)Nrrrrs
compresslevelr)r%r"rSr4r6rrrrs   rtest_detect_stream_bz2z(Bz2DetectReadTest.test_detect_stream_bz2sw
'4
 	D99;D	[[$a
8	DJJt		
GU+				sA7B7BBN)rr r!rr*rrrrs,rrceZdZy)LzmaDetectReadTestNrr*rrrrrrrceZdZdZdZy) GzipBrokenHeaderCorrectExceptionz>
    See: https://github.com/python/cpython/issues/107396
    ctjd}|jtj5tj
|ddddy#1swYyxYw)Nszr|gzr-)r#rrr&rr%)rrOs  rrunTestz(GzipBrokenHeaderCorrectException.runTestsNJJ



w00
1	1LL0	1	1	1sAAN)rr r!__doc__rr*rrrrs
1rrceZdZddZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZy)MemberReadTestNc	|[|jj|5}|jt|j	|d|j
zdddd|d<d|d<d|d<d|j
vr
d	|d
<d	|d<|j
D]2\}}|jt|||d|d
|j
4y#1swYvxYw)Nwrong sha256sum for %sr\r]rrrzold-v7r&r_gnamezwrong value in z
 field of )rGrRrTrrSritemsr5)rrYchksumkwargsrOkvs       r_test_memberzMemberReadTest._test_members%%g.
A!  1668!4f07<<?A
A'wu
u
7<<''F7O'F7OLLN	IDAqWWa0!78',,G
I	I
A
As8CCcj|jjd}|j|dty)NrOcrVrrGrQrrWrVs  rtest_find_regtypez MemberReadTest.test_find_regtypes+(($$_5'^Drcj|jjd}|j|dty)Nzustar/conttyperrrrVs  rtest_find_conttypez!MemberReadTest.test_find_conttypes,(($$%56'^Drc`|jjd}|j|dy)NrrrVrGrQrrVs  rtest_find_dirtypez MemberReadTest.test_find_dirtypes)(($$_5'*rc`|jjd}|j|dy)Nzustar/dirtype-with-sizerrrVs  rtest_find_dirtype_with_sizez*MemberReadTest.test_find_dirtype_with_sizes*(($$%>?',rcb|jjd}|j|ddy)NrrrOrVlinknamerrVs  rtest_find_lnktypez MemberReadTest.test_find_lnktypes+(($$_5'ODrcb|jjd}|j|ddy)Nrrrr
rrVs  rtest_find_symtypez MemberReadTest.test_find_symtypes+(($$_5'I>rcd|jjd}|j|dddy)Nz
ustar/blktyperrVdevmajordevminorrrVs  rtest_find_blktypez MemberReadTest.test_find_blktype-(($$_5'ABrcd|jjd}|j|dddy)Nz
ustar/chrtyperrsrrrrVs  rtest_find_chrtypez MemberReadTest.test_find_chrtyperrc`|jjd}|j|dy)Nzustar/fifotyperrrrVs  rtest_find_fifotypez!MemberReadTest.test_find_fifotypes*(($$%56'*rcj|jjd}|j|dty)Nzustar/sparsePrrGrQr
sha256_sparserVs  rtest_find_sparsezMemberReadTest.test_find_sparses+(($$^4'mDrcj|jjd}|j|dty)N
gnu/sparserrrrVs  rtest_find_gnusparsez"MemberReadTest.test_find_gnusparses+(($$\2'mDrcj|jjd}|j|dty)Ngnu/sparse-0.0rrrrVs  rtest_find_gnusparse_00z%MemberReadTest.test_find_gnusparse_00,(($$%56'mDrcj|jjd}|j|dty)Ngnu/sparse-0.1rrrrVs  rtest_find_gnusparse_01z%MemberReadTest.test_find_gnusparse_01r(rcj|jjd}|j|dty)Ngnu/sparse-1.0rrrrVs  rtest_find_gnusparse_10z%MemberReadTest.test_find_gnusparse_10r(rcj|jjd}|j|dty)Nuustar/umlauts-ÄÖÜäöüßrrrrVs  rtest_find_umlautsz MemberReadTest.test_find_umlautss2(($$&DE'^Drc\d}|j||jjy)Naustar/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/12345/1234567/longname)rrGr)rrs  rtest_find_ustar_longnamez'MemberReadTest.test_find_ustar_longnames"<

dDHH--/0rcj|jjd}|j|dty)Nzmisc/regtype-old-v7rrrrVs  rtest_find_regtype_oldv7z&MemberReadTest.test_find_regtype_oldv7s,(($$%:;'^Drc|jjtj|j|j
d|_|jj
d}|j|dty)NrCrDupax/umlauts-ÄÖÜäöüßrr)	rGrJr&r%r"rrQrrWrVs  rtest_find_pax_umlautsz$MemberReadTest.test_find_pax_umlautss_<<499)46(($$&DE'^Drr)rr r!rrrrrrrrrrr!r$r'r+r.r0r2r4r6r*rrrrsoI"EE+-E?CC+EEEEEE
1EErrc*eZdZdZdZdZdZdZy)LongnameTestc|jdzdzdz}	|jj|}|jjtjdy#t$r|j	dYHwxYw)Nr123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longnamezlongname not foundzread longname as dirtype)	subdirrGrQrYrassertNotEqualrTr&rU)rr;rYs   rtest_read_longnamezLongnameTest.test_read_longname
sp;;$|3j@	,hh((2G	
GLL'//*	,	,II*+	,sAA;:A;c
|jdzdzdz}|jdzdzdz}	|jj|}|jj|dy#t$r|j	dY:wxYw)Nrr:r;longlinkzlonglink not foundzlinkname wrong)r<rGrQrYrrTr)rr;r@rYs    rtest_read_longlinkzLongnameTest.test_read_longlinks;;$|3j@;;$|3j@	,hh((2G	
))85EF	,II*+	,sA%%BBc|jdzdzdz}|jj|}|j}|jjj|t
j|jjjd}|jtj5tjd|dddy#1swYyxYw)Nrr:r;izfoo.tar)rr.)
r<rGrQrNr.rxr#rrSrr&rr%)rr;rYrNrZs     rtest_truncated_longnamez$LongnameTest.test_truncated_longnames;;$|3j@(($$X.f%zz$((**//89


w00
1	7LLi6	7	7	7s9CC#c|jdzdzdz}|jj|j}t	t
d5}|j
|tjj|jddd}|j|j|jdddy#1swYyxYw)Nrr:r;rrrwrCstrict)r<rGrQrNr%r"rxr&rfrombufrSrTrTlongnametype)rr;rNrZrYs     rtest_header_offsetzLongnameTest.test_header_offset&s;;$|3j@##H-44
'4
 	>DIIfoo--diin.98EGW\\4+<+<=		>	>	>s
A(B<<Cc	d}tj5tjtd5}|j
|_	t
j||j|t
j|jd	dddtjt5}|j|j||j|j|jdddddddy#t
j|jdwxYw#1swYxYw#1swYGxYw#1swYyxYw)Nzfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/rr)rrr&r%rrrdrrrrstriprrQremovesuffix)rlongdirrGs   rtest_longname_directoryz$LongnameTest.test_longname_directory1s#



!
	Ogs+
2s![[
2HHW%GGG$HHW^^C01

2g&
O#$$S]]7%;<$$S]]73G3G3L%MN
O
	O
	OHHW^^C01

2
2
O
O
	O
	OsSED;&D+$D;!E1AEE&D88D;;E	EE	EEN)rr r!r>rArCrHrMr*rrr8r8s,G7	>
Orr8cneZdZdZej
ZejZdZ	dZ
dZdZdZ
edZy)	GNUReadTestgnuc|jj|tdtjjt|}t
|d5}|j}ddd|jttd|z|jr?tj|}|j|jdz|jyy#1swY|xYw)Nrr]rrrrw)rGrbrcrdrerfr%rSrTrr _fs_supports_holesrx
assertLess	st_blocksst_size)rrfilenamerZrr|s      r_test_sparse_filezGNUReadTest._test_sparse_fileMswv677<<.
(D
!	T99;D	4-(4/	1""$!AOOAKK#-qyy9%		sCC(c&|jdy)Nr#rWrs rtest_sparse_file_oldz GNUReadTest.test_sparse_file_oldYs|,rc&|jdy)Nr&rYrs rtest_sparse_file_00zGNUReadTest.test_sparse_file_00\/0rc&|jdy)Nr*rYrs rtest_sparse_file_01zGNUReadTest.test_sparse_file_01_r]rc&|jdy)Nr-rYrs rtest_sparse_file_10zGNUReadTest.test_sparse_file_10br]rctjjdrtjjtd}t|d5}|jd|jd|jdddtj|}tj||jdz|jkSy#1swYPxYw)Nlinuxzsparse-testrisxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrwF)rrwr^rdrerfrcr%rxrrrxrrirTrU)rrZr|s   rrRzGNUReadTest._fs_supports_holeses<<""7+77<<7DdD!
 T		$

;'

	
 

AT"KK#%		12
 
 s3CCN)rr r!r<r&GNUTYPE_LONGNAMErG
GNU_FORMATrrWrZr\r_rastaticmethodrRr*rrrOrO@sJ
F++L


F
:-111rrOcLeZdZdZej
ZejZdZ	dZ
y)PaxReadTestpaxc>tjtd}	|jd}|j	|j
d|j	|jd|j	|jjdd|jd}|j	|j
d	|j	|jd|j	|jjdd|jd
}|j	|j
d|j	|jd|j	|jjdd|jy#|jwxYw)NrCrlpax/regtype1rrzVENDOR.umlautsuÄÖÜäöüßzpax/regtype2rzpax/regtype3r&)
r&r%r"rQrTr_rpax_headersgetrJrrGrYs   rtest_pax_global_headersz#PaxReadTest.test_pax_global_headerssAll7[9	mmN3GW]]E2W]]E2W00445EF;
=mmN3GW]]B/W]]E2W00445EF;
=mmN3GW]]I6W]]I6W00445EF;
=
IIKCIIKsEF

Fcztjtd}	|jd}|j	|j
d|j	|jd|j	|jd|j	|jd|j	t|jt|j	t|jdd|j	t|jdd|jy#|jwxYw)	NrCrlzpax/regtype4r{g^Aatimectime)
r&r%r"rQrTrVrrr]rTrsrlrJrns   rtest_pax_number_fieldsz"PaxReadTest.test_pax_number_fieldssll7[9
	mmN3GW\\40W[[#.W[[#.W]]L9T'--0%8U7#6#6w#?@,OU7#6#6w#?@,OIIKCIIKsC:D((D:N)rr r!r<r&XHDTYPErG
PAX_FORMATrrortr*rrrhrh|s%
F??L


F.
rrhceZdZdZdZy)
WriteTestBasectj}tj||j5}|jtjdddd|j|jd|j}~tj|j|j|j||jy#1swYxYw)Nr-rz#external fileobjs must never closed)
r#rr&r%rrrrrrr
gc_collectrT)rrZrGrs    rtest_fileobj_no_closez#WriteTestBase.test_fileobj_no_closeszz|
\\$TYY
7	03KK./	0&KL}}%t}}/	0	0s%C  C)ctjt|j5}tjd}tj
tjz
|_|j|tjd|jzddd|jtd5}|jt|jtj
dzdddy#1swYcxYw#1swYyxYw)Nrrrrrv)r&r%rrr
RECORDSIZE	BLOCKSIZErVrr#rrTrUrS)rrGrrZs    rtest_eof_markerzWriteTestBase.test_eof_markers
\\'499
-	6&A'''*;*;;AFKK2::dQVVm45	6
YYw
%	GS-w/A/AA/EF	G	G	6	6
	G	GsA.C51;D5C>D
N)rr r!r{rr*rrrxrxs

0GrrxceZdZdZdZdZdZdZdZdZ	e
jee
dd	d
Zej dZdZd
ZddZej dZdZdZdZdZy)	WriteTestrcd}tjt|j}	tj|}|j||j
tjt}	|j|jd|d|j
y#|j
wxYw#|j
wxYw)Nd0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789rz!failed to store 100 char filename)	r&r%rrrrrJrTr)rrrGrs    rtest_100_char_namezWriteTest.test_100_char_names
!ll7DII.	%AKKNIIKll7#	S\\^A.7
9
IIK
IIK
IIKs&B-8$C-B?Cctjt|j}	tj
j
td}t|d5}|jdddd|j||j|jtj
jtddy#1swY_xYw#|jwxYw)Nr%raaarztarfile is empty)
r&r%rrrdrerfrcrrrJ
assertGreatergetsize)rrGrerZs    r
test_tar_sizezWriteTest.test_tar_sizesll7DII.	77<<0DdD!
#T

6"
#GGDMIIK277??73Q"	$
#
#
IIKs#0CC(CCCC$c<tjt|j}	tj
j
td}t|d5	ddd|j|}|j|jdt|d5}|jdddd|j|}|j|jd|jy#1swYxYw#1swYSxYw#|jwxYw)Nr%rrrr)
r&r%rrrdrerfrc
gettarinforTrVrrJ)rrGrerYrZs     rtest_file_sizezWriteTest.test_file_sizesll7DII.	77<<0DdD!

nnT*GW\\1-dD!
#T

6"
#nnT*GW\\1-IIK



#
#

IIKs<0D	C1AD	C=+5D	1C:6D	=DD		Dctjjtd}tj|	tjt|j}	|j|}|j|jd|j	tj|y#|jwxYw#tj|wxYw)N	directoryr)rdrerfrcrr&r%rrrrTrVrJrrrrerGrYs    rtest_directory_sizezWriteTest.test_directory_sizesww||G[1
	",,w		2C
...  q1		OOD!		OOD!s#$C	 -B4
C	4CC		C cLtjjtd}tj|ttjj|ddj
ttjj|ddj
	tj
t|j}	tjjd5}ddg|_
|j|dddg}|jD]=}|j!tjj#|j$d?|j'|gd|j
	t)j*tjj|dt)j*tjj|dt)j,|y#1swYxYw#|j
wxYw#t)j*tjj|dt)j*tjj|dt)j,|wxYw)Nr1r2z
os.listdirrb)rrr)rdrerfrcrr%rJr&rrrrrreturn_valuerrappendsplitrrTrrir)rrerGmock_listdirpathsms      rtest_ordered_recursionz WriteTest.test_ordered_recursionsww||G[1
RWW\\$
$c*002RWW\\$
$c*002	",,w		2C	
]]((6",14c
L-GGDM")<ALLqvv!6r!:;<  (?@		RWW\\$45RWW\\$45OOD!""		RWW\\$45RWW\\$45OOD!s>+$H&H/H
A.H8H&H
HH##H&&A=J#c@tjt|j5}t	j
tdz}t|d5}|jdddd|j|}|jtj|}|j|jt|j|j|j|j|jddddy#1swYxYw#1swYyxYw)Nr%rrr)r&r%rrrrrcrrrdrEr/rr0rTrV)rrGrerZrYtarinfo2s      rtest_gettarinfo_pathlike_namez'WriteTest.test_gettarinfo_pathlike_name"s
\\'499
-	.<<(61DdD!
#T

6"
#nnT*G~~biio6H!!',,4W\\8==9W\\1-	.	.
#
#	.	.s$)DD BDD	
DDrdrec@tjjtd}tjjtd}t	|d5}|jdddd	tj||	tjt|j}	|j||j|}|j|jd|j	t!j"|t!j"|y#1swYxYw#t$r}|jd|zYd}~d}~wwxYw#|jwxYw#t!j"|t!j"|wxYw)Nrdlink_targetrr
os.link(): %sr)rdrerfrcr%rrdPermissionErrorrr&rrrrTrVrJrri)rrdtargetrZrrGrYs       rtest_link_sizezWriteTest.test_link_size-s+ww||GV,g}5
&$
	4JJv		/GGFD!	#,,w		2C
v&...  q1		V$T"#			/MM/A-..	/		V$T"sHD&0D2$E1,>E*E1&D/2	E;EEE..E11,Fctjjtd}tjd|	tjt|j}	|j|}|j|jd|j	tj|y#|jwxYw#tj|wxYw)Nsymlinkrr)rdrerfrcrr&r%rrrrTrVrJrrirs    rtest_symlink_sizezWriteTest.test_symlink_sizeEsww||GY/


=$'	#,,w		2C
...  q1		T"		T"s#$C
!-B5C
5CC

C!c<tjjt}t	j
t|j}	|j|j|d|j||j|jgdtjt5|j|ddd|j|jgd|jy#1swY;xYw#|jwxYw)Nzarchive name must be absolutezadded the archive to itself)rdrer1rr&r%rrTrrrr
change_cwdrcrJ)rdstnamerGs   r
test_add_selfzWriteTest.test_add_selfSs''//'*ll7DII.	SXXw3
5GGGS\\^R1
3%%g.
! 
!S\\^R1
3
IIK
!
!

IIKs%	A(D	1C=)D	=DD		Dctjjtd}tj|	dD]7}tjj||}tj|9d}tjt|jd}	|j|d||j|jt5|j|ddd|dddtjtd	}	|D]:}|j|j d
|j|j"d<|jt%|j'd|j	tj(|y#|jwxYw#1swYxYw#|jwxYw#tj(|wxYw)
Nr^)rrbazc|tjj|jdk(ryd|_d|_|S)Nrrqr)rdrebasenamerrr_rs rr^z%WriteTest.test_filter.<locals>.filterms377##GLL1U:! %
rrCrl	empty_dir)arcnamer^Tr_rqrr)rdrerfrcrrcreate_empty_filer&r%rrrrJr	TypeErrorrTrr_rUrr{)rtempdirrr^rGrYs      rtest_filterzWriteTest.test_filteres}'',,w1
	&-
2ww||GT2++D1
2
,,w		KHC
VD		""9-
BdD&A
B,,w,C
";G$$W[[#6$$W]]E:;  S^^%5!6:		W%		
B
B		W%sUA%G!F"5%GF70"GA(G;G"F44G7G<GGGG/Nctjjtd}|st	j
|ntj|tjt|j}	|j|||jtjtd}	|j}|j|st	j|nt	j||j!|j"|xs |j%tj&dy#|jwxYw#|jwxYw)Nrrr_r)rdrerfrcrrrr&r%rrrrJrrirrTrrsep)rrecmp_pathdirrrGrs       r_test_pathnamezWriteTest._test_pathnamesggll7E*'',HHSMll7DII.	GGCG&IIKll7C(	
AIIKS!OOC !FT\\"&&#-FG
IIK
IIKs7E5EEE(ctjjtd}tjjtd}tj|	tjj|d}tjj|d}t|d5}|j
ddddtj||tj
|d5}|j|d|j|ddddtj
|d	5}	|j|d
dddtj|tj|y#1swYxYw#1swYtxYw#t$r|jdYgwxYw#1swYlxYw#tj|tj|wxYw)
Ntestsymlinksztestsymlinks.tarsourcerrz
something
rrvrgrnrz&extractall failed with symlinked files)rdrerfrcrr%rrr&rrmOSErrorrrrir{)rrtemparchivesource_filetarget_filerOrGs       rtest_extractall_symlinksz"WriteTest.test_extractall_symlinkss'',,w7ggll7,>?
	&'',,wx8K'',,wy9Kk#&
'!
&
'JJ{K0k3/
83X6Y7
8ka8
HCHNN*9#;
H
[)W%!
'
'
8
8HIIFGH
H
H
[)W%ssAG+E?=4G1'FG7F79FG?FGFGF41F73F44F77G<G,G/c$|jd|jtjjddd|jtjjddd|jtjjdd|jtjjddd|jtjjdddd|jtjjdddd|jtjjdddd|jtjjdd|jtjjddd|jtjjdddd|jtjjdddd|jdtjztjzdz|jdtjztjzddy)Nr.r..T)r)rrdrerfrrs rtest_pathnameszWriteTest.test_pathnamessE"BGGLLU;<BGGLLe<=BGGLLe45BGGLLeS9:BGGLLeS%@ABGGLLeT5ABBGGLLeT5ABBGGLLu56BGGLLud;<BGGLLuc5ABBGGLLudEBCEBFFNRVV3e;<EBFFNRVV3UErctjdk(r|jddy|jdd|jddy)NrozC:\foorz/fooz///foo)rrwrrs rtest_abs_pathnameszWriteTest.test_abs_pathnamess><<7"	51.%0rc2tjt5tjt
|j}	|jd|jtjt
d}	|D]G}|jdk7s|j|jjd|jI	|j	dddy#|jwxYw#|jwxYw#1swYyxYw)Nrr_z./)rrrcr&r%rrrrJrrr^rrGrs   rtest_cwdzWriteTest.test_cwds

!
!'
*
	,,w		2C
		,,w,C
IAvv}(9(9$(?HI		
	
	
				
	
	sA%D
C#*D
<C87C8	D
#C55D
8D

D

Dc
htttfD]Gfddtj}|}|j5t
jt|j|tjddi}ddd|j|jy#1swY'xYw)NceZdZdZfdZy)8WriteTest.test_open_nonwritable_fileobj.<locals>.BadFileTc0|jr	d|_yNF)first)rrexctypes  rrz>WriteTest.test_open_nonwritable_fileobj.<locals>.BadFile.writeszz%*
%
"rN)rr r!rr)rsrBadFilers
&rrnonr)r.rrl)
rEOFErrorRuntimeErrorr#rrr&r%rrrvrr)rrrOrGrs    @rtest_open_nonwritable_fileobjz'WriteTest.test_open_nonwritable_fileobjs,6
	'G
&"**
&	A""7+
All7DIIq*1*<*<05w/?A
A
QXX&
	'
A
As	9B((B1	r)rr r!rrrrrrrrrrrdrrrrrrrrrrrrr*rrrrs
F($ "",	.XV,:<#<#,""###$"&PH:""&#&4F"1"'rrceZdZy)
GzipWriteTestNrr*rrrrrrrceZdZy)Bz2WriteTestNrr*rrrrrrrceZdZy)
LzmaWriteTestNrr*rrrrrrrceZdZdZdZdZejejdk7xr	e
eddeje
jxse
jddZy)	StreamWriteTestw|Nc>tjt|j}|j	|j
rg|j}ttd5}|j
}ddd|j}|j|jdn.|jt5}|j
}ddd|jjdtjdy#1swYxYw#1swYFxYw)Nrrzfound trailing datarzincorrect zero padding)
r&r%rrrJdecompressorrS
decompressrunused_datarTcountr})rrGdecrZrs     rtest_stream_paddingz#StreamWriteTest.test_stream_paddingsll7DII.		##%Cgt$
#yy{
#>>$'DS__.CD7#
#tyy{
#E*G,>,>0	2
#
#

#
#s!D=DDDroumaskzMissing umask implementationz$Emscripten's/WASI's umask is a stub.ctjjtrt	j
ttjd}	tjt|j}|jtjtjdz}|j|ddtj|y#tj|wxYw)Nrpizwrong file permissions)rdreexistsrrrirr&r%rrJrxryrT)roriginal_umaskrGrs    rtest_file_modezStreamWriteTest.test_file_mode s77>>'"W%%	%,,w		2CIIK777#++e3DT5*BCHH^$BHH^$s
A-CC-)rr r!rrrrrrrwrrdrr
is_emscriptenis_wasirr*rrrrst
FL2 X0IWR5I79X__0.
%	9
%rrceZdZdZy)GzipStreamWriteTestctjt|jj	tjtjd}tjjt|vsJy)zf
        Ensure the source directory is not included in the tar header
        per bpo-41316.
        zlatin-1rlN)r&r%rrrJrr	read_textrdredirname)rpayloads  r test_source_directory_not_leakedz4GzipStreamWriteTest.test_source_directory_not_leaked7sV
	Wdii(..0,,w'1191Ewww'w666rN)rr r!rr*rrrr6s7rrc.eZdZer
ejZydZy)Bz2StreamWriteTestN)rr r!r4BZ2Decompressorrr*rrrrAs*-3&&L4Lrrc.eZdZer
ejZydZy)LzmaStreamWriteTestN)rr r!r<LZMADecompressorrr*rrrrDs,04((LdLrrc"eZdZdZdZdZdZy)_CompressedWriteTestsFAnd we move to Bristol where they have a special, Very Silly candidatec,tj}tjt|j
||5}|j
tjdtj|jddd|S#1swY|SxYw)Nrr)	r#rr&r%rrrrr)rrrZtarfls    r_compressed_tarz$_CompressedWriteTest._compressed_tarMsnzz|
\\'499d(57	K:?MM'//%0"**T[[2IJ	K	KsAB		Bcr|j|}|j|jddd|zy)NrrusBZh%d1AY&SYrrTrrrrZs   r_test_bz2_headerz%_CompressedWriteTest._test_bz2_headerTs7##M22.'-7	9rcl|j|}|j|jdddy)Nrsrrs   r_test_gz_headerz$_CompressedWriteTest._test_gz_headerYs/##M2!,o>rN)rr r!rrrrr*rrrrGs&F9
?rrceZdZdZdZy)Bz2CompressWriteTestrcj|jd|jd|jdyNrs	rrs rtest_compression_levelsz,Bz2CompressWriteTest.test_compression_levels_,a a a rNrr r!rrr*rrr
r
]s
F!rr
ceZdZdZdZy)Bz2CompressStreamWriteTestrcj|jd|jd|jdyrrrs rrz2Bz2CompressStreamWriteTest.test_compression_levelsgrrNrr*rrrrds
F!rrceZdZdZdZy)GzCompressWriteTestrcj|jd|jd|jdyrrrs rrz+GzCompressWriteTest.test_compression_levelsn,QQQrNrr*rrrrls
F rrceZdZdZdZy)GzCompressStreamWriteTestrcj|jd|jd|jdyrrrs rrz1GzCompressStreamWriteTest.test_compression_levelsvrrNrr*rrrrss
F rrc@eZdZdZej
dZy)CompressLevelRaisescd}tj}|jt5t	j
td||dddy#1swYyxYw)Nr
rr)r#rrrr&r%rrs   rtest_compresslevel_wrong_modesz2CompressLevelRaises.test_compresslevel_wrong_modes|sK
zz|


y
)	KLL$MJ	K	K	KsAActj}|jt5t	j
td|dddd|jt5t	j
td|dddd|jt5t	j
td|ddddy#1swYxYw#1swYQxYw#1swYyxYw)Nzw:bz2rrruzw|bz2)r#rrrJr&r%rrs  rtest_wrong_compresslevelsz-CompressLevelRaises.test_wrong_compresslevelsszz|


z
*	BLL'4qA	B


z
*	CLL'4rB	C


z
*	CLL'4rB	C	C		B	B	C	C	C	Cs#C%C CCCC(N)rr r!r!rrequires_bz2r#r*rrrr{s)KWCCrrcXeZdZdZddZddZdZdZdZdZ	d	Z
d
ZdZdZ
d
Zy)GNUWriteTestc.t|dzdz}|dzS)Nrwrs)rU)rr|blockss   r_lengthzGNUWriteTest._lengthsQ3"|rNcd}t|tjkDr|dz
}||j|z
}|5t|tjkDr|dz
}||j|z
}|S)Nrw)rUr&LENGTH_NAMEr)LENGTH_LINK)rrrdrs    r
_calc_sizezGNUWriteTest._calc_sizesmt9w***SLET\\$''ED	G,?,? ?SLET\\$''Erctj|}|r||_tj|_tj
td}	tj|_|j||j||}|j}|j||d|jtj
t}	|j}|j|d|j|j |j d|j|j|jd|jy#|jwxYw#|jwxYw)Nrz%GNU longname/longlink creation failedzunable to read longname member)r&rrLNKTYPErTr%rrerrr-rNrTrJrrr)rrrdrYrGrrmembers        r_testzGNUWriteTest._tests//$'#G"??GLll7C(	 ++CJKK t,BBR%LMIIKll7#		XXZF  4
6W\\6;;4
6W--v4
6
IIK
IIK
IIKsAEA0E&E#&E8c&|jdy)Nlongnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnamr1rs rtest_longname_1023zGNUWriteTest.test_longname_1023s

12rc&|jdy)Nlongnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnamer4rs rtest_longname_1024zGNUWriteTest.test_longname_1024s

23rc&|jdy)Nlongnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longnam/longname_r4rs rtest_longname_1025zGNUWriteTest.test_longname_1025s

34rc(|jddy)Nrlonglnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnkr4rs rtest_longlink_1023zGNUWriteTest.test_longlink_1023s

69:rc(|jddy)Nrlonglnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlinkr4rs rtest_longlink_1024zGNUWriteTest.test_longlink_1024s

6:;rc(|jddy)Nrlonglnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlnk/longlink_r4rs rtest_longlink_1025zGNUWriteTest.test_longlink_1025s

6;<rc(|jddy)Nr3r=r4rs rtest_longnamelink_1023z#GNUWriteTest.test_longnamelink_1023s

11	3rc(|jddy)Nr7r@r4rs rtest_longnamelink_1024z#GNUWriteTest.test_longnamelink_1024s

22	4rc(|jddy)Nr:rCr4rs rtest_longnamelink_1025z#GNUWriteTest.test_longnamelink_1025s

33	5rr)rr r!r)r-r1r5r8r;r>rArDrFrHrJr*rrr&r&s>:345;<=345rr&ceZdZdZdZy)DeviceHeaderTestrc8tjjtd}tj|	tjt|j}	tjd}tjd}t
j|_t
j|_|j||j||jtjtd}	|jd}|jd}|j|j!|j"d|j!|j$d|j!|j"d|j!|j$dt
td5}|j'}ddd|j(|j*}	||j(|j*}
t-dd	}|j!|	|d
|j!|
|dt/j0|y#|jwxYw#|jwxYw#1swYxYw#t/j0|wxYw)Ndevice_header_testmy_block_devicermy_regular_filer_rrriIiYs00000000000000s)rdrerfrcrr&r%rrrBLKTYPErTREGTYPErrJrQrTrrrSrNoffset_dataslicerr{)rrrG	input_blk	input_reg
output_blk
output_reginfilerbuf_blkbuf_regdevice_headerss            r*test_headers_written_only_for_device_filesz;DeviceHeaderTest.test_headers_written_only_for_device_filess'',,w(<=
#	&,,w		2C
#OO1BC	#OO1BC	!(	!(	I&I&		,,w,C
 ]]+<=
 ]]+<=
		Z00!4Z00!4Z00!4Z00!4gt$
$kkm
$*++J,B,BCG*++J,B,BCG#31NW^46FGW^4jAW%3				
$
$
W%sV$J A8I*J"I!%BJ5I6A0JIJ!I33J6I?;JJN)rr r!rr^r*rrrLrLs
F'&rrLceZdZdZej
j
edZdZ	e
dZe
dZdZ
dZdZd	Zd
ZdZy)
CreateTestzx:
spameggs42c6tjtyr)rrirrs rrHzCreateTest.setUps!rc|t|jd5}|jddddy#1swYyxYw)Nrr)r%	file_pathr)clsrZs  r
setUpClasszCreateTest.setUpClasss3
#--
&	$JJv			s2;cBtj|jyr)rrirdres r
tearDownClasszCreateTest.tearDownClasss'rctjt|j5}|j	|j
ddd|j
t5}|j}ddd|jtd|jd|dy#1swYhxYw#1swYFxYwNrsrar)r&r%rrrrdr(rrTrUrrtobjnamess   rtest_createzCreateTest.test_creates
\\'499
-	%HHT^^$	%\\'
"	$dMMOE	$UQ'

lE!H-
	%	%	$	$sB(B4(B14B=ctjt|j5}|j	|j
ddd|j
t5tjt|j}ddd|jt5}|j}ddd|jtd|jd|dy#1swYxYw#1swYtxYw#1swYRxYwrk)
r&r%rrrrdrFileExistsErrorr(rrTrUrrls   rtest_create_existingzCreateTest.test_create_existing(s
\\'499
-	%HHT^^$	%


/	4<<3D	4\\'
"	$dMMOE	$UQ'

lE!H-	%	%	4	4	$	$s#C*%C6 D*C36C?Dcd|jtd5}|j|jddd|jt5}|j	}ddd|jt
d|jd|dy#1swYhxYw#1swYFxYwNxrsrar)r(rrrdrrTrUrrls   rtest_create_taropenzCreateTest.test_create_taropen4s
\\'3
'	%4HHT^^$	%\\'
"	$dMMOE	$UQ'

lE!H-
	%	%	$	$sBB&B#&B/c|jtd5}|j|jddd|j	t
5|jtd5	dddddd|jt5}|j
}ddd|jtd|jd|dy#1swYxYw#1swY|xYw#1swYxYw#1swY^xYwrt)
r(rrrdrrqrrTrUrrls   rtest_create_existing_taropenz'CreateTest.test_create_existing_taropen=s
\\'3
'	%4HHT^^$	%


/	gs+

	\\'
"	$dMMOE	$UQ'

lE!H-	%	%

			$	$s;CC0'C$)C0C<C!$C-	)C00C9<Dctjtjt|j
5}|j
|jt|j|jtjjt|jtj|j|j}ddd|jt!d|j#d|d|j%t5}|j}ddd|jt!|d|j#d|dy#1swYxYw#1swYFxYwrk)r&r%rrrrr/rr0rTrdrer1rrdrrUrr(rls   rtest_create_pathlike_namez$CreateTest.test_create_pathlike_nameJs	
\\',,w/
;	$t!!$))S1TYY(@AHHW\\$..12MMOE		$
	
UQ'

lE!H-
\\'
"	$dMMOE	$UQ'

lE!H-	$	$	$	$sBE+!E7+E47Fc|jtjtd5}|j	|j
t|j|j
tjjt|jtj|j|j}ddd|jtd|jd|d|jt5}|j}ddd|jt|d|jd|dy#1swYxYw#1swYFxYwrt)r(rrrr/rr0rTrdrer1rrdrrUrrls   r!test_create_taropen_pathlike_namez,CreateTest.test_create_taropen_pathlike_nameXs
\\',,w/
5	$!!$))S1TYY(@AHHW\\$..12MMOE		$
	
UQ'

lE!H-
\\'
"	$dMMOE	$UQ'

lE!H-	$	$	$	$sBEE)E&)E2N)rr r!rrdrerfrcrdrHclassmethodrfrirorrrvrxrzr|r*rrr`r`
sf
FWl3I"((.
.....rr`ceZdZdZy)GzipCreateTestctjt|jd5}|j	|j
dddtjtdd5}	dddy#1swY0xYw#1swYyxYw)Nrsrzr:gzr&r%rrrrdrrms  rtest_create_with_compresslevelz-GzipCreateTest.test_create_with_compresslevelisl
\\'499A
>	%$HHT^^$	%
\\'6
;	t			%	%		A2'A>2A;>BNrr r!rr*rrrrgrrceZdZdZy)
Bz2CreateTestctjt|jd5}|j	|j
dddtjtdd5}	dddy#1swY0xYw#1swYyxYw)Nrsrr:bz2rrs  rrz,Bz2CreateTest.test_create_with_compresslevelrsl
\\'499A
>	%$HHT^^$	%
\\'7!
<				%	%		rNrr*rrrrprrrceZdZdZy)LzmaCreateTestctjt|jd5}|j	|j
dddy#1swYyxYw)Nrs)presetrrs  rtest_create_with_presetz&LzmaCreateTest.test_create_with_preset}s=
\\'499Q
7	%4HHT^^$	%	%	%sAAN)rr r!rr*rrrrys%rrceZdZdZdZdZy)CreateWithXModeTestruN)rr r!rrvrxr*rrrrs
F#' rrrdrec*eZdZdZdZdZdZdZy)HardlinkTestcRtjjtd|_tjjtd|_t
|jd5}|jdddd	tj|j|j
tjtd|_
|jj|jy#1swYyxYw#t$r}|jd|zYd}~sd}~wwxYw)Nrrrfoorr)rdrerfrcrrr%rrdrrr&rrGr)rrZrs   rrHzHardlinkTest.setUps77<</77<</
$((D
!	TJJv		/GGDHHdhh'<<-TXX		
	/MM/A-..	/s$)C3*C?3C<?	D&D!!D&c|jjtj|jtj|j
yr)rGrJrrirrrs rrKzHardlinkTest.tearDowns4""rc|jj|j}|j|jt
jdy)Nzadd file as regular failed)rGrrrTrTr&rSrVs  rtest_add_twicezHardlinkTest.test_add_twices9((%%dhh/w,	.rc|jj|j}|j|jt
jdy)Nzadd file as hardlink failed)rGrrrTrTr&r/rVs  rtest_add_hardlinkzHardlinkTest.test_add_hardlinks7((%%dhh/w-	/rcd|j_|jj|j}|j	|j
tjdy)NTzdereferencing hardlink failed)rGdereferencerrrTrTr&rSrVs  rtest_dereference_hardlinkz&HardlinkTest.test_dereference_hardlinksC#((%%dhh/w/	1rN)rr r!rHrKrrrr*rrrrs
#
./
1rrc&eZdZddZdZdZdZy)PaxWriteTestNcptj|}|r||_tj|_tj
tdtj}	|j||jtj
t}	|r1|jdj}|j||dn0|jdj}|j||d|jy#|jwxYw#|jwxYw)NrrrzPAX longlink creation failedzPAX longname creation failed)
r&rrr/rTr%rrvrrJrrTr)rrrdrYrGlns       rr1zPaxWriteTest._tests//$'#G"??GLll7C0B0BC	KK IIKll7#	NN$Q'00  q*HINN$Q',,  q*HIIIK
IIK
IIKsDA#D#D #D5cxdddddd}tjtdtj|}	|j	tj
d|j
tjtd	
}	|j|j||j|jdj||jjD]o\}}|jt|t|jt|t|tjvsW	tj||q	|j
y#|j
wxYw#tt f$r|j#dYwxYw#|j
wxYw)
Nr0z1.23äöütest)rrr]rrr)rrlrCrlrz"unable to convert pax header field)r&r%rrvrrrJrTrlrrassertIsNotrTrBPAX_NUMBER_FIELDSrrJr)rrlrGkeyvals     rtest_pax_global_headerz#PaxWriteTest.test_pax_global_headers`& &(ll7C0B0B')	KK/0IIKll7[9
	S__k:S^^-a0<<kJOO113
HS  cE2  cE2'333H11#6s;
H
IIK#
IIK&z2H		"FGH
IIKs<$E,B9F'FF',E> F$!F'#F$$F''F9ctddd}tjtdtjd}	tj}d|_d|_||_|j||jtjtd	}	|jd
}|j|j||j|j
d|j|jd|jy#|jwxYw#|jwxYw)Nr123)rerrrCrrErrlrrq)r&r%rrvrrrrlrrJrrT)rrlrGrs    rtest_pax_extended_headerz%PaxWriteTest.test_pax_extended_headers %U3ll7C0B0B$/1	!A#AFAE'AMKKNIIKll7[9	 #AQ]]K8QVVU+QUUC(IIK
IIK
IIKs:DA'D%D"%D7c.tj}d|_d|_d|_d|_d|_|j}|j|d}|j|dd|j|d	t|j|d	d
|j|dd|j|dd|j|d
d|j|dtdzdztdzdztdzdztdzdztdzdztdzdztdztj}d|_d|_d|_d|_d|_|j}|j|d}|j|dd|j|d	d|j|dd|j|dd|j|d
d|j|dtdzdztdzdztdzdzdzd ztd!zd"ztd#zd$ztdzdztdzy)%Nrg@@rrq|rCrlrr]rrVrrs././@PaxHeaderVs90000000000000000000000000000002000000000000010205 xsustar00s16 mtime=1000.1
iras90000644000017300001740000000014400000001750006516 0ufoo㍴ld(	rirs90000000000000000000000000000013000000000000010207 xs15 path=foo㍴
16 uid=16777216
s$16 gid=16777217
20 size=10000000000
s21 mtime=10000000000
isfoo?`s90000644000000000000000000000000000000000000006540 0)
r&rrr]rVrrrcreate_pax_headerrTr/r=rB)rrinfoheaders    rtest_create_pax_headerz#PaxWriteTest.test_create_pax_headers
OOzz|$$TK$@fu-d7mS1g-fs+ec*ec*b	)\
]Cj
)
*+0:
6#
#&+3Z
039
9<A9
E]	
]
Cj

*
*
-2#J
7	8
OOzz|$$TK$@f{3g*fq)ea(ea(b	)\
]Cj
)
*,1#J
7<
<8	
8
(
(
*/s
4
7>
>
AFb	
J]

]Cj
*
*-2#J
7	8rr)rr r!r1rrrr*rrrrs0@258rrc6eZdZdZdZdZdZdZdZdZ	y)	UnicodeTestc&|jdy)NrC_test_unicode_filenamers rtest_iso8859_1_filenamez#UnicodeTest.test_iso8859_1_filenameBs##K0rc&|jdy)Nutf7rrs rtest_utf7_filenamezUnicodeTest.test_utf7_filenameEs##F+rc&|jdy)Nutf-8rrs rtest_utf8_filenamezUnicodeTest.test_utf8_filenameHs##G,rctjtd|j|d}	d}|j	tj
||j
tjt|}	|j|jdj||j
y#|j
wxYw#|j
wxYw)NrrErrEerrorsrrlr)
r&r%rrrrrJrTrr)rrErGrs    rrz"UnicodeTest._test_unicode_filenameKsll7C$,X?	!DKK-.IIKll7X6	S^^-a055t<IIK

IIK
IIKs&B:<-C:CC!cvtjtd|jdd}	tj}d|_|j
t|j|d|_d|_	|j
t|j||jy#|jwxYw)NrrrErrr)r&r%rrrrrUnicodeErrorrr_rJrns   rtest_unicode_filename_errorz'UnicodeTest.test_unicode_filename_errorZsll7C$+H>
	oo'G)GLlCKKA GL*GMlCKKAIIKCIIKsA+B&&B8ctjtddd}	|D]}|jt	|j
t|jt	|jt|jt	|jt|jt	|jt	|jy#|jwxYw)Nr_rCrErEr)r&r%r"assertIsrTrr0rr_rrJrs   rtest_unicode_argumentz!UnicodeTest.test_unicode_argumentisll7C$/B	
2

d166lC0

d1::.4

d177mS1

d177mS1	
2
IIKCIIKsB+CC.c<tjd}d|_d|_tjt
d|jd}	|j||jtjt
d}	|jd}|j|jd|j|jd|jtjk7rt|jtjt
d}|jd}|j|jd|j|jd|jy#|jwxYw#|jwxYw)	NrrrrC)rrrErlru	)r&rr_rr%rrrrJrQrTrv)rrrGs   rtest_uname_unicodezUnicodeTest.test_uname_unicodeus"OOE"  ll7T[[$/1	KKNIIKll7[9	

e$AQWWn5QWWn5{{g000		ll7W=MM%(  *>?  *>?IIK
IIK
IIKsE4	CF	4F	FN)
rr r!rrrrrrrr*rrrr@s%1,-


rrcdeZdZejZdZdZdZdZ	dZ
dZddZd	Z
d
ZddZy)
UstarUnicodeTestc|jd|jdt|jd|jdtyNre01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890ud01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567ÿue012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678ÿ_test_ustar_namerJrs rtest_unicode_name1z#UstarUnicodeTest.test_unicode_name1B/05zB?@@*MrcR|jd|jdtyNud012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345ÿÿue0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456ÿÿrrs rtest_unicode_name2z#UstarUnicodeTest.test_unicode_name2"ABBJOrc|jd|jdt|jd|jdty)Na01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789a0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123/40123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789u012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012ÿ/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789u0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123ÿ/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789rrs rtest_unicode_longname1z'UstarUnicodeTest.test_unicode_longname1sDNONPZ[PQQS]^rc\|jdt|jdty)Nu01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901ÿ/20123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789u01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901ÿÿ/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789rrs rtest_unicode_longname2z'UstarUnicodeTest.test_unicode_longname2s&PR\]SU_`rc~|jdt|jd|jdty)Nu01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901ÿÿ/20123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789u01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567ÿu01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678ÿrrs rtest_unicode_longname3z'UstarUnicodeTest.test_unicode_longname3s5TV`a^__aklrcR|jd|jdty)Nu01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345ÿÿu01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456ÿÿrrs rtest_unicode_longname4z'UstarUnicodeTest.test_unicode_longname4s#`aacmnrNctjtd|jd5}tj|}||j|n|j
||j
|ddd|Jtjtdd5}|D]}|j||jndddyy#1swYVxYw#1swYyxYw)Nrrrr_rl)	r&r%rrrrrrTrrrexcrGrs     rrz!UstarUnicodeTest._test_ustar_names
\\'3t{{W
M	7QT%A{A!!#s{{A6	7;gsW=
A$$T1662

	7	7

sAC%CC
Cc|jd|jdt|jd|jdtyr_test_ustar_linkrJrs rtest_unicode_link1z#UstarUnicodeTest.test_unicode_link1rrcR|jd|jdtyrrrs rtest_unicode_link2z#UstarUnicodeTest.test_unicode_link2rrctjtd|jd5}tjd}||_||j
|n|j||j|ddd|Jtjtdd5}|D]}|j||j
ndddyy#1swYVxYw#1swYyxYw)Nrrrrr_rl)	r&r%rrrrrrrTrs     rrz!UstarUnicodeTest._test_ustar_links
\\'3t{{W
M	7QT&AAJ{A!!#s{{A6
	7;gsW=
A$$T1::6

	7	7

sAC%CCC r)rr r!r&rrrrrrrrrrrrr*rrrrsG

!
!F
NP_am
oNP
rrc*eZdZejZdZy)GNUUnicodeTestcdD]<\}}tjt|d5}	|j|}ddd>y#t$r|jdY'wxYw#1swYixYw)N))rupax/bad-pax-)rCupax/bad-pax-äöürrz%unable to read bad GNU tar pax headerr&r%r"rQrYrrrErrGrs     rtest_bad_pax_headerz"GNUUnicodeTest.test_bad_pax_headers<	GNHdg%68
G;>G

d+A
G
G	G GIIEFG	
G
G(A#AA A#A  A##A,	N)rr r!r&rerrr*rrrrs


FGrrc.eZdZejZdZdZy)PAXUnicodeTestNcdD]<\}}tjt|d5}	|j|}ddd>y#t$r|jdY'wxYw#1swYixYw)N))rupax/hdrcharset-)rCupax/hdrcharset-äöürrz)unable to read POSIX.1-2008 binary headerrrs     rtest_binary_headerz!PAXUnicodeTest.test_binary_headers?	KNHdg%68
K;>K

d+A
K
K	K KIIIJK	
K
Kr)rr r!r&rvrrrr*rrrrs


F#'
Krrc eZdZdZddZdZy)AppendTestBasect|_tjj	|jr tj|jyyr)rr"rdrerrrirs rrHzAppendTestBase.setUp		s4
77>>$,,'T\\*(rcntjtd5}|jd}d|_|j|5}tj|j|5}|j
||dddddddddy#1swYxYw#1swYxYw#1swYyxYw)NrCrlrOr)r&r%r"rQrrRr)rrsrcrrOrGs      r_create_testtarzAppendTestBase._create_testtar	s
\\'K
8	&C

o.AAF#
&q\\$,,5&KK1%&
&	&	&&&
&
&	&	&s;*B+!B'B:BB+BBB(	$B++B4c|jd|jz|jtjtj
tdy)Nrr)rrrr&rr%rrs rtest_append_compressedz%AppendTestBase.test_append_compressed	s7TDKK/0'++W\\7CHrN)r)rr r!rHrrr*rrrr	s+
&IrrcheZdZdZddZdgdfdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZy)
AppendTestNctj|jd|5}|jtjddddy#1swYyxYw)Nrrr)r&r%r"rr)rr.rGs   r
_add_testfilezAppendTest._add_testfile	sB
\\$,,W
=	0KK./	0	0	0s%AArctj|j|5}|j|j	|dddy#1swYyxYw)Nr)r&r%r"rTr)rrnr.rGs    rr1zAppendTest._test!	sA
\\$,,
8	4CS\\^U3	4	4	4s!AAcD|j|jyr)r	r1rs rtest_non_existingzAppendTest.test_non_existing%	s

rctj|jdj|j	|jy)Nr)r&r%r"rJr	r1rs r
test_emptyzAppendTest.test_empty)	s2T\\4(..0

rctjd}|j||jd|j	|y)Nsrr)r#rr	rxr1rs  rtest_empty_fileobjzAppendTest.test_empty_fileobj.	s7zz,'4 		!

4
 rc2|jt|jd5}|j}dddt	j
}|j
||jd|jddg|y#1swYVxYw)Nrrrrr)rnr.)	rr%r"rSr#rr	rxr1rs   rtest_fileobjzAppendTest.test_fileobj4	sy
$,,
%	99;D	zz$4 		!

%
6		sB

Bcl|j|j|jddgy)Nrr)rn)rr	r1rs r
test_existingzAppendTest.test_existing=	s,

%
(rct|jd5}|j|ddd|jtj
|jy#1swY4xYwr)r%r"rrr&rr	)rrrZs   r_test_errorzAppendTest._test_errorD	sO
$,,
%	JJt	'++T-?-?@		sAA%c&|jdy)Nrrrs r	test_nullzAppendTest.test_nullI	src&|jdy)N
rrs rtest_incompletezAppendTest.test_incompleteL	$rcltjdj}|j|y)Nrr&rrrrrs  rtest_premature_eofzAppendTest.test_premature_eofO	s'u%++-rcrtjdj}|j|dzy)Nrrrr s  rtest_trailing_garbagez AppendTest.test_trailing_garbageS	s,u%++-
*+rc&|jdy)Nsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarrs rtest_invalidzAppendTest.test_invalidW	rrr)rr r!rr	r1rrrrrrrrr!r#r%r*rrrr	sS!0!'44
!7)A
%,%rrceZdZy)GzipAppendTestNrr*rrr'r'Z	rrr'ceZdZy)
Bz2AppendTestNrr*rrr)r)]	rrr)ceZdZy)LzmaAppendTestNrr*rrr+r+`	rrr+ceZdZdZdZdZy)
LimitsTestctjd}|jtjtjd}|j	t
|jtjtjd}|jtjtjd}|j	t
|jtjtjd}|j	t
|jtjtjd}d|_|j	t
|jtjtjd}d|_|j	t
|jtjy)	Nrra123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longnamea1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/1234567/longname123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/123/longnamer@r )r&rrrrrJrrrVs  rtest_ustar_limitszLimitsTest.test_ustar_limitsf	s4//"34

g**+//"9:*gmmW5I5IJ//":;

g**+//">?*gmmW5I5IJ//";<*gmmW5I5IJ//*-4*gmmW5I5IJ//&) *gmmW5I5IJrcxtjd}|jtjtjd}d|_|jtjtjd}d|_|j
t|jtjyNr/r@rl)r&rrrerrrrJrVs  rtest_gnu_limitszLimitsTest.test_gnu_limits	s~//";<

g(()//*-4

g(()//&)+*gmmW5G5GHrcXtjd}|jtjtjd}d|_|jtjtjd}d|_|jtjyr3)r&rrrvrrrVs  rtest_pax_limitszLimitsTest.test_pax_limits	sr//";<

g(()//*-4

g(()//&)+

g(()rN)rr r!r1r4r6r*rrr-r-d	sK>I
*rr-c0eZdZdZdZdZdZdZdZy)MiscTestc@|jtjddddd|jtjddddd|jtjdddd|jtjd	dddy)
NrrrEsfoofoobarrrsfoobar)rTr&stnntsrs rtest_char_fieldszMiscTest.test_char_fields	sUAwA)	+Xq'8D	!%5wI	 ]GXF	 rc|jtjdd|jtjdd|jtjdd|jtjdd|jtjd	d
|jtjdd|jtjd
d|jtjdd|jtjddy)N0000001rs7777777 r0rbrrs       )rTr&ntirs rtest_read_number_fieldsz MiscTest.test_read_number_fields	s	
^4a8^4i@%HI#	%%HI#	%%HI	%HI	%HI+	-	
U+Q/\2A6rc|jtjdd|jtjdd|jtjdtjd|jtjdtjd	|jtjd
tjd|jtjdtjd
|jtjdtjd|jtjdtjd
|jtjdtjd|jtjtjdtjdy)Nrsr@rBrAr0rrCrErDrbrFrHrGrJrIgYg0Bsgr)rTr&itnrerKrs rtest_write_number_fieldsz!MiscTest.test_write_number_fields	saQ8Y/@Z8J8JK<	>Z8J8JK<	>R0B0BC<	>T'2D2DE<	>%7,3,>,>@<	>	
VG4F4FG<	>]7;M;MN<	>W[[g>P>P%QRTUVrc||jt5tjddtjddd|jt5tjddtjddd|jt5tjddtj
ddd|jt5tjddtj
dddy#1swYxYw#1swYxYw#1swYexYw#1swYyxYw)Nrbr:r0ll)rrJr&rNrrers rtest_number_field_limitsz!MiscTest.test_number_field_limits	s


z
*	5KKAw334	5


z
*	=KK
Aw';';<	=


z
*	?KK7+=+=>	?


z
*	>KK
q'*<*<=	>	>
	5	5	=	=	?	?	>	>s/&D&D&D&&D2DD#&D/2D;cDhd}tj|t|y)N>/NULgrprNrKr=pwdr<mainrRCHRTYPErUr/rSSYMTYPEXGLTYPEruversionAREGTYPECONTTYPEFIFOTYPEfilemoder~	GNU_MAGIC	GNU_TYPES
PAX_FIELDSr}r,r+POSIX_MAGICcopyfileobjExFileObjectcalc_chksums
LENGTH_PREFIX
REGULAR_TYPESEOFHeaderErrorGNUTYPE_SPARSEPAX_NAME_FIELDSSOLARIS_XHDTYPESUPPORTED_TYPESEmptyHeaderErrorGNUTYPE_LONGLINKrdrsymlink_exceptionInvalidHeaderErrorTruncatedHeaderErrorSubsequentHeaderError)not_exported)rcheck__all__r&)rrts  rtest__all__zMiscTest.test__all__	s=	T7Frc,tjjtjjtd}|jtj5}t
jdf}tjjjtjd|5t
j|dddddd|jdt!j"y#1swY7xYw#1swY;xYw)Nrzlzma module is not availabler>)rz?
- method xz: CompressionError('lzma module is not available')
)rdrerfr__file__rr&rCompressionErrorrrrrr'r%rr0	exception)rfnameexcinfors    r.test_useful_error_message_when_modules_missingz7MiscTest.test_useful_error_message_when_modules_missing	sRWW__X68HI


w00
1	$W,,-KLME$$++GOOXSX+Y
$U#
$	$
	


O!!"	

$
$	$	$s%!AD
2C>D
>D	D

DN)	rr r!r>rLrOrRrvr}r*rrr8r8	s" 7(W.>
G

rr8ceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZy)CommandLineTestctjddg|i|\}}}|jtjjdS)N-mr&
)r	assert_python_okrrdlinesepr)rargsrrcrerrs      r
tarfilecmdzCommandLineTest.tarfilecmd	sL$55dI@@8>@C{{2::,,.66rc0tjddg|S)Nrr&)r	assert_python_failure)rrs  rtarfilecmd_failurez"CommandLineTest.tarfilecmd_failure
s224JTJJrc^tjdtjdg}|jtj|tj|d5}|D]2}|j|tjj|4	dddy#1swYyxYw)Ntokenize_tests.txt9tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txtrr)rr!rhrrir&r%rrdrer)rtar_namefilesrtardatas     rmake_simple_tarfilez#CommandLineTest.make_simple_tarfile
s!!"67!!#>?@	
	(((3
\\(C
(	CB 
Cw(8(8(AB
C	C	C	Cs!8B##B,ctjdg}|jtj|tj|d5}tjd}|j|tjdtjd}|j|tjddddy#1swYyxYw)Nrrbenignrr../evil)rr!rhrrir&r%rrr#r)rrrrrevils      rmake_evil_tarfilez!CommandLineTest.make_evil_tarfile
s!!"678	(((3
\\(C
(	6B__X.FJJvrzz#J7??9-DJJtRZZ_J5		6	6	6s

A7C

Cc|j\}}}|j|d|jd|j|jd|j|jd|j|jdd\}}}|j|d|j	|jdy)Nrsusageserrorsrequired-lr)rrTrlowerr=strip)rrrrs    rtest_bad_usezCommandLineTest.test_bad_use
s..0Cc"

h		,

h		,

k399;/..tR8Cc"CIIK-rcptD]-}dD]&}|j||}|j|d(/y)N)-tz--testr)testtarnamesrrTrroptrs    rtest_test_commandz!CommandLineTest.test_test_command"
s@$	+H%
+ooc84  c*
+	+rcvtD]0}dD])}|j|d|d}|jd|+2y)N-vz	--verboserrPYTHONIOENCODINGsis a tar archive.
)rrrrs    rtest_test_command_verbosez)CommandLineTest.test_test_command_verbose(
sL$	;H(
;ooc47>&@

4c:
;	;rctjd}|jd|\}}}|jd||j	|d|j	|dt
D]}|j
|5t|d5}|j}ddd	ttd5}|jdd	ddd|jdt\}}}|j	|d|j	|dtjt	dddy#1swYxYw#1swYxxYw#tjtwxYw#1swYxYw)
N
zipdir.zipr is not a tar archive.rrs)rrrrrp)
rr!rrrTrsubTestr%rSrrrri)rzipnamerrrrrOrs        rtest_test_command_invalid_filez.CommandLineTest.test_test_command_invalid_file/
sK""<0..tW=C

/5c"Q$	.Hx0

.(D)$Q668D$.gt,,Tc
+,#'#:#:4#ILBS$$S#.$$R+$$W-

.

.	.$$,,$$W-

.

.sU=
E*
D4E*$E4E	AEE*4D=9E*E	EE''E**E4	ctD]}tj5}tj|d5}|jdddddddj
jdd}dD](}|j||d}|j||*y#1swYaxYw#1swYexYw)Nr_Frrr)rz--listr
rrcaptured_stdoutr&r%rorrrrTrrrrexpectedrrs       rtest_list_commandz!CommandLineTest.test_list_commandC
s$	0H((*
+a\\(C0+BGGEG*+
+zz|**74FGH%
0ooc87>&@  h/
0	0++
+
+s"B4B(B4(B1-B44B=	ctD]}tj5}tj|d5}|jdddddddj
jdd}dD])}|j|d|d}|j||+y#1swYbxYw#1swYfxYw)	Nr_Trrrrrrrrs       rtest_list_command_verbosez)CommandLineTest.test_list_command_verboseN
s$	0H((*
*a\\(C0*BGGDG)*
*zz|**74FGH(
0ooc47>&@  h/
0	0**
*
*s"B5B)B5)B2.B55B>	ctjd}|jd|\}}}|jd||j	|d|j	|dy)Nrrrrrs)rr!rrrTrrrrrs     rtest_list_command_invalid_filez.CommandLineTest.test_list_command_invalid_fileY
sY""<0..tW=C

/5c"Qrctjdtjdg}dD]x}	|j|tg|}|j	|dtjt5}|jdddtjtzy#1swY%xYw#tjtwxYw)Nrr)-cz--creater)
rr!rrrTr&r%rrrirrrrrGs     rtest_create_commandz#CommandLineTest.test_create_command`
s!!"67!!#>?@$	*C
*%dooc7;U;  c*\\'*%cNN$%  )	*%%  )s$AB54B)B5)B2	.B55Cctjdtjdg}dD]|}	|j|dtg|ddi}|j	d|tjt5}|jdddtjt~y#1swY%xYw#tjtwxYw)Nrrrrrrs file created.)
rr!rrrr&r%rrrirs     rtest_create_command_verbosez+CommandLineTest.test_create_command_verbosem
s!!"67!!#>?@%	*C
*%dooc4@5@7>@

/5\\'*%cNN$%  )	*
%%  )s$AB98B-	B9-B6	2B99Ccptjdg}	|jdtg|}|j	|dtjt5}|jdddtjty#1swY#xYw#tjtwxYw)Nrrr)
rr!rdotlessnamerTr&r%rrri)rrrrGs    r$test_create_command_dotless_filenamez4CommandLineTest.test_create_command_dotless_filename{
s!!"678	*!$//$<e<CS#&k*
!c 
!
[)
!
!
[)s$ABB,BBBB5ctjjtd}t	j
dg}	|jd|g|}|j|dtj|5}|jdddtj|y#1swYxYw#tj|wxYw)Nz.testtarrrr)
rdrerfrcrr!rrTr&r%rrri)rrrrrGs     r(test_create_command_dot_started_filenamez8CommandLineTest.test_create_command_dot_started_filename
s77<<4!!"678	'!$//$959CS#&h'
!3 
!
X&
!
!
X&s#;B27B&B2&B/+B22C	ctjdtjdg}tttfD]y}|j
s	tdz|jz}|jd|g|}|j|5}|jdddtj|{y#1swY!xYw#tjwxYw)Nrrrr)
rr!r,r3r9r%rrrr(rrri)rrfiletyperrrGs      rtest_create_command_compressedz.CommandLineTest.test_create_command_compressed
s!!"67!!#>?@"7H5		+H==
+"S=8??:%doodH=u=%%h/%3NN$%  *		+%%  *s$
;CB9C9C	>CCcX|jtdD]f}	tjt5|j|t}ddd|j
dtjthy#1swY7xYw#tjtwxYw)N)-ez	--extractrrrrr	tarextdirrrTr{rrrs   rtest_extract_commandz$CommandLineTest.test_extract_command
s  )$	,C
,''	28//#w7C8  c*  +
	,88  +s"BBBB	BB)c^|jtdD]i}	tjt5|j|dtd}ddd|j
dtjtky#1swY7xYw#tjtwxYw)Nrrrr file is extracted.)rrrrrrrr{rs   rtest_extract_command_verbosez,CommandLineTest.test_extract_command_verbose
s  )$	,C
,''	2D//#tW;B*DCD

4c:  +	,DD
  +s"BBBB	
BB,c	|jttjj	t
d}tjt
	tj|5|jdtddd|jdtdddd}|jd	|dddtjt
y#1swY#xYw#tjt
wxYw)
Ndestrrz--filterrrnrrr)
rrrdrerfrrrrrrrr{)rdestdirrs   rtest_extract_command_filterz+CommandLineTest.test_extract_command_filter
sw''',,y&1
	(##G,
;''g(,(2F<oodG&*&0/7>&@

4c:
;
Y'
;
;
Y's%C)AC0CCCC9cL|jt	tjt5|jdtd}ddd|j
dtjty#1swY5xYw#tjtwxYw)Nrspamdirrr)rrs  r(test_extract_command_different_directoryz8CommandLineTest.test_extract_command_different_directory
s}  )	(##I.
@oodGY?
@S#&Y'	
@
@
Y's"BA<B<BBB#c"tjd}tjt5|jd|\}}}ddd|j
d|jd|jdy#1swY@xYw)Nrrrrrs)rr!rrrrrrTrs     r!test_extract_command_invalid_filez1CommandLineTest.test_extract_command_invalid_file
s""<0


	
*	B224ALBS	B

/5c"Q		B	BsBBN)rr r!rrrrrrrrrrrrrrrrrrrrrr*rrrr	sm7
KC6.+;.(	0	0 ***	'
+,	,(&( rrc0eZdZdZdZdZdZdZdZy)ContextManagerTestctjt5}|j|jdddd|jjdy#1swY&xYw)Nzclosed inside runtime contextcontext manager failed)r&r%r"rrrrs  r
test_basiczContextManagerTest.test_basic
sQ
\\'
"	JcSZZ)HI	J

$<=	J	JsAA%ctjt}|j|j	t
5|5	ddddddy#1swYxYw#1swYyxYwr)r&r%r"rJrrrs  rtest_closedzContextManagerTest.test_closed
s^ll7#		


w
'	

		

		s#A!AA!A	A!!A*c.|jt5}tjt5}t
#1swYnxYw	dddn#1swYnxYw|j
jt
d|jjdy)Nz)wrong exception raised in context managerr)
r	Exceptionr&r%r"rr/rzrr)rrrGs   rtest_exceptionz!ContextManagerTest.test_exception
s~


y
)	Sg&
#



				
cmmWI	K

$<=sA
7A	A

Ac	tjtd5}t#1swYnxYwn#YnxYw|j	t
jjtdd|jjdy)Nrrz-context manager wrote an end-of-archive blockr)
r&r%rrrTrdrerrrrs  rtest_no_eofzContextManagerTest.test_no_eof
sq	gs+
 s
 
 
 	11?	A

$<=s0#,04ctjtd5	ddd|jtj
j
tddy#1swY>xYw)Nrrz-context manager wrote no end-of-archive block)r&r%rr=rdrerrs rtest_eofzContextManagerTest.test_eof
sM\\'3
'		BGGOOG4a?	A		sAA#c$ttd5}	tj|d5}t#1swYnxYwn#YnxYw|j	|j
d|j
j
ddddy#1swYyxYw)Nrrr-zexternal file object was closedr)r%rr&rrrrr2s   rrzContextManagerTest.test_fileobjs'4
 	BD
\\$S9$S#O$$$
T[[*KLOOCJJ(@A	B	B	Bs+B>1:	>BA=BBN)	rr r!rrrrrrr*rrrr
s">
>
>A
Brrzrequires os.link to be missingc:eZdZdZej
eejdddZ	ej
eejdddZ
ej
eedddZej
eeddd	Zy
)LinkEmulationTestc,|jj|tdttj
j
t|d5}|j}ddd|jtty#1swY)xYw)Nrnr]rr)rGrbrcr%rdrerfrSrTrrW)rrrOrs    r_test_link_extractionz'LinkEmulationTest._test_link_extractionsjw?
"'',,w-t
4	668D	4.9		sB

Bislinkz3Skip emulation - has os.path.islink but not os.linkc&|jdy)Nrrrs rtest_hardlink_extraction1z+LinkEmulationTest.test_hardlink_extraction1 	
""?3rc&|jdy)Nrrrs rtest_hardlink_extraction2z+LinkEmulationTest.test_hardlink_extraction2%	
""#>?rrz Skip emulation if symlink existsc&|jdy)Nrrrs rtest_symlink_extraction1z*LinkEmulationTest.test_symlink_extraction1*rrc&|jdy)Nrrrs rtest_symlink_extraction2z*LinkEmulationTest.test_symlink_extraction2/rrN)
rr r!rrrrrdrerrrrr*rrrrs:X__WRWWh/JL4L4X__WRWWh/JL@L@X__WR+79494X__WR+79@9@rrceZdZdZdZdZy)Bz2PartialReadTestcTGfddtjtjt	j
dj
}tt|dzD]#}	t	j|d||%y#tj$rY<wxYw)Nc2eZdZdZfdZfdZxZS)9Bz2PartialReadTest._test_partial_input.<locals>.MyBytesIOFc|jrtd|jt|j	k(|_t
||S)Nz(infinite loop detected in tarfile.open())hit_eofAssertionErrorryrUrsuperrS)rr	MyBytesIO	__class__s  rrSz>Bz2PartialReadTest._test_partial_input.<locals>.MyBytesIO.read<sK<<(*:;;#yy{c$--/.BBY2155rc*d|_t|
|Sr)rrrx)rrrrs  rrxz>Bz2PartialReadTest._test_partial_input.<locals>.MyBytesIO.seekBs$Y2D99r)rr r!rrSrx
__classcell__)rrs@rrr:sG
6
:
:rrrrsr-)r#rr4compressr&rrrangerUr%r)rrrrurs    @r_test_partial_inputz&Bz2PartialReadTest._test_partial_input9s
	:


	:||GOOE288:;s4y1}%	A
YtBQx%8tD	$$

s. BB'&B'c&|jdy)Nr_rrs rtest_partial_inputz%Bz2PartialReadTest.test_partial_inputMs  %rc&|jdy)Nrr
rs rtest_partial_input_bz2z)Bz2PartialReadTest.test_partial_input_bz2Ps  )rN)rr r!rrr
r*rrrr5s(&*rrc	ddl}ddl}|jdddk7ry|j	dddk7ryy#t$rYywxYw)NrFrootT)rVrUImportErrorgetpwuidgetgrgid)rVrUs  rroot_is_uid_gid_0rTsS||AqV#
||AqV#
s;	AAchownzmissing os.chowngeteuidzmissing os.geteuidceZdZedZeedZejjdejjdejjddZ
ejjdejjdejjddZeje
dejjdejjdejjdd	Zejjdd
Zy)NumericOwnerTestctjd}|ddtj|f|ddtjdf|ddtj|fg}tj
td5}|D]R\}}}}	}
tj|}||_||_	d	|_
d	|_|	|_|j||
T	dddtS#1swYtSxYw)
NscontentcbMLXWrr)r#rr&rSrUr%rrrrr_rrTr)
filename_1	dirname_1
filename_2rZrrrrrtypcontentsrs            r_make_test_archivez#NumericOwnerTest._make_test_archiveiszz*%b"goot<b"goot<b"goot<\\'3
'	+516
+-c3XOOD)  

a*
+	+	+s
.ACC#c#Kd|_d}d}|}|}tjj||}tj|||}t
j|5}||||fdddy#1swYyxYww)Nrznumeric-owner-testfiler)rrdrerfrr$r&r%)mock_geteuidr{rrr r!tar_filenamers        r_setup_testzNumericOwnerTest._setup_tests%&!(
	WW\\'51
(:::;D;EG\\,
'	;5Y
::	;	;	;sAA<	A0'	A<0A95A<zos.chownzos.chmodz
os.geteuidc|j|5\}}}}|j|tdd|j|tdddddtjjt}tjjt}	|j
tjj|ddtjj|	ddgdy#1swYxYw)	NTrn
numeric_ownerr^rrrr	any_order)
r(rbrcrdrerfassert_has_callsrrcall)
rr&
mock_chmod
mock_chownrr_r!f_filename_1f_filename_2s
          rtest_extract_with_numeric_ownerz0NumericOwnerTest.test_extract_with_numeric_owners


l
+	20<z10:MM*gT!0

2MM*wd!0

2		2ww||GZ8ww||GZ8##X]]%7%7b"%M%-]]%7%7b"%M%'/3	$	4	2	2s8C..C7c	H|j|5\}}}}|jtdddddtjjt}tjjt}	tjjt}
|j
tjj|ddtjj|	ddtjj|
dd	gd
y#1swYxYw)NTrnr*rrrrrrr,)
r(rmrcrdrerfr.rrr/)rr&r0r1rrr r!r3f_dirname_1r4s           r"test_extractall_with_numeric_ownerz3NumericOwnerTest.test_extractall_with_numeric_owners


l
+	50<z90:WD$3

5	5ww||GZ8ww||GY7ww||GZ8##X]]%7%7b"%M%-]]%7%7R%L%-]]%7%7b"%M%'/3		$	4	5	5sDD!z uid=0,gid=0 must be named "root"c|j|5\}}}}|j|tdddddtjjt}|j
|ddy#1swYAxYw)NFrnr*r)r(rbrcrdrerfassert_called_with)rr&r0r1rrr2r3s        r"test_extract_without_numeric_ownerz3NumericOwnerTest.test_extract_without_numeric_ownerst

l
+	2/Hz1aMM*gU!0

2	2
ww||GZ8%%lAq9	2	2sA11A:c	|j|5\}}}}|jt|j|tdddddy#1swYyxYw)NFT)r(rrrbrc)rr&rrr2s     rtest_keyword_onlyz"NumericOwnerTest.test_keyword_onlysT


l
+	O/Hz1ai#mmZ%
O	O	O	Os.A		AN)rr r!rfr$rr(rrrr5r8rrr;r=r*rrrr`sh.;;(]]$
]]$
]]&4'%%4$]]$
]]$
]]&4'%%4,X*,;=
]]$
]]$
]]&	:'%%=
	:]]&O'Orrc*eZdZdZdZdZdZdZy)ReplaceTestsc8|jjd}|jd}|j|jd|j|jd|j|jjdjdy)NrOz
misc/otherrP)rGrQrrTrrr0replaceds   rtest_replace_namezReplaceTests.test_replace_namesv##O4>>|>45o6++O<AA(	*rc&|jjd}|j}d|jd<|j	|jdd|j	|jjdjddy)Nrknot-barrrrGrQrrlrTrAs   rtest_replace_deepzReplaceTests.test_replace_deeps{##N3>>#(1W%++G4e<HH~.::7CU	Lrc*|jjd}|jd}d|jd<|j	|jdd|j	|jjdjddy)NrkF)deeprErrFrAs   rtest_replace_shallowz!ReplaceTests.test_replace_shallows##N3>>u>-(1W%++G4i@HH~.::7CY	Prc.|jjd}dD]i}|j|5|jdi|di}|j	t||d|j
t||ddddky#1swYvxYw)NrO)rr]rrrrr_r	attr_namer*)rGrQrrrTr5r=)rr0rMrBs    rtest_replace_allzReplaceTests.test_replace_alls##O4:	FI	2
F)6>>>Y,=>  9!=tD##GFI$>E
F
F	F
F
FsA
BB	c|jjd}|jt5|j	ddddy#1swYyxYw)NrOi[)rN)rGrQrrr)rr0s  rtest_replace_internalz"ReplaceTests.test_replace_internalsG##O4


y
)	-NN)N,	-	-	-sA

AN)rr r!rCrGrJrNrPr*rrr?r?s*LPF-rr?cpeZdZdZedZedZdZedZ	dZ
dZdZd	Z
d
ZdZdZy)
NoneInfoExtractTestsNc0tjtdd}tjt
dz_d|_t5}j*|jtjdt|jjjddd|jt!fd	tjjj#d
D_y#1swY_xYw)Nr_rCrDextractall_ctrlrignore)actioncategoryr]c3TK|]}|jj!ywr)relative_tocontrol_dir).0pres  r	<genexpr>z2NoneInfoExtractTests.setUpClass.<locals>.<genexpr>s( A
MM#//* As%(**/*)r&r%r"rrrcrZrgrextraction_filter
enter_contextwarningscatch_warningsDeprecationWarningrmrJsetglob
control_paths)rerGcms`  rrfzNoneInfoExtractTests.setUpClass
sll7{C!,,w/2CC
[	JB$$,  !8!8#.@"BCNN3??33H3HNI		J
			 A\\#//277? AA
	J	Js
ADDcBtj|jyr)shutilr{rZrhs rriz"NoneInfoExtractTests.tearDownClasss

coo&rctfdtjjdD}|j	|j
|y)Nc3@K|]}|jywr)rY)r[r\rs  rr]z;NoneInfoExtractTests.check_files_present.<locals>.<genexpr>!s";
MM)$;sr^)rdrrrerTrf)rr	got_pathss ` rcheck_files_presentz(NoneInfoExtractTests.check_files_present sF;\\),11&9;;		
++Y7rc'Ktjtdz}d|j_|jjD]}|D]}t
||dtj|5|jj|d|j||dddy#1swYyxYww)Nextractall_nonerrnr])rrrcrGrgrsetattrrrrmrm)r
attr_namesr|r0rMs     rextract_with_nonez&NoneInfoExtractTests.extract_with_none&sll7#&77hh))+	1F'
1		40
1	1


$	HHO<$$S)I			sA6C83B4+	C4B=9Cctjtjj}|jd5}tj|j
dD]b}|j|5	|jj}|j|jj|dddd	dddy#t$r|jsY0wxYw#1swYxYw#1swYyxYw)Nr]r^re)rrrcrxst_mtimerrrerassertGreaterEqualr
is_symlink)rnowr|rer]s     rtest_extractall_none_mtimez/NoneInfoExtractTests.test_extractall_none_mtime2sll7#((*33

#
#G
,
	KS)..v6	
K\\t\,KK $		 4 4//		0D0DcJKK	
K
	K
	K
#"#0! 1"KK
	K
	KsH:D=C7?C*C7
DC4	1C73C4	4C77D<DDctjtjj}tjtdz}|jd|jj}|j
d5}tj|jdD]}|j|5|jr+|j|jj|n:|jr*|j|jj|ddd	dddy#1swYxYw#1swYyxYw)Nregular_filerrr^rt)rrrcrxry
write_textrrreris_dirrTis_file)rdir_moder{regular_file_moder|res      rtest_extractall_none_modez.NoneInfoExtractTests.test_extractall_none_modeBs<<(--/77||G,~=#(--/77

#
#F
+	<sS)..v6
<\\t\,<{{}(()<)<hG(()<)<):<	<<
<	<	<<<	<	<s%
:EA6E:
EEEE#cR|jd5	dddy#1swYyxYw)Nrrrrs rtest_extractall_none_uidz-NoneInfoExtractTests.test_extractall_none_uidR(

#
#E
*				&cR|jd5	dddy#1swYyxYw)Nrrrs rtest_extractall_none_gidz-NoneInfoExtractTests.test_extractall_none_gidVrrcR|jd5	dddy#1swYyxYw)Nr_rrs rtest_extractall_none_unamez/NoneInfoExtractTests.test_extractall_none_unameZ(

#
#G
,				rcR|jd5	dddy#1swYyxYw)Nrrrs rtest_extractall_none_gnamez/NoneInfoExtractTests.test_extractall_none_gname^rrcX|jdddd5	dddy#1swYyxYw)Nrrr_rrrs rtest_extractall_none_ownershipz3NoneInfoExtractTests.test_extractall_none_ownershipbs.

#
#E5'7
C				s ))rr r!r_r}rfrirmrrrryrrrrrrr*rrrRrRsoAA''8		K < rrRceZdZdZy)NoneInfoExtractTests_DatarNrr r!r_r*rrrrfsrrceZdZdZy)!NoneInfoExtractTests_FullyTrustedrnNrr*rrrris'rrceZdZdZy)NoneInfoExtractTests_TarrGNrr*rrrrmsrrceZdZdZy)NoneInfoExtractTests_DefaultNrr*rrrrpsrrceZdZdZdZy)NoneInfoTests_Miscc
tj}tjtjtj
fD]}|j
|5tj|d|}|jt}	|j|dD]b}|j
|5|jdi|di}|jt|5|j|ddddddd	dddy#1swYxYw#1swYxYw#t$r|tjk(rnYCwxYw#1swYxYw)N)	tarformatr)r.rr)r]rrrr_rrLr*)r#rr&rrervrr%rr"rrrrJr)rbiorrGrYrMrBs       rtest_addzNoneInfoTests_Misc.test_addusDjjl!..0B0B!,,.	6I	2
6ll3SK..16KK(&66	!\\I\>6'6w'K)T9J'KH!%!7!7
;D+"H6 #H 56666
6
6	6&6666! G$8$88	
6
6s`.ED$E0,D	D.D	6EDD	D!
E$EEEEE	c
	dhdhdhdhdhdhddhddhfD]}|j|5tjtd	5}t	j
t	jd
d}tjtd
|5|jddd|jD]}|D]}t||dt	j
t	jd
d}tjtd
|5|jdddt|jjj!|jjj!D]\}}|dhk(r)t#j$d|r|j'|d6|dhk(r)t#j$d|r|j'|de|dhk(r)t#j$d|r|j'|d|dhk(r^|j)drM|j!d\}	}
|j!d\}}|j'||
|j+|d|dhk(r_|j-drN|j!d\}	}
|j!d\}}|j'||	|j+|d]|dhk(r_|j)drN|j!d\}	}
|j!d\}}|j'||
|j'|d|dhk(r_|j-drN|j!d\}	}
|j!d\}}|j'||	|j'|d'|ddhk(r_|j)drN|j!d\}	}
|j!d\}}|j'||
|j'|d|ddhk(r_|j-drN|j!d\}	}
|j!d\}}|j'||	|j'|d|j'||	ddddddy#1swYxYw#1swYxYw#1swY/xYw#1swYxYw)Nr]rrrr_r)rqrCrlrrrrs2003-01-\d\ds
????-??-??s\d\d:\d\d:\d\ds??:??:??s.([r-][w-][x-]){3}s
??????????)tarfile/lars/foo//s[0-9]+)/tarfile/users/bar1000/sNone/100)rrrr)rrrr)rr&r%r"r#rhrrrrrorrprrrrrematchrTr^rendswith)
rrqrGtio_prevr0rMtio_newrgotexp_user	exp_groupgot_user	got_groups
             rrzNoneInfoTests_Misc.test_listsr
$9vh%#9wi!7+eW-=?<	8J,,*,59
8,,w=9
8AD++BJJL'4P&&sHh?HHJ!nn.9F%/9		4899**2::<$O&&sHg>HHJ%():)C)C)E)K)K)M)0)9)B)B)D)J)J)L&N.8MHc!gY.288<Lh3W((m<#y0RXX>PRZ5[((k:#x/BHH2H5>((m<#y0X5H5H<6>.6nnT.B+).1iio+)((I>((9=#y0X5F5F=6?.6nnT.B+).1iio+)((8<((I>#w.83F3F%4(.6nnT.B+).1iio+)((I>((7;#w.83D3Dg3O.6nnT.B+).1iio+)((8<((G<#w'77H<O<OF=H.6nnT.B+).1iio+)((I>((7;#'77H<M<MF=H.6nnT.B+).1iio+)((8<((G<((37].89
89
89
8<	89
89
89
89
8sVSAS
R*	A6SR7	%M0SS*R4
/S7S
<SS
	SS	N)rr r!rrr*rrrrts
64A8rrc<|dd}tjdd|dtjdd|dztjdtjtjztjd|dztj
dd|dztjdd|d	ztjdtjtjztjd|d
ztjdd|dztjdd|dztjdtjtjztjd
|dz}tj|dd|ddk(sJ|S)zInverse of `stat.filemode` (for permission bits)

    Using mode strings rather than numbers makes the later tests more readable.
    rsNr)r_-)rr)rurr|Srvrr
rQ)rurrTr:)rxS_IRUSRS_IWUSRS_IXUSRS_ISUIDS_IRGRPS_IWGRPS_IXGRPS_ISGIDS_IROTHS_IWOTHS_IXOTHS_ISVTXr_)rstr_moderesults   r_filemode_to_intrs
ABxH1
%hqk
21
%hqk
231t||+&qk++
1
%hqk
231
%hqk
2
31t||+&qk+	+1
%hqk
2
31
%hqk
231t||+&qk++$== $QR00Mrc<eZdZdZdZdZdZdddddddZdZy)	ArchiveMakerzHelper to create a tar file with specific contents

    Usage:

        with ArchiveMaker() as t:
            t.add('filename', ...)

        with t.open() as tar:
            ... # `tar` is now a TarFile with 'filename' in it!
    c6tj|_yr)r#rrrs rrzArchiveMaker.__init__s::<rcRtjd|j|_|S)NrrM)r&r'rtar_wrs r	__enter__zArchiveMaker.__enter__s__#txx@
rc|jj|jj|_d|_yr)rrJrrr#)rrs  r__exit__zArchiveMaker.__exit__
s-

))+
rN)rT
symlink_tohardlink_torrVc(t|}tj|jdi|}|||_|rt||_| tj}t||_| tj}t||_|jdr|tj}|||_|jr)tjt!|j}	nd}	|j"j%||	y)z5Add a member to the test archive. Call within `with`.Nrr*)r0r&rrrVrrrYrr/rrUrTrr#rrBrr)
rrrTrrrrVrrYr.s
          rrzArchiveMaker.add
s4y/'//$'//9&9GL+D1GL!??D":G"??D";/G==$,??DGL==?jjw||!45GG

7G,rcntj|j}tjdd|i|S)z9Open the resulting archive as TarFile. Call after `with`.r.r*)r#rr#r&r%)rrrs   rr%zArchiveMaker.open
s+jj'||2C2622r)	rr r!rrrrrr%r*rrrrs.	 
!%4D-23rrc8tjd|S)NzWASI: Skip symlink test for now)rskiprOs rsymlink_testr)
s?x}}>?BBrc|Srr*rs rrr,
src@eZdZejedzZedzZedZ			d dZ
d!dZdZdZ
ed	Zed
ZedZdZed
ZedZedZedZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%y)"TestExtractionFiltersouterdirrc#~Ktj|j5	|j|j|d|_t
|jjd|_|jj|j	d|j|j
r|j
|j|jt
dddy#t$r }||_t
|_Yd}~~d}~wwxYw#|jwxYw#1swYyxYww)a}Extracts `tar` to `self.destdir` and allows checking the result

        If an error occurs, it must be checked using `expect_exception`

        Otherwise, all resulting files must be checked using `expect_file`,
        except the destination directory itself and parent directories of
        other files.
        When checking directories, do so before their contents.
        r]Nr^)
rrrrmrraised_exceptionrdreexpected_pathsdiscardrrJrT)rrGr^rs    r
check_contextz#TestExtractionFilters.check_context:
s




.	9
:t||F;
)-%&)$--*<*<V*D&E###++DLL9
		$$+++T00#%8!	9	9
,(+%&)e##
,			9	9s_ D=D1C0AD1DAD1'	D=0	D9DD1DD1D..D11D:6D=Nc|jr|jtjtjj|j|z}|j||j|jj||ftjrRtjtj|jj}|j!|||1t#|t$r!|j'drt(j*}|X|j|zj-}tj|}||k7r|j/|j1|n|t(j2k(s| |j/|j5nq|t(j*k(r |j/|j7n>|t(j8k(r |j/|j;nt=||*|j!|jj>||j@D]}	|jjC|	y)z'Check a single file. See check_context.Nr)"rrrrdrenormpathrrrremover	can_chmodrxr_S_IMODEryrTrrr0rr&rUreadlinkrsamefilerSr~r}r^is_fifoNotImplementedErrorrUparentsr)
rrrTrrrVrerrparents
          rexpect_filez!TestExtractionFilters.expect_fileW
s  '''||BGG,,T\\D-@AB

dD//0""4(	 3 3 5--TYY[-@-@ ABCS$'<JtS1dmmC6H??D!<<$&002C||J/H3X 67
W__
$OODLLN+
W__
$OODKKM*
W%%
%OODLLN+%d++TYY[00$7ll	0F''/	0rc|j||5|j|j	dddd|_y#1swYd|_yxYwr)rr)rexc_type
message_res   rexpect_exceptionz&TestExtractionFilters.expect_exceptionz
sS

#
#Hj
9	,$$0+++1	,!%	,!%s	=A
ct5}|jdddddD]<}|jj|5|j	dddd>y#1swYKxYw#1swYUxYw)Nz
benign.txt)rnrGrrrrr%rrarcr^s   rtest_benign_filez&TestExtractionFilters.test_benign_file
sw
^	"sGGL!	"4	/F##CHHJ7
/  .
/
/	/	"	"
/
/sA'
A3'A03A<	c|t5}|j|jdzddd|jj	d5|jdddddD]}|j|j	|5t
|jjdr9t
|jjd}|j|dn |jtjddddy#1swYxYw#1swYxYw#1swYxYw)Nzescaped.evilrnz../escaped.evilrGrrz
/escaped.evilz+['"].*escaped.evil['"] has an absolute path)rrrrr%rr0r^lstriprr&AbsolutePathError)rrr^outerdir_strippeds    r
test_absolutez#TestExtractionFilters.test_absolute
s ^	4sGGDMMN23	4


O
<	0./	0$	KF##CHHJ7

Kt}}%005),DMM(:(A(A#(F%$$(9':-%HI))11IK

K

K	K
	4	4	0	0

K

Ks$DD&A>D2D#&D/2D;	c
t5}|jdd|jdd|jddddtjr|j	jd5|j|jt	dddy|jdd|jdd|jd	ddd|j	|jd	5|jtjd
ddd|j	|jd5|jtjddddy|j	jd5|jdddd|j	|jd	5|jdddd|j	|jd5|jddddy#1swYxYw#1swYYxYw#1swYxYw#1swYyxYw#1swYxYw#1swYxYw#1swYyxYw)
Ncurrentrrrz
current/..parent/evilrnrrGT'parent/evil' would be extracted to ['"].*evil['"], which is outside the destinationrzK'parent' would link to ['"].*outerdir['"], which is outside the destination)
rrrcan_symlinkrr%rrrqrr&OutsideDestinationErrorLinkOutsideDestinationErrorrrs  rtest_parent_symlinkz)TestExtractionFilters.test_parent_symlink
s4^
	#s

GGI#G.
GGHG6GGM"
	#  "##CHHJ@
0((4))/:
0
0$$Y3$?$$X,$G$$Y/
0##CHHJ6
:%%339:
:##CHHJ7
:%%779:
:
:##CHHJ@
0  /
0##CHHJ6
0  /
0##CHHJ7
0  /
0
0Y
	#
	#
0
0
:
:
:
:
0
0
0
0
0
0sY8H.#H;,7H;!I!II!I-I9.H8;III!I*-I69Jctjr/tjj	t
d}tj|tjdtjj	|dttjj	|dddd5	dddtjjtjj	|drd}nLtjjtjj	|ddrd}ntd	t5}|jdd
|jdd
|jdddd|jjd
5tjr8|jdd
|jdd
|jdn"|jd|jdddd|j|jd5tjr!|jt j"dn"|jd|jdddd|j|jd5tjrDr!|jt j"dnC|jt j$dn"|jd|jddddy#1swYxYw#1swYxYw#1swYHxYw#1swYxYw#1swYyxYw)Nresolution_testrrrr%rTFz#Could not determine link resolutionrzcurrent/parentrrnrrzcurrent/rGrrzS'current/parent' would link to ['"].*outerdir['"], which is outside the destination)rrrdrerfrcrrr%rrrrrrrr&rr)rtestpathdotdot_resolves_earlyrs    rtest_parent_symlink2z*TestExtractionFilters.test_parent_symlink2
s  "ww||G->?HHHX
JJsBGGLL9=>bggll8YfEsK

ww~~bggll8V<=)-%XtV DE).%$%JKK
^
	#s
GGI#G.
GG$G6GGM"
	#


O
<	0$$&  s ;  d ;  +  ,  /	0


E
2
	0$$&%%77,-  ,  /
	0


F
3	0$$&())#;;01))#??01  ,  /%	0	0_


	#
	#	0	0
	0
	0	0	0s?/M
8M/A/M$AM1A;M=
MM!$M.1M:=NcRt5}|jd|j|jdddd|jj	d5tjr/|jd|j|jdn|jdddd|j|j	d5tjr!|jtjdn|jdddd|j|j	d5|jtjd	dddy#1swY@xYw#1swYxYw#1swYlxYw#1swYyxYw)
NrrrrnrrGrr&'parent' is a link to an absolute path)rrrrr%rrrrr&rAbsoluteLinkErrorrs  rtest_absolute_symlinkz+TestExtractionFilters.test_absolute_symlink*s]^	#sGGHG7GGM"	#


O
<	0$$&  dmm D  +  /	0


E
2	0$$&%%77,-  /	0


F
3	:!!))8
:	:	:+	#	#	0	0	0	0	:	:s1/E8"AFAF!F8FFFF&cXt5}|jd|jdzddd|jj	d5|jtdddd|j|j	d5|jtdddd|j|j	d5|jtjddddy#1swYxYw#1swYxYw#1swYkxYw#1swYyxYw)	Nrrrrnz.*foo. not foundrGrr)	rrrrr%rrYr&r
rs  rtest_absolute_hardlinkz,TestExtractionFilters.test_absolute_hardlinkHs
^	AsGGH$--%*?G@	A


O
<	@!!(,>?	@


E
2	@!!(,>?	@


F
3	:!!))8
:	:	:	A	A	@	@	@	@	:	:s/!C<DD!D <DDD D)c^t5}|jddddd	|jjd5t	j
rDt
|jtr|jtn|jddn	ddddD]K}|jj|5|jtjddddMy#1swYxYw#1swYfxYw#t$rYtwxYw#1swYxYw)N../mooz..//tmp/moorrnr]rzH'../moo' would be extracted to '.*moo', which is outside the destination)
rrrr%rrrrrrqrrr&rrs   rtest_sly_relative0z(TestExtractionFilters.test_sly_relative0Ys^	8sGGHG7	8	##CHHJ#G
((*!$"7"7I--o>((m(L
&$	-F##CHHJ7
-%%77,-
-
-	-1	8	8


 		
-
-sAC<!D	AD#D!D#<DD
D	D D #D,	c<t5}|jd|jddddd|jjd5|j	dt
jtjr|j	dd	dddd
D]K}|j|j|5|jt
jddddMy#1swYxYw#1swYfxYw#1swYpxYw)Nztmp/z
tmp/../../mooztmp/../..//tmp/moorrntmprTrztmp/../../tmp/moorzU'tmp/../../moo' would be extracted to ['"].*moo['"], which is outside the destination)rrrr%rr&rUrrrrrs   rtest_sly_relative2z(TestExtractionFilters.test_sly_relative2|s^	FsGGFOGGO0DGE	F


O
<	KU9$$&  6I J	K
$	%F##CHHJ7
%%%33$%
%
%	%	F	F	K	K
%
%s$%C:A	D!D:DDD	c	jt5}|jdd|jdtjj	dd|jdtjj	d	dd
ddddD]}|jj
|5|jdd|jddtjr|jddd
n|jdddddy#1swYxYw#1swYxYw)Ntargetdir/targetrrlinkdir/hardlink	targetdirrrlinkdir/symlinkrrrGrrnz../targetdir/targetrVr
rrrdrerfrr%rrrrs   rtest_deep_symlinkz'TestExtractionFilters.test_deep_symlinks-
^	.sGG&QG/GG&BGGLLX5'G
(
GG%"'',,k83-G
.
	.5	@F##CHHJ7
@  !3! <  !3! <((*$$%6Q0E%G$$%6Q$?
@
@	@	.	.
@
@sA7D/A#D)D&)D2	ct5}|jdd|jdtjj	dd|jdd	|jd
d|jdddddd
D]}|jj
|5|jdd	|jd
d	|jdd	tjr)|jddd|jdddn&|jdd	|jdd	dddy#1swYxYw#1swYxYw)Nrhardlinkrsymlink2linkdir	hardlink2rrrrrzlinkdir/hardlink2rrr rs   rtest_chainsz!TestExtractionFilters.test_chainssv^	HsGG%*G=GGJ277<<;,(G
)GG&QG/GG&4FGGGG'5FGG
	H5	9F##CHHJ7
9  !3! <  !3! <  !41 =((*$$%6Q0:%<$$Za0C%E$$%6Q$?$$Za$8
9
9	9	H	H
9
9sA>E6BE*E'*E3	ct5}|jdd|jdd|jdd|jdd	|jd
d|jdd
dddtjj	t
d}t
|d5	dddtj|tj|jtjztj|jtjz}tj|tj|tj|tj|jtjztj|jtjz}tj||jj
d5|r|jddn|jdd|jdd|jdd|jdd	|jd
d|r|jdd
n|jddddd|j|j
d5|jdd|jdd|jdd|jdd	|jd
d|jddddd|j|j
d5tj tj"|j$jj}|jdd|jdd|jdd|jdd|jd
d|jd|dddy#1swYxYw#1swYxYw#1swYxYw#1swYxYw#1swYyxYw)Nall_bitsz
?rwsrwsrwtr	perm_bitsz
?rwxrwxrwxexec_group_otherz
?rw-rwxrwxread_group_onlyz
?---r-----no_bitsz
?---------zdir/z
?---rwsrwtztmp.filerrnz
?rwsrwsrwxz
?---rwsrwxrGz
?rwxr-xr-xz
?rw-r-xr-xz
?---r-xr-xrz
?rw-r--r--z
?rw-r-----z
?rw-------)rrrdrerfrcr%chmodrxryrrirrrrr_rr)rrtmp_filenamehave_sticky_fileshave_sticky_dirsnormal_dir_modes      r
test_modesz TestExtractionFilters.test_modess^	/sGGJ\G2GGKlG3GG&\G:GG%LG9GGILG1GGFG.
	/ww||GZ8
,
$		
rww|4<<t||KLWW\2::T\\I
		,

rww|4<<t||KLGGL199DLLH




O
<	<   , ?  , ?[|</lC.\BY\:  l ;  l ;	<


E
2	8Zl;[|</lC.\BY\:V,7
	8


F
3	;"mmDLL

""$,,-./OZl;[|</lC.\BY\:V/:	;	;Y	/	/			<	<	8	8	;	;s?A3P/6P<BQ	A3Q)B=Q#/P9<Q	QQ #Q,ct5}|jdtjddddD]^}|j	j|5t
tdr"|jdtjn	ddd`|j	jd5|jtjddddy#1swYxYw#1swYxYw#1swYyxYw)Nrr)rnrGmkfiforz'foo' is a special file)rrr&r^rr%rrdrrSpecialFileErrorrs   r	test_pipezTestExtractionFilters.test_pipes
^	2sGGE 0 0G1	2-	F##CHHJ7
2x($$U1A1A$B

	


F
3	+!!(()
+	+	+	2	2

	+	+s#"C"4C.8!C:"C+.C7	:DctjtjtjfD]}tjd}||_tj|d}|j||tj|d}|j|j
||jtj5}tj|dddd|jjjtj|j|jjj dy#1swYqxYw)Nrr)r&r^rXrRrrTfully_trusted_filterr
tar_filterrTrr6data_filterr/rzrYr)rspecial_typerYtrustedrGrgs      rtest_special_filesz(TestExtractionFilters.test_special_files
s$,,goowN
	?Looe,G'GL227B?GMM'7+$$Wb1CSXX|4""7#;#;<
1##GR0
1!!",,"6"6HR\\1166>
	?
1
1s	EE	ctjjt5}|j	D]*}tj
|d}|j
||,	dddy#1swYyxYwNr)r&r'r%r"rr9rrrGrYfiltereds    rtest_fully_trusted_filterz/TestExtractionFilters.test_fully_trusted_filtersa
__
!
!'
*	1c>>+
1"77D

h0
1	1	1	1s>A,,A5cdtjjt5}|j	D]d}tj
|d}|j
|j|j|j
|j|jf	dddy#1swYyxYwr@)	r&r'r%r"rr:rrrTrAs    rtest_tar_filterz%TestExtractionFilters.test_tar_filter#s__
!
!'
*	;c>>+
;"--gr:

hmmW\\:

hmmW\\:
;	;	;	;sA8B&&B/ctjjt5}|j	D]e}	tj
|d}|j|j|j|j|j|jg	dddy#tj$rYwxYw#1swYyxYwr@)
r&r'r%r"rr;FilterErrorrrrTrAs    rtest_data_filterz&TestExtractionFilters.test_data_filter-s__
!
!'
*	;c>>+
;&227B?H

hmmW\\:

hmmW\\:

;	;	;**		;	;s/CB'AC'B=:C<B==CC	cPt5}|jddddtjdtf5|jj
d5|jdddddddy#1swYhxYw#1swYxYw#1swYyxYw)zEnsure the default filter warnsrNzPython 3.14)rrr
check_warningsrcrr%rrs  rtest_default_filter_warnsz/TestExtractionFilters.test_default_filter_warns9s
^	sGGEN	

+
+ 235	(##CHHJ5
(  '
(	(	(		
(
(	(	(s/B!B!B3BB
B	BB%ctjtd}d}||_|j	|d5|jddddy#1swYyxYw)Nr_c&|jdk(r|Syr$rPrYres  r
strict_filterzSTestExtractionFilters.test_change_default_filter_on_instance.<locals>.strict_filterD||.rrO)r&r'r"r_rr)rrGrOs   r&test_change_default_filter_on_instancez<TestExtractionFilters.test_change_default_filter_on_instanceBsToogs+	
!.


T
*	._-	.	.	.sAAc4d}tjtd}tjtjdt|5|j
|d5|jdddddddy#1swYxYw#1swYyxYw)Nc&|jdk(r|Syr$rPrNs  rrOzPTestExtractionFilters.test_change_default_filter_on_class.<locals>.strict_filterNrPrr_r_rO)r&r'r"rrrfrr)rrOrGs   r#test_change_default_filter_on_classz9TestExtractionFilters.test_change_default_filter_on_classMs	
oogs+


w0C+M:<	2##C.
2  1
2	2	2
2
2	2	2s$BB1BB	BBcGddtj}|td}|j|d5|j	ddddy#1swYyxYw)NceZdZdZy)QTestExtractionFilters.test_change_default_filter_on_subclass.<locals>.TarSubclassc&|jdk(r|Syr$rPrrYres   rr_zcTestExtractionFilters.test_change_default_filter_on_subclass.<locals>.TarSubclass.extraction_filter[s<<?2"NrNrr*rrTarSubclassrWZs
 rrZr_rO)r&r'r"rr)rrZrGs   r&test_change_default_filter_on_subclassz<TestExtractionFilters.test_change_default_filter_on_subclassYsS	 '//	 '3'


T
*	._-	.	.	.sAActjtd}d|_|j	|d5|jtdddy#1swYyxYw)Nr_r)r&r'r"r_rrrrs  r$test_change_default_filter_to_stringz:TestExtractionFilters.test_change_default_filter_to_stringesMoogs+ &


T
*	-!!),	-	-	-sAAcbfd}t5}|jd|jd|jddddjj|5j	dj	ddddy#1swYUxYw#1swYyxYw)Ncj|j|jdk(r|jdS|jdk(ry|S)N	move_thismovedrPignore_this)rrrr)rYrers  r
custom_filterz?TestExtractionFilters.test_custom_filter.<locals>.custom_filterlsFMM$-||{*G44||},Nrr`rbkeeprar)rrcrs`  rtest_custom_filterz(TestExtractionFilters.test_custom_filterks	^	sGGK GGM"GGFO	


M
:	%W%V$	%	%				%	%s4B-#B%B"%B.ct5}|jdddd|jjd5|j	t
dddy#1swYHxYw#1swYyxYw)Nrzbad filter name)rrrr%rrJrs  rtest_bad_filter_namez*TestExtractionFilters.test_bad_filter_name|sh
^	sGGEN	



,=
>	.!!*-	.	.			.	.sA$A0$A-0A9cGdd}t5}|jd|jdd|jdddd|5}|jj|5|j	ddddddd|jjd|j|jdy#1swYxYw#1swYVxYw#1swYZxYw)	NceZdZdZdZdZy)BTestExtractionFilters.test_stateful_filter.<locals>.StatefulFiltercd|_|Sr)num_files_processedrs rrzLTestExtractionFilters.test_stateful_filter.<locals>.StatefulFilter.__enter__s+,(rc	tj||}|xjdz
c_|S#tj$rYywxYw)Nrs)r&r;rGrlrYs   r__call__zKTestExtractionFilters.test_stateful_filter.<locals>.StatefulFilter.__call__sK %11'4@G((A-(**  s/AAcd|_y)NT)done)rexc_infos  rrzKTestExtractionFilters.test_stateful_filter.<locals>.StatefulFilter.__exit__s	 	rN)rr r!rrnrr*rrStatefulFilterrjs


!rrrgoodbadrrrvT)rrrr%rrTrlrp)rrrrrcs    rtest_stateful_filterz*TestExtractionFilters.test_stateful_filters	!	! ^	sGGFOGGEcG*GGFO	
	)##CHHJ
>
)  (
)	)	
::A>++T2		

)
)	)	)s/6C!C.;C"
C.C"C+	'C..C7cz
d}d}d}d}d}t5}|jdddd|jjd|5|j	dddd|j|jd|5|j	dddd|j|jd|5|j	dddd|j|jd|5|jtjddd|j|jd|5|jtddd|j|jd	|5|j	dddd|j|jd	|5|jtjddd|j|jd	|5|jtddd|j|jd	|5|jtjddd|j|jd	|5|jtddd|j|jd
|5|jtjddd|j|jd
|5|jtjddd|j|jd
|5|jtddd|j|jd
|5|jtjddd|j|jd
|5|jtddd|j|jd|5|jtdddy#1swY7xYw#1swYxYw#1swYxYw#1swYxYw#1swYmxYw#1swY:xYw#1swYxYw#1swYxYw#1swYxYw#1swY^xYw#1swY+xYw#1swYxYw#1swYxYw#1swY~xYw#1swYAxYw#1swYxYw#1swYyxYw)Nc,tjd)Nzfailed with ExtractError)r&ExtractErrorrNs  rextracterror_filterzBTestExtractionFilters.test_errorlevel.<locals>.extracterror_filters&&'ABBrc,tjd)Nzfailed with FilterError)r&rGrNs  rfiltererror_filterzATestExtractionFilters.test_errorlevel.<locals>.filtererror_filters%%&?@@rctd)Nzfailed with OSError)rrNs  roserror_filterz=TestExtractionFilters.test_errorlevel.<locals>.oserror_filters/00rc,tjd)Nzfailed with base TarError)r&TarErrorrNs  rtarerror_filterz>TestExtractionFilters.test_errorlevel.<locals>.tarerror_filters""#>??rctd)Nzfailed with ValueError)rJrNs  rvalueerror_filterz@TestExtractionFilters.test_errorlevel.<locals>.valueerror_filters566rr%rrrsrvzboo!)
rrrr%rrr&rrJrGrrxr)rryr{r}rrrs       rtest_errorlevelz%TestExtractionFilters.test_errorlevels{	C	A	1	@	7^	sGGFO	


A 68K
L	%V$	%

A 68J
K	%V$	%

A 6
G	%V$	%

A 6
H	4!!'"2"23	4

A 68I
J	.!!*-	.


A 68K
L	%V$	%

A 68J
K	7!!'"5"56	7

A 6
G	+!!'*	+

A 6
H	4!!'"2"23	4

A 68I
J	.!!*-	.


A 68K
L	8!!'"6"67	8

A 68J
K	7!!'"5"56	7

A 6
G	+!!'*	+

A 6
H	4!!'"2"23	4

A 68I
J	.!!*-	.


F ;=O
P	-!!),	-	-q		
	%	%	%	%	%	%	4	4	.	.
	%	%	7	7	+	+	4	4	.	.
	8	8	7	7	+	+	4	4	.	.
	-	-sQ!Q.Q;R
 RR"R/ R<S	 S$S#$ S0. S=8T
8 TT$T1!Q+.Q8;RRR"R,/R9<S	SS #S-0S:=T
TT!$T.1T:)NNNN)r)&rr r!rrrcrrrrrrrrrrr
rrrrr!r'r3r7r>rCrErHrKrQrTr[r]rergrurr*rrrr0
s<
w||G$z1HG998BF!0F%/K20000dT0T0l::::" - -D%%&@@.9927;r+$
?1;
;(	.
2
.-%".3<E-rrc&tjttjtt
gatt
d5}|j}dddtttfD]}|jstj|j
tj|j
|j|j
d5}|jdddy#1swYxYw#1swYxYw)Nrrr)rrircrdmakedirsr"rr%rSr,r3r9rr)rZrcrGs    rsetUpModulers
WKK9L	
gt	yy{w
( 66QYY'		*		4(
 C		$
 
 	 	
 
 s
C;D;DD	c~tjjtrt	j
tyyr)rdrerrcrr{r*rrtearDownModulers%	ww~~g!r__main__)rrdr#hashlibr
contextlibrrrandomrrrirrarxr
unittest.mockr&rrtest.supportrr	r
r/rrr4r<rrer1TESTFNrcrr!r"rfr.r5r;rrrWr r
requires_gzipr,r$r3
requires_lzmar9r@TestCaserMrrrrrrrrr(rrrrrrrrrrrrrrr8rOrhrxrrrrrrrrrr
rrrrr&rLr`rrrrrrrrrrrrrrr'r)r+r-r8rrrrrrrr?rRrrrrrrrrrrrrrrWr*rr<module>rsC
		0
	"&($
''//)**
+i
7o%	
'

=
)
77<<!12
'',,w 1
2	g/	0
'',,w	
*ggll7I.GG
))%%%&&&%%%	w	UHh//Un	-		w
		-	M1x**M1`	8X		'8		8X	G9XG9TQ.~Q.f#X%6%6	x!183D3D	8g/1B1B89x!183D3D9
;^X%6%6;z	>				>	&1Wh//&1P	>	
,
,	>	1x1B1B1"^EXx00^EB6O6Op9,(*;*;9x*,(*;*;*ZGGG<u'
x00u'p		Hi		7I		Hi	(%mX%6%6(%V7(O78/8;(O;?7?,!7$8(:K:K!!*>! (%98;L;L  *> C(++C$O58$$O5d+&}h&7&7+&\W. 1 1W.tXzGZ%Xz%(*(WR(*KL'18$$'1M'1TH8<H8VNNbL{H$5$5L^G[("3"3G$K[("3"3K(II(>%!2!2>%@	X~x/@/@		G^X->->		X~x/@/@	8*""8*vZ
x  Z
zZ h''Z z7B**7BtV$&FG@("3"3@H@B*("3"3*>	WR)+=>WR+-ABwOx((wOC?wOt%-8X..%-P`8`D 4h6G6G((<(0(9(9(3X5F5F#7#+#4#4\8**\8|83333t??Cu
-H--u
-p ""zHMMOIDD
CDsH^^$$^2)_^! ^!$^/.^/2^=<^=_
_