ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //opt/alt/python311/lib64/python3.11/__pycache__/zipfile.cpython-311.pyc

hpdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZ	ddlZejZn#e$rdZejZYnwxYw	ddlZn
#e$rdZYnwxYw	ddlZn
#e$rdZYnwxYwgdZGddeZGddeZexZZdZd	Zd	ZdZd
Z dZ!dZ"d
Z#dZ$dZ%dZ&dZ'dZ(dZ)ej*e(Z+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3d
Z4dZ5dZ6dZ7ej*e6Z8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@d
ZAdZBdZCdZDdZEdZFdZGd ZHd!ZId"ZJd#ZKdZLdZMd
ZNd$ZOd%ZPd&ZQd'ZRd(ZSej*eRZTdZUdZVdZWdZXdZYdZZdZ[dZ\d
Z]dZ^dZ_dZ`d)Zad*Zbej*eaZcd+Zdd,Zeej*edZfdZgdZhdZidZjdZkdZldZmdZnd
ZodZpd-Zqejrd.Zsd/Ztd0Zud1Zvd2Zwd3ZxGd4d5eyZzda{d6Z|d7Z}Gd8d9Z~Gd:d;Zidd<dd=dd>dd>dd>dd>dd?dd@d
dAddBdd?ddCddDd#dEdFdGdHdIdJdKZdLZdgdMZdNZGdOdPZGdQdRZGdSdTejZGdUdVejZGdWdXZGdYdZeZd[Zd\ZejZ	d]ZGd^d_eZGd`daeZdgdbZGdcddZdgdeZedfkredSdS)hzP
Read and write ZIP files.

XXX references to utf-8 need further investigation.
N)
BadZipFile
BadZipfileerror
ZIP_STOREDZIP_DEFLATED	ZIP_BZIP2ZIP_LZMA
is_zipfileZipInfoZipFile	PyZipFileLargeZipFilePathceZdZdS)rN)__name__
__module____qualname__./opt/alt/python311/lib64/python3.11/zipfile.pyrr,sDrrceZdZdZdS)rzu
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    N)rrr__doc__rrrrr0srri-.?s<4s4H2LHsPK	z<4s4B4HL2L5H2LsPK

 @iz<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK<HHctj}d}g}dx}}|dzt|krd||||dz\}}|dz|z}	||vr'||kr|||||	}d}|	}|dzt|kd|s|S|t|kr|||dd|S)NFrr$Tr)_EXTRA_FIELD_STRUCTunpacklenappendjoin)
extraxidsr5modifiedbufferstartixidxlenjs
          r_strip_extrarBs
 
'FH
FMEA
a%3u::

F5QU+,,	T
EDL$;;Ezz

eEAI.///EH
a%3u::

E



eEFFm$$$88FrcL	t|rdSn#t$rYnwxYwdS)NTF)_EndRecDataOSErrorfps r_check_zipfilerHsD
r??	4	



5s
!!cd}	t|drt|}n7t|d5}t|}dddn#1swxYwYn#ttf$rYnwxYw|S)zQuickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    FreadrFrbN)hasattrrHopenrEr)filenameresultrGs   rr
r
s
F
8V$$	,#x000FFh%%
,'++
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,Z 



Ms41AAAAAAAA10A1c
|tz}|dkr|S|||t}t|tkrt	dtjt|\}}}}|tkr|S|dks|dkrtd|tz}||krtd||||z
}|t}t|tkrt	d|ts^||krX||d}|t}t|tkrt	d|tstdtjt|\
}}	}
}}}
}}}}||z|ks|	dzt|zkrtd||t<||t<|
|t <||t"<||t$<||t&<||t(<||z
|t*<|S)	zM
    Read the ZIP64 end-of-archive records and use that to update endrec
    rzUnknown I/O errorr!z3zipfiles that span multiple disks are not supportedz.Corrupt zip64 end of central directory locatorz/Zip64 end of central directory record not foundrz-Corrupt zip64 end of central directory record)sizeEndCentDir64LocatorseekrJr6rEstructr5structEndArchive64LocatorstringEndArchive64LocatorrsizeEndCentDir64
startswithstringEndArchive64structEndArchive64_ECD_SIGNATURE_ECD_DISK_NUMBER_ECD_DISK_START_ECD_ENTRIES_THIS_DISK_ECD_ENTRIES_TOTAL	_ECD_SIZE_ECD_OFFSET
_ECD_LOCATION)fpinoffsetendrecdatasigdisknoreloffdisksextraszszcreate_versionread_versiondisk_numdisk_dirdircount	dircount2dirsize	diroffsets                  r
_EndRecData64rtsp%%F
zz
IIf99,--D
4yy+++)***!'/H$!O!OC
'''

{{eaiiNOOO
F
IJJJIIfvoG99%&&D
4yy$$$)***??-../6V3C3C	
		&yy)**t99(((-...??-..LJKKK	
($//0C^\8X)WiGv%%
R#g---HIII!F>'F&F?%-F!"!*FF9#F;"W,F=Mrc|dd|}	|tdn#t$rYdSwxYw|}t|tkr|ddtkr|dddkrttjt|}t|}|d||tz
t||tz
|St|dz
tz
d}||d|}|t}|dkr|||tz}t|tkrdSttjt|}|t}||tz|tz|z}|||||zt|||z|SdS)	zReturn data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.rr"Nr$sri)rRtellsizeEndCentDirrErJr6stringEndArchiverSr5structEndArchivelistr7rtmaxrfind_ECD_COMMENT_SIZE)	rbfilesizererdmaxCommentStartr=recDatacommentSizecomments	         rrDrD/s	IIaOOOyy{{H
		>/1%%%%tt99;;DD		^##QqS	%%%RSS	[  /66F||	

c

h/000T8n#<fEEE(g.?CCOIIoq!!!99;;DJJ'((EzzuU>112w<<>))4fm$4g>>??./u^+E.,@,LLM

g

o-...T?U#:FCCC4sA		
AAc\eZdZdZdZddZdZddZd	Zd
Z	e
dddd
ZdZdS)rz>Class with attributes describing each file in the ZIP archive.)
orig_filenamerN	date_time
compress_type_compresslevelrr9
create_systemrlextract_versionreserved	flag_bitsvolume
internal_attr
external_attr
header_offsetCRC
compress_size	file_size	_raw_time_end_offsetNoNamer!r!rrrcf||_|td}|dkr
|d|}tjdkr.tj|vr |tjd}||_||_|ddkrtdt|_
d|_d|_d|_
tjdkrd|_nd|_t"|_t"|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr/rz+ZIP does not support timestamps before 1980rwin32r#)rfindchrossepreplacerNr
ValueErrorrrrrr9sysplatformrDEFAULT_VERSIONrlrrrrrrrrr)selfrNr	null_bytes    r__init__zZipInfo.__init__s*%MM#a&&))	>>),H6S==RVx//''44H 
"Q<$JKKK("
<7""!"D"#D-.
rcd|jjd|jg}|jtkr;|dt|j|jz|jdz	}|jdz}|r*|dtj
|z|r|d|z|}|r|jr|d|jz|r|j
r=|jtks|j|j
kr|d	|j
z|d
d|S)N<z
 filename= compress_type=%sr-rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r>)	__class__rrNrrr7compressor_namesgetrstatfilemodeis_dirrrr8)rrOhiloisdirs     r__repr__zZipInfo.__repr__s{'+~'>'>'>

NO++MM-*..t/A/3/ACCC
D
D
D
2
%

&
(
	>MM.4=+<+<<===
	5MM.3444

	<	<MM/DN:;;;	D$,	D

:
-
-
^t1
1
1MM-0BBCCC

cwwvrNc|j}|ddz
dz|ddzz|dz}|ddz|d	dzz|ddzz}|jtzrdx}x}}n|j}|j}|j}|j}d}	||tkp
|tk}|r=d}
|tj	|
dtj
|
d	z
||z}d}d}t}	|jtkrtt|	}	n%|jt krtt"|	}	t|	|j|_t|	|j|_|\}}tj	t*t,|j|j||j|||||t1|t1|

}
|
|z|zS)
zReturn the per-file header as a bytes object.

        When the optional zip64 arg is None rather than a bool, we will
        decide based upon the file_size and compress_size, if known,
        False otherwise.
        rrr(r!r%r"r#r*r$Nz<HHQQ)rr_MASK_USE_DATA_DESCRIPTORrrrr9ZIP64_LIMITrSpackcalcsize
ZIP64_VERSIONrrr|
BZIP2_VERSIONr	LZMA_VERSIONrrl_encodeFilenameFlagsstructFileHeaderstringFileHeaderrr6)rzip64dtdosdatedostimerrrr9min_versionfmtrNrheaders              r
FileHeaderzZipInfo.FileHeaders^a54<A%1
2RU:Q%2+1
*beqj9>55	'.//C/-))(C .MI
=+J}{/JE	(CFK()6?3+?+?+A9m]]]E"I&M'K**m[99KK

8
+
+lK88K";0DEE!+t/BCC"7799)-/?!14=)!/'3*I ]]CJJ	88
 5((rc	|jd|jfS#t$r,|jd|jtzfcYSwxYw)Nasciiutf-8)rNencoderUnicodeEncodeError_MASK_UTF_FILENAMErs rrzZipInfo._encodeFilenameFlagssm	V=''00$.@@!	V	V	V=''00$.CU2UUUUU	Vs #3AAc|j}tj}t|dkr*|d|dd\}}|dzt|krt	d||fz|dkr|d|dz}	|jdvr'd}|d|dd\|_|dd}|jd	kr'd
}|d|dd\|_|dd}|jd	krd}|d|dd\|_n'#tj$rt	d|d
dwxYw||dzd}t|dk(dSdS)Nr$r2z"Corrupt extra field %04x (size=%d)r!)lrz	File sizez<Qrrz
Compress sizez
Header offsetzCorrupt zip64 extra field. z not found.)	r9rSr5r6rrrrr)rr9r5tplnrefields       r_decodeExtrazZipInfo._decodeExtras
%jjAooVE5!9--FB!tc%jj   !ER!PQQQV||Qr!tV}F~)MMM +*0&tBQBx*@*@#ABBx)[88 /.4fT48.D.D+*#ABBx)[88 /.4fT48.D.D+*|FFF$&;(-&;&;&;<<AEFF"Q$%%LE/%jjAoooooos
=B
D$D,Tstrict_timestampsct|tjrtj|}tj|}t	j|j}tj|j	}|dd}|s|ddkrd}n|s|ddkrd}||}tj
tj
|d}|dtj
tjfvr*|dd}|dtj
tjfv*|r|d	z
}|||}|jd
zdz|_|rd|_|xjdzc_n|j|_|S)a_Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        rr&rr;)rr;rNr!rrr-)
isinstancerPathLikefspathrS_ISDIRst_modetime	localtimest_mtimepathnormpath
splitdriveraltseprrst_size)	clsrNarcnamerstrmtimerzinfos	         r	from_filezZipInfo.from_fileszh,,	+y**H
WX

RZ((r{++!A#J	 	3Yq\D%8%8-II"	3y|d':':2I?G'""27#5#5g#>#>q#ABBajRVRY///abbkGajRVRY///	sNGGY''!zF2r9	)EO4' jEOrc|jdrdStjjr:|jtjjtjjfSdS)z2Return True if this archive member is a directory.rTF)rNendswithrrrrrs rrzZipInfo.is_dirAsV=!!#&&	4
7>	I=))27;*GHHHur)rrN)
rrrr	__slots__rrrrrclassmethodrrrrrrrksHHI0' ' ' ' X,.).).).)`VVV!!!:#D####[#J




rrcPtdD]}|dzr	|dz	dz}|dz}|S)Nrr!l q[)range)crcrAs  r_gen_crcrSsC
1XX7	!8z)CCAICCJrcdddt/tttt	datfdfd|D]
}|fd}|S)NixV4igE#ixV4c,|dz	||zdzzS)z(Compute the CRC32 primitive on one byte.rr)chrcrctables  rcrc32z_ZipDecrypter.<locals>.crc32ms qHcBh$%6777rcj|dzzdzdzdzdzdz	dS)Nrrir!r)crkey0key1key2s rupdate_keysz"_ZipDecrypter.<locals>.update_keysqsRuQ~~t$
2y 1$
2uTRZ&&rct}|j}|D].}dz}|||dzzdz	dzz}|||/t|S)zDecrypt a bytes object.r"r!rr)	bytearrayr7bytes)rerOr7rkrrs     r	decrypterz _ZipDecrypter.<locals>.decrypter{so		AqA
1!9"d**AKNNNF1IIIIV}}r)	_crctabler{maprr)	pwdprrrrrrrs	   @@@@@@r
_ZipDecrypterrcsDDDXuSzz2233	H88888''''''''A						rc&eZdZdZdZdZdZdS)LZMACompressorcd|_dSr)_comprs rrzLZMACompressor.__init__s



rctjdtji}tjtjtjtj|g|_tjdddt||zS)Nidfiltersz<BBHr(r$)
lzma_encode_filter_propertiesFILTER_LZMA1r
FORMAT_RAW_decode_filter_propertiesrrSrr6)rpropss  r_initzLZMACompressor._initss.d6G/HII(*4+<eDDC

{61aU44u<<rc|j/||j|zS|j|Sr)rr compress)rres  rr"zLZMACompressor.compresssC:::<<$*"5"5d";";;;z""4(((rc|j.||jzS|jSr)rr flushrs rr$zLZMACompressor.flushs?:::<<$*"2"2"4"444z!!!rN)rrrrr r"r$rrrrrsP===)))
"""""rrceZdZdZdZdS)LZMADecompressorc0d|_d|_d|_dS)NrF)_decomp_unconsumedeofrs rrzLZMADecompressor.__init__src
|j|xj|z
c_t|jdkrdStjd|jdd\}t|jd|zkrdStjt
jtjt
j	|jdd|zg|_|jd|zd}|`|j
|}|jj|_|S)Nr$rz<Hr"r)r(r)r6rSr5rr&rrr
decompressr*)rrepsizerOs    rr,zLZMADecompressor.decompresss<$4#$$))s]4)9!A#)>??FE4#$$E	11s0.t/@/3/?!e)/LNNKDL#AIJJ/D ((..<#
rN)rrrrr,rrrr&r&s2
rr&storeshrinkreduceimplodetokenizedeflate	deflate64bzip2rterselz77awavpackbppmdc|tkrdS|tkrtstddS|tkrt
stddS|tkrtstddStd)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rrzlibRuntimeErrorrbz2r	rNotImplementedError)compressions r_check_compressionrCsj  		$	$	B@BB
B	B	B
		!	!	A?AA
A	A	A
	 	 	B@BB
B	B	B""LMMMrcN|tkrL| tj|tjdStjtjtjdS|t
kr)|t
j|St
jS|tkrtSdS)N)
rr>compressobjDEFLATEDZ_DEFAULT_COMPRESSIONrr@
BZ2Compressorr	r)r
compresslevels  r_get_compressorrKs$$$#M4=#FFF :DM3OOO	)	#	#$$]333 """	(	"	"trclt||tkrdS|tkrtjdS|t
krt
jS|tkrtSt|}|rtd||fztd|fz)NrEzcompression type %d (%s)zcompression type %d)
rCrrr>
decompressobjrr@BZ2Decompressorr	r&rrrA)rdescrs  r_get_decompressorrPs}%%%
""t	,	&	&!#&&&	)	#	#"$$$	(	"	"!!! $$]33	P%&@MSXCY&YZZZ%&;}>N&NOOOrc0eZdZdZdZd	dZd
dZdZdS)_SharedFilecd||_||_||_||_||_|j|_dSr)_file_pos_close_lock_writingseekable)rfileposcloselockwritings      rrz_SharedFile.__init__s2
	





rc|jSr)rUrs rrwz_SharedFile.tells
yrrc
|j5|rtd|j|||j|_|jcdddS#1swxYwYdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rWrXrrTrRrwrU)rrcwhences   rrRz_SharedFile.seeks
Z		}}
K "JKKK
JOOFF+++
))DI9																		sA#A88A<?A<c<|j5|rtd|j|j|j|}|j|_|cdddS#1swxYwYdS)NyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rWrXrrTrRrUrJrwrnres   rrJz_SharedFile.reads
Z		}}
K "JKKK
JOODI&&&:??1%%D
))DI																		sA<BBBc^|j%|j}d|_||dSdSr)rTrV)rfileobjs  rr\z_SharedFile.close&s8:!jGDJKK     "!rNrrb)rrrrrwrRrJr\rrrrRrRsi&&&				!!!!!rrRc,eZdZdZdZdZdZdZdS)	_Tellablec"||_d|_dSNr)rGrcrrGs  rrz_Tellable.__init__.srcZ|j|}|xj|z
c_|Sr)rGwriterc)rrerfs   rrqz_Tellable.write2s*GMM$qrc|jSr)rcrs rrwz_Tellable.tell7s
{rc8|jdSr)rGr$rs rr$z_Tellable.flush:

rc8|jdSr)rGr\rs rr\z_Tellable.close=rtrN)rrrrrqrwr$r\rrrrlrl-s_
rrlceZdZdZdZdZdZ		ddZdZd	Z	ddZ
dd
ZdZddZ
dZdZdZdZfdZdZddZdZxZS)
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    i@iiNFc&||_||_||_|j|_|j|_|j|_t|j|_
d|_d|_d|_
d|_||_|j|_t%|dr!|j|_t+d|_nd|_d|_	|rD||_|j|_|j|_|j|_d|_n#t<$rYnwxYwd|_|r[|j tBzr|j"dz	dz}n
|jdz	dz}|#}||krtId	|j%zdSdS)
NFrrrTrrrzBad password for file %r)&_fileobj_pwd_close_fileobjr_compress_typer_compress_leftr_leftrP
_decompressor_eof_readbuffer_offsetnewlinesmoderNnamerLr
_expected_crcr_running_crc	_seekablerYrw_orig_compress_start_orig_compress_size_orig_file_size_orig_start_crcAttributeError
_decrypterrrr_init_decrypterr?r)rrhrzipinfor
close_fileobj
check_bytehs        rrzZipExtFile.__init__Os
	+%3%3&
.t/BCC	
	$	7E""	&!(D %c

D!%D	!!
&,3LLNN)+2+@('.'8$'+'8$!%			D			W #<<
8%/14<

&kR/47
$$&&AJ"#=@U#UVVV		W		WsAD
D('D(ct|j|_|jd}|xjdzc_||dS)Nrr*)rrzrryrJr})rrs  rrzZipExtFile._init_decryptersU'	22##B''r!v&&r**rcd|jjd|jjg}|jsq|d|jd|j|jtkr;|dt
|j|jzn|d|dd|S)	Nr.z name=z mode=r	 [closed]rr)rrrclosedr7rrr|rrrr8rrOs  rrzZipExtFile.__repr__s"n777"n99;<{	'MMM			499EFFF"j00

1.2243F373FHHHIII
MM+&&&

cwwvrrbc|dkrF|jd|jdz}|dkr|j|j|}||_|Stj||S)zrRead and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        r
r!)rrrioBufferedIOBasereadline)rlimitr>lines    rrzZipExtFile.readlinesm199 %%eT\::Q>A1uu'a8  ))$666rr!cV|t|j|jz
krn||}t||jkr$||j|jdz|_d|_n|xjt|zc_|j|j|jdzS)z6Returns buffered bytes without advancing the position.Nri)r6rrrJ)rrfchunks   rpeekzZipExtFile.peekss4#$$t|333IIaLLE5zzDL((#(4+;DLMM+J#J  E

*dlS.@ @AArc2|jrtddS)NI/O operation on closed file.T)rrrs rreadablezZipExtFile.readables ;	><===trc|jrtd||dkrO|j|jd}d|_d|_|js$|||jz
}|j$|S||jz}|t|jkr|j|j|}||_|S|t|jz
}|j|jd}d|_d|_|dkro|jsh||}|t|kr||_||_||d|z
}n$||z
}|t|z}|dkr|jh|S)zRead and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        zread from closed file.Nrr)rrrrr_read1MAX_Nr6)rrfbufendres     rrJzZipExtFile.readsx;	756669A"4<==1C"DDLi
/t{{4:...i
/J$,T%&&&&"4<#34CDLJ#d&'''t|}}-!eeDIe;;q>>D3t99}}#'  tBQBx4KC
TNA!eeDIe
rc|jdSt||j|_|jr'|j|jkrt	d|jzdSdS)NzBad CRC-32 for file %r)rrrrrr)rnewdatas  r_update_crczZipExtFile._update_crcsh%F!'4+<==9	C*d.@@@5	ABBB	C	C@@rcn||dkrT|j|jd}d|_d|_|js)||j}|r||z
}n|j)|S||jz}|t|jkr|j|j|}||_|S|t|jz
}|j|jd}d|_d|_|dkrZ|jsS||}|t|kr||_||_||d|z
}n|r||z
}n|jS|S)z7Read up to n bytes with at most one read() system call.Nrr)rrrrrr6)rrfrrers     rread1zZipExtFile.read1sk
9A"4<==1C"DDLi
{{4:..4KC	i

J$,T%&&&&"4<#34CDLJ#d&'''t|}}-q55i	
{{1~~s4yy=='+D$#$DL48OC4KCi	

rcl|js|dkrdS|jtkrH|jj}|t|kr(|||t|z
z
}n||}|jtkr|jdk|_n|jtkr}t||j
}|j||}|jjp|jdko|jj|_|jr||j
z
}n6|j|}|jjp
|jdk|_|d|j}|xjt|zc_|jdkrd|_|||S)NrrT)rr|rrunconsumed_tailr6_read2rr}r|
MIN_READ_SIZEr,r*r$r~rres   rrzZipExtFile._read1s9	Q3,..%5D3t99}}AD		M222;;q>>D*,,+q0DII

 L
0
0At)**A%00q99D+/@,1@!/??
Iy
3*00222%0066D*.J$2E2JDIKTZK 

c$ii

:??DIrc,|jdkrdSt||j}t||j}|j|}|xjt
|zc_|st|j||}|S)Nrr)	r}r|rminryrJr6EOFErrorrres   rrzZipExtFile._read23s!##34%&&4&''}!!!$$s4yy(	N?&??4((Drc	|jr|jtdS#twxYwr)r{ryr\superrrs rr\zZipExtFile.closeCsR	"
&
##%%%GGMMOOOOOEGGMMOOOOs A"A'c<|jrtd|jSNr)rrrrs rrYzZipExtFile.seekableJs#;	><===~rrc^|jrtd|jstjd|}|dkr|}n,|dkr||z}n |dkr|j|z}ntd||jkr|j}|dkrd}||z
}||jz}|dkr"|t|j	kr
||_d}n|dkr|j
|j|j
|_|j|_|j|_d|_	d|_t%|j|_d|_|}|j||dkr5t1|j|}||||z}|dk5|S)	Nzseek on closed file.!underlying stream is not seekablerr!r"zCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)rF)rrrrUnsupportedOperationrwrrr6rryrRrrrrr}r~rPr|rrrrr
MAX_SEEK_READrJ)rrcracurr_posnew_posread_offsetbuff_offsetread_lens        rrRzZipExtFile.seekOs;	53444~	O)*MNNN99;;Q;;GG
q[['GG
q[[*V3GGCDD
DT)))*GQ;;G(!DL0!c$2B.C.C C C&DLKK
1__Mt8999 $ 4D"&":D-DJ"DDL!243F!G!GDDI!K*$$&&&Aoo4-{;;HIIh8#KAoo
yy{{rc|jrtd|jstjd|j|jz
t|jz
|j	z}|S)Nztell on closed file.r)
rrrrrrr~r6rr)rfileposs  rrwzZipExtFile.tellsc;	53444~	O)*MNNN&3c$:J6K6KKdlZr)NFrjr!ri)rrrrrrrrrrrrrrJrrrrr\rYrRrw
__classcell__rs@rrwrwAsX

EMM37$0W0W0W0Wf	+	+	+7777 BBBB
!!!!FCCC###J"""H 
0000drrwcFeZdZdZedZdZdZfdZxZ	S)
_ZipWriteFilec||_||_||_t|j|j|_d|_d|_d|_	dSrn)
_zinfo_zip64_zipfilerKrr_compressor
_file_size_compress_size_crc)rzfrrs    rrz_ZipWriteFile.__init__sP
*5+>+0+?AA			rc|jjSr)rrGrs rryz_ZipWriteFile._fileobjs
}rcdS)NTrrs rwritablez_ZipWriteFile.writablestrc|jrtdt|ttfrt|}nt
|}|j}|xj|z
c_t||j
|_
|jr7|j|}|xj
t|z
c_
|j||Sr)rrrr
r	r6
memoryviewnbytesrrrrr"rryrq)rrers   rrqz_ZipWriteFile.writes;	><===dUI.//	!YYFFd##D[F6!$	**		-#,,T22D3t99,
D!!!
rc	L|jrdS	t|jrb|j}|xjt
|z
c_|j||j|j	_
n|j|j	_
|j|j	_
|j|j	_|js>|jt krt#d|jt krt#d|j	jt&zr|jrdnd}|jt)j|t,|j	j
|j	j
|j	j|j|j_n|j|j_|j|j	j|j|j	|j|j|jj|jj|j	|j	|jj|j	j <d|j_!dS#d|j_!wxYw)Nz*File size too large, try using force_zip64z0Compressed size too large, try using force_zip64z<LLQQz<LLLLF)"rrr\rr$rr6ryrqrrrrrrrrr?rrrSr
_DD_SIGNATURErwr	start_dirrRrrfilelistr7
NameToInforNrX)rrrrs   rr\z_ZipWriteFile.closesE;	F(	+GGMMOOO
<&,,..##s3xx/##
##C(((,0,?)),0O)"iDKO$(ODK!;
[?[00&'STTT&44&'YZZZ{$'@@
<!%9gg'
##FK]DKOK-t{/D%F%FGGG*.-*<*<*>*>
''+/-*<*<*>*>
'
""4;#<===
##DK$:$:4;$G$GHHH
""4=#:;;;
M"))$+666=A[DM$T[%9:%*DM"""UDM"****sI;JJ#)
rrrrpropertyryrrqr\rrs@rrrs  X &++++++++++++++++++rrc,eZdZdZdZdZdeddfddddZdZdZ	d	Z
d
ZdZdZ
d%d
ZdZdZdZedZejdZd%dZd&dddZd'dZd(dZd)dZedZdZdZ		d)dZ	d(dZd*d Z d!Z!d"Z"d#Z#d$Z$dS)+rai Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    NrT)rmetadata_encodingc|dvrtdt|||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_||_
|j
r|dkrtdt|tjrtj|}t|t$r[d|_||_d	d
ddd
d
dd}||}			t+j||	|_n#t0$r|	|vr
||	}	Y5wxYwn$d|_||_t3|dd|_d|_t7j|_d|_d|_	|dkr| dS|dvrd|_	|j!|_"	|j#|j"dS#tHt0f$rd|_YdSwxYw#tHt0f$r+tK|j|_d|_"d|_YdSwxYw|dkr	| |j#|j"dS#tL$rD|j#ddd|_|j!|_"YdSwxYwtd#|j}
d|_|'|
xYw)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.)rwxaz+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNrrz5metadata_encoding is only supported for reading filesrKw+bx+br+bwbxb)rrrrrrrTr!r)rrrr"z"Mode must be 'r', 'w', 'x', or 'a')(rrC_allowZip64
_didModifydebugrrrBrJrr_comment_strict_timestampsrrrrrstr_filePassedrNrrMrGrEgetattr_fileRefCnt	threadingRLockrWrrX_RealGetContentsrwrrRrrlr_fpclose)rrZrrB
allowZip64rJrrmodeDictrrGs           rrzZipFile.__init__ss+++JKKK;'''%

&*	
"3!2!	IdckkGII
IdBK((	#9T??DdC  	8 D DM"U%$T$@@H~H
 gdH55DGG8++#+H#5 	
 DDG#D&$77DM_&&

'	s{{%%'''''###'/%)W\\^^DN/T^44444*G4///)./'0+++'00DG%&DN%*DNNNN+4))+++GLL00000!444GLLA&&&'+DO%)W\\^^DNNNN4!!EFFF	BDGMM"s8DD-+D-K%K%+H

G++HK%HK%
8IK%I	K%3JA
KK%KK%%&Lc|Srrrs r	__enter__zZipFile.__enter__Xsrc.|dSrr\)rtypevalue	tracebacks    r__exit__zZipFile.__exit__[s

rcd|jjd|jjg}|jg|jr|d|jzn$|j|d|jz|d|jzn|d|dd|S)	Nrrz file=%rz filename=%rz mode=%rrrr)	rrrrGrr7rNrr8rs  rrzZipFile.__repr__^s"n777"n99;<7
>

j4723333*

nt}<===MM*ty01111MM+&&&

cwwvrcb|j}	t|}n#t$rtdwxYw|std|jdkrt||t}|t}|t|_	|t|z
|z
}|jdkr||z}td|||||z|_|jdkrtd||jd|
|}tj|}d}||kr|
t }	t#|	t krtdt%jt(|	}	|	t*t,krtd|jdkrt|	|
|	t.}
|	t0}|t2zr|
d	}
n|
|jpd
}
t9|
}|
|	t:|_|
|	t>|_ |	tB|_"|	dd\|_#|_$|_%|_&|_'|_(}
}|_)|_*|_+|j%tXkrt[d|j%d
zz|	dd\|_.|_/|_0|
|_1|dz	dz|dz	dz|dz|
dz	|
dz	dz|
dzdzf|_2|3|j"|z|_"|j45|||j6|j7<|t z|	t.z|	t:z|	t>z}|jdkrtd|||k|j}tq|j4ddD]}||_9|j"}dS)z/Read in the table of contents for the ZIP file.zFile is not a zip filer!r"zgiven, inferred, offsetrz Bad offset for central directoryzTruncated central directoryz&Bad magic number for central directoryrcp437rzzip file version %.1fr)r,r/r(rr%rr*r totalc|jSr)r)rs r<lambda>z*ZipFile._RealGetContents.<locals>.<lambda>s	e.ArT)keyreverseN):rGrDrErrprintr_r`_ECD_COMMENTrrarrRrJrBytesIOsizeCentralDirr6rSr5structCentralDir
_CD_SIGNATUREstringCentralDir_CD_FILENAME_LENGTH
_CD_FLAG_BITSrdecoderr_CD_EXTRA_FIELD_LENGTHr9_CD_COMMENT_LENGTHr_CD_LOCAL_HEADER_OFFSETrrlrrrrrrrrMAX_EXTRACT_VERSIONrArrrrrrrr7rrNsortedr)rrGrdsize_cd	offset_cdconcatinferredrercentdirrNflagsrtd
end_offsetrs                 rrzZipFile._RealGetContentsls*
W	7 __FF	7	7	75666	7	75666:>>&MMM#;'	|,

&09<:>>	)H+Y&III"V+>A?@@@
"""www
Z

googgn--G7||~-- !>???m$4g>>G}%)999 !IJJJzA~~gwww':;<<HM*E))
N#??733$??4+A+LWMM!!Aggg&<=>>AG(: ;<<AI%&=>AO5<AbDM
2Q
q0A1:
[!/1a
UAOQ[ #666)*A+,+<r+A+CDDD9@B6AHaoqAKT4K!Q$QtVrEAqD$;41?AK
NNo6AOM  ###*+DOAJ'^+g6I.JJ567123EzA~~gu%%%[goo^^
DM A A$(***	-	-E!+E,JJ		-	-s3c$d|jDS)z+Return a list of file names in the archive.cg|]	}|j
SrrN).0res  r
<listcomp>z$ZipFile.namelist.<locals>.<listcomp>s888$
888rrrs rnamelistzZipFile.namelists88$-8888rc|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.r*rs rinfolistzZipFile.infolist}rctddz||jD]5}d|jddz}td|j||jfz|6dS)z+Print a table of contents for the zip file.z%-46s %19s %12s)z	File NamezModified    SizerZz%d-%02d-%02d %02d:%02d:%02dNr&z
%-46s %s %12d)r
rrrNr)rrZrdates    rprintdirzZipFile.printdirs
"GG				]		E05?2A23FFD/U^T5?$KK




		rcd}|jD]z}	||jd5}||r	||dddn#1swxYwYb#t$r|jcYcSwxYwdS)z%Read all the files and check the CRC.irN)rrMrNrJr)r
chunk_sizerfs    rtestzipzZipFile.testzips
]	&	&E
&YYu~s33q&&,,&&,,
&
&
&~%%%%%
&	&	&s4A,,A A, A$	$A,'A$	(A,,BBcb|j|}|td|z|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)rrKeyError)rrinfos   rgetinfozZipFile.getinfos@""4((<:TACC
Crc|r9t|ts$tdt|jz|r	||_dSd|_dS)z)Set default password for encrypted files.pwd: expected bytes, got %sN)rr
	TypeErrorrrr)rrs  rsetpasswordzZipFile.setpasswordsX	Pz#u--	P9DII<NNOOO	DHHHDHHHrc|jS)z.The comment text associated with the ZIP file.)rrs rrzZipFile.commentr.rc(t|ts$tdt|jzt|tkr2ddl}|dtzd|dt}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr"
stacklevelT)rr
r>rrr6ZIP_MAX_COMMENTwarningswarnrr)rrrEs   rrzZipFile.comments'5))	X=W

@VVWWWw<</))OOOMMO+,89

;
;
;../G
rc||d|5}|cdddS#1swxYwYdS)zReturn file bytes for name.rNrMrJ)rrrrGs    rrJzZipFile.reads
YYtS#
&
&	"7799																		s
9==Fforce_zip64c|dvrtd|r|dkrtdjstdt|tr|}nC|dkr(t|}j|_j|_n|}|dkr	||Sj
rtdxjdz
c_tj|j
jjfd	}	|t"}t%|t"krt'd
t)jt,|}|t.t0krt'd||t2}|t4r ||t4|jt8zrt;d|jt<zrt;d
|t>t@zr|!d}	n|!j"pd}	|	|j#krt'd|j#d|d|j$=|%|j&z|j$krt'd|j#d|jtNz}
|
rY|sj(}|r9t|tRs$tUdtW|j,z|st[d|znd}t]||||dS#|/xYw)auReturn file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        >rrzopen() requires mode "r" or "w"rz'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedrIrdr!cjSr)rXrsrr
zZipFile.open.<locals>.<lambda>6s	$-rzTruncated file headerz Bad magic number for file headerz$compressed patched data (flag bit 5)zstrong encryption (flag bit 6)rrzFile name in directory z and header z differ.NzOverlapped entries: z (possible zip bomb)r=z6File %r is encrypted, password required for extractionT)0rrGrrrBrrJrr;_open_to_writerXrrRrrrWrJsizeFileHeaderr6rrSr5r
_FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHr_MASK_COMPRESSED_PATCHrA_MASK_STRONG_ENCRYPTION_FH_GENERAL_PURPOSE_FLAG_BITSrrrrrrwr_MASK_ENCRYPTEDrr
r>rrr?rwr\)rrrrrJrzef_filefheaderfname	fname_stris_encrypteds`          rrMzZipFile.opens z!!>???	HDCKKFGGGw	FDFF
FdG$$		'EE
S[[DMME"&"2E#'#5E  LL&&E3;;&&u+&FFF=	GFGG
G
	
Atw(;#}dj:O:O:O:OQQ4	mmN33G7||~-- !8999m$4g>>G}%)999 !CDDDMM'*=">??E-.
?

g&<=>>>!77
R)*PQQQ!88
L)*JKKK458JJ
L!LL11		!LL)?)J7KK	E/// j***EEE3444!-

%"558III !c8K!c!c!cddd!?_<L	
#(CXz#u55X#$ADIIDV$VWWWI&(ACG(HIIIIheS$???	NNs
H8MMc|r|jstd|jrtdd|_d|_d|_|jtkr|xjtzc_|j	s|xjtzc_|jsd|_|p|jdztk}|js|rtd|j	r|j|j|j|_||d|_|j||d|_t1|||S)NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rg?z'Filesize would require ZIP64 extensionsT)rrrXrrrrr	_MASK_COMPRESS_OPTION_1rrrrrrrGrRrrwr_writecheckrrqrr)rrrJrs    rrMzZipFile._open_to_writems{	t/	 
=	ONOO
O
 	(**OO66OO~	9OO88OO"	."-EE$ 6 D	JE	JHIII>	)GLL((("gllnn

e&&u--...
T5%000rc|tj}ntj|}||||S)a#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        )rgetcwdr_extract_member)rmemberrrs    rextractzZipFile.extracts;<9;;DD9T??D##FD#666rc||}|tj}ntj|}|D]}||||dS)zExtract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N)r+rr`rra)rrmembersrrs     r
extractallzZipFile.extractallsi?mmooG<9;;DD9T??D	5	5G  $4444	5	5rc&|j}|s4d}t|dt|z}||_||}d||D}|d|D}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*_c3@K|]}|dVdS)rN)rstripr(rs  r	<genexpr>z1ZipFile._sanitize_windows_name.<locals>.<genexpr>s,AAQ188C==AAAAAArc3K|]}||V	dSrrrks  rrlz1ZipFile._sanitize_windows_name.<locals>.<genexpr>s'77QQ7q777777r)!_windows_illegal_name_trans_tabler	maketransr6	translatesplitr8)rrpathseptableillegals     r_sanitize_windows_namezZipFile._sanitize_windows_names5	:GMM'3W+=>>E49C1##E**AA'--*@*@AAA,,77'77777rcrt|ts||}|jdt
jj}t
jjr4|t
jjt
jj}t
j	|d}dt
jj
t
jjft
jjfd|
t
jjD}t
jjdkr%||t
jj}t
j||}t
j|}t
j|}|r3t
j|stj||r5t
j|stj||S|||5}t-|d5}t/j||dddn#1swxYwYdddn#1swxYwY|S)	zbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        rr!rc3$K|]
}|v|VdSrr)r(rinvalid_path_partss  rrlz*ZipFile._extract_member.<locals>.<genexpr>s>#C#C&'/A&A&A$%&A&A&A&A#C#Cr\rrN)rrr;rNrrrrrrcurdirpardirr8rqrurdirnameexistsmakedirsrrmkdirrMshutilcopyfileobj)	rrb
targetpathrr	upperdirssourcetargetrxs	        @rrazZipFile._extract_members&'**	*\\&))F/))#rw{;;
7>	CoobgnbgkBBG'$$W--a0 "'."'.A'+""#C#C#C#CgmmBGK.H.H#C#C#CCC
7;$11'27;GGGW\\*g66
W%%j11
GOOJ//		#RW^^I66	#K	"""==??	7==,,
%$$$
YYv3Y
'
'	/6
*d
#
#	/'-vv...	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/s6"J,3J	J,J	J,J	J,,J03J0c|j|jvr#ddl}|d|jzd|jdvrtd|jstdt|j|j	s[d}t|jtkrd	}n%|j
tkrd
}n|jtkrd}|rt!|dzdSdS)
z6Check for errors before writing a file to the archive.rNzDuplicate name: %rr#rBrrrz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closedFiles countFilesizezZipfile size would require ZIP64 extensions)rNrrErFrrrGrCrrr6rZIP_FILECOUNT_LIMITrrrr)rrrErequires_zip64s    rr^zZipFile._writechecks>T_,,OOOMM.?AMNNN9O++EFFFw	HFHH
H5.///
	F!N4=!!%888!.;..!+${22!/
F">#D$EFFF
	F
	F
F
FrcF|jstd|jrtdt|||j}|r%d|_d|_|	|dS|||_
n|j|_
|||_n|j
|_t|d5}||d5}tj||ddddn#1swxYwYddddS#1swxYwYdS)	zLPut the bytes from filename into the archive under the name
        arcname.7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsrrNrKri )rGrrXrrrrrrrrrBrrJrMrr)rrNrrrJrsrcdests        rrqz
ZipFile.writesw	KIKK
K=	P
!!(G484K"MM<<>>	6"#EEIJJu(&3##&*&6#('4$$'+'9$h%%
6diis.C.C
6t"3f555
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6s6DC>2D>D	DD	DDDct|tr|d}t|tst|t	jt	jdd}|j|_|j|_	|j
ddkrd|_|xjdzc_n
d	|_n|}|jstd
|jrtd|||_|||_	t||_|j5||d
5}||dddn#1swxYwYddddS#1swxYwYdS)aWrite a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.rNr&)rNrrbriAr-r\rz?Can't write to ZIP archive while an open writing handle exists.r)r)rrrrrrrBrrJrrNrrGrrXr6rrWrMrq)rzinfo_or_arcnamererrJrrs       rwritestrzZipFile.writestr&sdC  	(;;w''D*G44	%%5&*nTY[[&A&A"1"&EGGGE"&"2E#'#5E ~b!S((&3###t+###&1##$Ew	KIKK
K=	Q
$"/E$#0E d))
Z	!	!5s++
!t

4   
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!s6 E28EE2E	E2!E	"E22E69E6ct|tr&|}|stdnt|tra|}|ds|dz
}t|}d|_d|_d|zdzdz|_d|_	|xjdzc_ntd|j5|jr|j
|j|j
|_|jt&kr|xjt*zc_||d|_|j|||j|j<|j
|d	|j
|_d
d
d
d
S#1swxYwYd
S)z+Creates a directory inside the zip archive.z/The given ZipInfo does not describe a directoryrri@rr-zExpected type str or ZipInfoTFN)rrrrrrrrrrr>rWrrGrRrrwrrr	rr]r^rrr7rrNrqr)rzinfo_or_directory_namerrdirectory_names     rrz
ZipFile.mkdirOs-w77	<+E<<>>
T !RSSS
T
/
5
5	<4N!**3//
&#%N++E"#EEI$+dNf#<"CEEO4':;;;
Z	,	,~
-T^,,,"&',,..E"h..#::U###"DOM  '''.3DOEN+GMM%**511222!W\\^^DN	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,sC:GGGc.|dS)z2Call the "close()" method in case the user forgot.Nrrs r__del__zZipFile.__del__rs

rc|jdS|jrtd	|jdvr`|jrY|j5|jr|j|j|	dddn#1swxYwY|j}d|_|
|dS#|j}d|_|
|wxYw)zOClose the file, and for mode 'w', 'x' and 'a' write the ending
        records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r)rGrXrrrrWrrRr_write_end_recordrros  rr\z
ZipFile.closevs/7?F=	QPQQ
Q		yO+++Z--~5T^444**,,,---------------
BDGMM"BDGMM"s.B/;A?3B/?BB/BB//%Ccb	|jD]}|j}|ddz
dz|ddzz|dz}|ddz|d	dzz|ddzz}g}|jtks|jtkr9||j||jd
}d
}n|j}|j}|jtkr||jd
}n|j}|j}	d}
|rQt|	d}	tj
dd
t|zzddt|zg|R|	z}	t}
|j
tkrtt |
}
n%|j
t"krtt$|
}
t|
|j}t|
|j}|\}
}tj
t,t.||j||j||j
|||j||t|
t|	t|jd|j|j|}|j||j|
|j|	|j|j|j }t|j}||j!z
}|j!}d}|tDkrd}n|tkrd}n
|tkrd}|r|j#stI|dztj
tJtLtNdz
dddd||||}|j|tj
tPtRd|d}|j|tU|d}tU|d
}tU|d
}tj
tVtXdd||||t|j-		}|j||j|j-|j.dkr|j/|j0dS)Nrrr(r!r%r"r#r*r$rrr2QrrzCentral directory offsetzCentral directory sizerrrrr)1rrrrrr7rr9rBrSrr6rrrr|rr	rrrlrrrrrrrrrrGrqrwrrrrrYrXrVrTrUrrzryrrtruncater$)rrrrrr9rrr
extra_datarrrlrNrr pos2centDirCountcentDirSize
centDirOffsetrzip64endreczip64locrecrds                        rrzZipFile._write_end_records|]3	)3	)EB!ut|)BqEQJ6A>GerkBqEQJ."Q%1*=GE,,%33U_---U0111&	 *

!O	 % 3
"[00U0111 *

 % 3
JK
,)*d;;
#[CE

N*qU|-&+---/9:
,"i//!-==$00!,<<!+u/DEEO e.BCCN"'"<"<">">Hik"2"2N"'"5"+U-@'7"')]I"%h--Z#emBTBT"#U%8%:M"/11G
GMM'"""GMM(###GMM*%%%GMM%-((((w||~~4=))T^+
---*NN
[
(
(7NN
;
&
&5N	;#
F">#D$EFFF +"$6 2%r2q!\<],,K
GMM+&&& +))1dA77K
GMM+&&&|V44Lk:66K
z::M-/?<(-T]9K9KMM	


f

dm$$$9G

rc|jdksJ|xjdzc_|js|js|dSdSdS)Nrr!)rrr\ros  rrzZipFile._fpclosesd!####A	(8	HHJJJJJ				rr)rN)F)NN)NNN)r)%rrrrrGrnrrrrrrr+r-r3r7r;r?rrsetterrJrMrMrcrfrrurar^rqrrrr\rrrrrrrsx,
B(,%"%:$#^:>RV^^^^^@Q-Q-Q-f999
&&&X
^

^

dEdddddL(1(1(1(1T77775555"[(((TFFF.'+046666D48'!'!'!'!R!,!,!,!,F,\\\|rrc0eZdZdZdeddfdZd
dZd	ZdS)r
zDClass to create ZIP archives with Python library files and packages.rTrbcRt|||||||_dS)N)rrBr)rr	_optimize)rrZrrBroptimizes      rrzPyZipFile.__init__s5t$K$.		0	0	0!rrNc`tj|}|rL||sA|jr8tj|rdnd}t|d|ddStj|\}}tj|rtj|d}tj|r|r|d|}n|}|jrtd|d	||	|d
d|\}}	|jrtd|	|
||	ttj|}
|

d|
D]5}tj||}tj|\}
}tj|rVtjtj|dr||||
|dkru|r%||s|jrtd|z|	|d
d|\}}	|jrtd|	|
||	7dS|jrtd|ttj|D]}tj||}tj|\}
}|dkru|r%||s|jrtd|zq|	|d
d|\}}	|jrtd|	|
||	dS|dddkrt!d|	|d
d|\}}	|jrtd|	|
||	dS)aAdd all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        rrZ z skipped by filterfuncNz__init__.pyrzAdding package inasrAdding)
filterfunc.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)rrrrrr
rqr8isfile
_get_codenamerqrlistdirremovesplitextwritepyr?)rpathnamebasenamerlabeldirrinitnamerXrdirlistrNrrootexts               rrzPyZipFile.writepys[9X&&	jj22	z
I"$'--"9"9EvuuuhhhGHHHFGMM(++	T
7=="";	'w||Hm<<Hw~~h''1
3$*2((DD9HH#H:I-xxHHH!%!3!3HQrTNH!M!Mw:-(G,,,

5'*** H!5!566}--- '33H7<<(;;D " 0 0 : :ID#w}}T**37>>"',,t]*K*KLL@ LLx4>)@@@%%jj.>.>%#zN %&E&L M M M$)-););D2J<D*F*Fw:5!(G444

5'222#33(:C7BBB &rz(';'; < <33H7<<(;;D " 0 0 : :ID#e||%%jj.>.>%#zN %&E&L M M M$)-););D2J<D*F*Fw:5!(G444

5'22233}%%"DFFF!//2IINE7z
.mW---JJug&&&&&rc8d
fd	}|dz}|dz}tj|d}tj|d}tj|d}jdkrtj|r:t	j|jt	j|jkr|x}	}
ntj|r:t	j|jt	j|jkr|}
|}	ntj|r:t	j|jt	j|jkr|}
|}	n^tj|r:t	j|jt	j|jkr|}
|}	n||r5tj
jd	kr|}
ntj
jdkr|}
n|}
|}	n|x}
}	njd	kr|}
|}	nG|}	jdkr|}
n7jdkr|}
n)d
j}t|tj|
r4t	j|
jt	j|jks||js|x}
}	tj|	d}|r|d|}|
|fS)aReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        rbcddl}jrtd|	||d|n,#|j$r}t|jYd}~dSd}~wwxYwdS)Nr	CompilingT)doraiserF)
py_compilerr
compilePyCompileErrormsg)rZrrerrrs    r_compilez)PyZipFile._get_codename.<locals>._compileSsz
)k4(((
""4"IIII,


cguuuuu
4s7
A AA rz.pycr)optimizationr!r"rz"invalid value for 'optimize': {!r})rrrj)	importlibutilcache_from_sourcerrrrrrrr!rformatrrq)
rrrrfile_pyfile_pycpycache_opt0pycache_opt1pycache_opt2rrXrarchivenames
`            rrzPyZipFile._get_codenameLs												e#f$ ~77b7QQ ~77a7PP ~77a7PP>Rx((!
.'(##,0@0@0III"**%%'....
.',''0BGG4D4D4MMM%"'....
.',''0BGG4D4D4MMM%"'....
.',''0BGG4D4D4MMM%"8G$$	.y)Q.. ,+q00 , ,&GG&--EGG~""$"">Q&&(EE^q(((EE>EEdnUUC$S//)GNN5))
.GENN+rww/?/?/HHHx$.AAA.&--EGgmmG,,Q/	<%-XX{{;K{##r)rN)rrrrrrrrrrrr
r
seNN"%: 2""""P'P'P'P'dP$P$P$P$P$rr
cHtjt|ddS)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    r!N)	itertoolsislice	_ancestry)rs r_parentsrs IdOOQ555rc#K|tj}|tjr<|Vtj|\}}|tj:dSdS)a
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path.

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []

    Multiple separators are treated like a single.

    >>> list(_ancestry('//b//d///f//'))
    ['//b//d///f', '//b//d', '//b']
    N)rj	posixpathrrq)rtails  rrrsy*;;y}%%D
++im
$
$+


_T**
d++im
$
$+++++rcPtjt|j|S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )rfilterfalseset__contains__)minuend
subtrahends  r_differencers 
 Z!=wGGGrcdeZdZdZedZfdZdZdZfdZ	e
dZxZS)CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    ctjtt|}d|D}tt
||S)Nc34K|]}|tjzVdSr)rr)r(rs  rrlz-CompleteDirs._implied_dirs.<locals>.<genexpr>s)661y}$666666r)rchain
from_iterablerr_deduper)namesparentsas_dirss   r
_implied_dirszCompleteDirs._implied_dirssL///He0D0DEE66g666{7E22333rctt|}|t||zSr)rrr+r{r)rrrs  rr+zCompleteDirs.namelists?lD))2244tD..u556666rcDt|Sr)rr+rs r	_name_setzCompleteDirs._name_sets4==??###rcP|}|dz}||vo||v}|r|n|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        r)r)rrrr}	dir_matchs     rresolve_dirzCompleteDirs.resolve_dirs?
  *%:'U*:	#-ww-rc	t|S#t$r?|dr||vrt|cYSwxYw)z6
        Supplement getinfo for implied dirs.
        rr')rr;r9rrr)rrrs  rr;zCompleteDirs.getinfos{	*77??4(((	*	*	*==%%
T^^5E5E)E)ED))))))	*s $AA-,A-ct|tr|St|ts||Sd|jvrt}||_|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r)rrrrr)rrs  rmakezCompleteDirs.make	s\fl++	M&'**	3v;;fk!!C
r)
rrrrstaticmethodrr+rrr;rrrrs@rrrs
44\4
77777$$$...	*	*	*	*	*[rrc,eZdZdZfdZfdZxZS)
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    ctjt5|jcdddS#1swxYwYt	t
||_|jSr)
contextlibsuppressr_FastLookup__namesrrr+rs rr+zFastLookup.namelist	s

 
0
0	 	 <	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 Z..7799|/33ctjt5|jcdddS#1swxYwYt	t
||_|jSr)rrr_FastLookup__lookuprrrrs rrzFastLookup._name_set!	s

 
0
0	!	!=	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!j$//99;;
}r)rrrrr+rrrs@rrr	s[
rrc2tj|d||fS)Nr#)r
text_encoding)encodingargskwargss   r_extract_text_encodingr	(	s
Ha(($66rceZdZdZdZddZddddZd	Zed
Z	edZ
edZed
ZedZ
dZdZdZdZdZdZdZdZdZdZdZeZedZdS)ru,
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'mem/abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('mem/abcde.zip', 'a.txt')
    >>> b
    Path('mem/abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('mem/abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> import os
    >>> str(c).replace(os.sep, posixpath.sep)
    'mem/abcde.zip/b/c.txt'

    At the root, ``name``, ``filename``, and ``parent``
    resolve to the zipfile. Note these attributes are not
    valid and will raise a ``ValueError`` if the zipfile
    has no filename.

    >>> root.name
    'abcde.zip'
    >>> str(root.filename).replace(os.sep, posixpath.sep)
    'mem/abcde.zip'
    >>> str(root.parent)
    'mem'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})rcRt||_||_dS)aX
        Construct a Path from a ZipFile or filename.

        Note: When the source is an existing ZipFile object,
        its type (__class__) will be mutated to a
        specialized type. If the caller wishes to retain the
        original type, the caller should either create a
        separate ZipFile object or pass a filename.
        N)rrrat)rrrs   rrz
Path.__init__}	s"OOD))	rrNrzcl|rt||d}|s|dkrt||j|j||}d|vr|s|rtd|St|i|\}}}tj
||g|Ri|S)z
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        rrrzbz*encoding args invalid for binary operation)rIsADirectoryErrorr~FileNotFoundErrorrrMrrr	r
TextIOWrapper)rrrrrzip_modestreamrs        rrMz	Path.open	s;;==	*#D)))7{{}}	*S#D)))s;;$;;
Ov
O !MNNNM!7!H!H!H$B4BBB6BBBrcLtj|jp|jjSr)pathlib
PurePosixPathrrrNrs r_basez
Path._base	s$TW%B	0BCCCrc4|jSr)rrrs rrz	Path.name	zz||  rc4|jSr)rsuffixrs rrzPath.suffix	szz||""rc4|jSr)rsuffixesrs rrz
Path.suffixes	szz||$$rc4|jSr)rstemrs rrz	Path.stem	rrcntj|jj|jSr)rrrrNjoinpathrrs rrNz
Path.filename	s'|DI.//88AAArct|i|\}}}|jd|g|Ri|5}|cdddS#1swxYwYdS)Nr)r	rMrJ)rrrrstrms     r	read_textzPath.read_text	s!7!H!H!H$
TYsH
6t
6
6
6v
6
6	$99;;																		sAAAc|d5}|cdddS#1swxYwYdS)NrKrH)rr#s  r
read_byteszPath.read_bytes	s~
YYt__	99;;																		s7;;ctj|jd|jdkSNr)rr}rrj)rrs  r	_is_childzPath._is_child	s4 !4!4559L9LLLrc8||j|Sr)rr)rrs  r_nextz
Path._next	s~~di,,,rcF|jp|jdSr()rrrs rrzPath.is_dir	s!7{3dg..s333rcT|o|Sr)r~rrs ris_filezPath.is_file	s {{}}2T[[]]!22rcB|j|jvSr)rrrrs rr~zPath.exists	sw$)--////rc|stdt|j|j}t
|j|S)NzCan't listdir a file)rrrr+rr+filterr))rsubss  riterdirzPath.iterdir	sR{{}}	534444:ty113344dnd+++rcJtj|jj|jSr)rr8rrNrrs r__str__zPath.__str__	s~di0$':::rc8|j|S)Nr)_Path__reprrrs rrz
Path.__repr__	s{!!t!,,,rctj|jg|R}||j|Sr)rr8rr+rr)rothernexts   rr!z
Path.joinpath	s=~dg....zz$)//55666rc|js|jjStj|jd}|r|dz
}||Sr()rrNparentrr}rjr+)r	parent_ats  rr<zPath.parent	sYw	(=''%dgnnS&9&9::		Izz)$$$r)r)r)rrrrr7rrMrrrrrrrNr$r&r)r+rr.r~r3r5rr!__truediv__r<rrrrr-	sKKZNFCCCCCC(DDD!!X!##X#%%X%!!X!BBXB
MMM---444333000,,,;;;---777K
%%X%%%rrcddl}d}||}|d}|dddd	
|ddd
dd|ddddd|dddd
|ddd
||}|j}|jz|j}t|d|5}|}dddn#1swxYwY|r"td
|tddS|jH|j}t|d|5}|ddddS#1swxYwYdS|j
L|j
\}}	t|d|5}||	ddddS#1swxYwYdS|j|r/td t j!t!jd"|jd}
|j}fd#t|
d$5}|D]}t(j|}
|
s<t(jt(j|}
|
d%t(jt(jfvrd%}
|||
	ddddS#1swxYwYdSdS)&Nrz3A simple command-line interface for zipfile module.)descriptionT)requiredz-lz--list	<zipfile>zShow listing of a zipfile)metavarhelpz-ez	--extractr")rBz<output_dir>zExtract zipfile into target dir)nargsrCrDz-cz--create+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validz--metadata-encodingz
<encoding>z2Specify encoding of member names for -l, -e and -tr)rz.The following enclosed file is corrupted: {!r}zDone testingz/Non-conforming encodings not supported with -c.r1r!c	tj|r|||tdStj|r|r|||t
tj|D]M}|tj||tj||LdSdSr)	rrrrqrrrrr8)rrzippathnmaddToZips    rrJzmain.<locals>.addToZip
sw~~d##
Pw55555t$$
P,HHT7+++ D!1!122PPBHRW\\$33RW\\'25N5NPPPP	
P
PPPrrr)argparseArgumentParseradd_mutually_exclusive_groupadd_argument
parse_argsrtestrr7r
rr{r3rcrfcreaterstderrexitpoprrrr}r{r|)rrKr@parsergrouprrrbadfiler{zip_namefilesrrHrJs              @rmainrZ	sOOOGK

$
$
$
=
=F///>>E	tX{7999	t[<=???
tZs39;;;
tX{8:::
-|QSSST""D%Hyi
S#
:
:
:	#bjjllG	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	TBII'RRSSS
n	
	i
S#
:
:
:	bKKMMM																		
	!lV
S#
:
:
:	"bMM&!!!	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"
	 	Cz
#
#
#
#HQKKK;??1%%	P	P	P	P	PXs
#
#	,r
,
,'**400F g..rwt/D/DEEGr29bi888 GT7++++

,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,)
!	 sI.DDD/FFFG$$G(+G( B
K;;K?K?__main__r)rbinasciiimportlib.utilrrrrrrerrrSrrrrrr>rImportErrorr@r__all__	ExceptionrrrrrrrDrrrr	rrrrrrzryrrxrZr[r\r]r^r_r`r~rrarrrr_CD_CREATE_VERSION_CD_CREATE_SYSTEM_CD_EXTRACT_VERSION_CD_EXTRACT_SYSTEMr_CD_COMPRESS_TYPE_CD_TIME_CD_DATE_CD_CRC_CD_COMPRESSED_SIZE_CD_UNCOMPRESSED_SIZErrr_CD_DISK_NUMBER_START_CD_INTERNAL_FILE_ATTRIBUTES_CD_EXTERNAL_FILE_ATTRIBUTESrrUr]rrRrSrrrrNrO_FH_EXTRACT_VERSION_FH_EXTRACT_SYSTEMrT_FH_COMPRESSION_METHOD_FH_LAST_MOD_TIME_FH_LAST_MOD_DATE_FH_CRC_FH_COMPRESSED_SIZE_FH_UNCOMPRESSED_SIZErPrQrTrUrQrYrXrV_CD64_SIGNATURE_CD64_DIRECTORY_RECSIZE_CD64_CREATE_VERSION_CD64_EXTRACT_VERSION_CD64_DISK_NUMBER_CD64_DISK_NUMBER_START_CD64_NUMBER_ENTRIES_THIS_DISK_CD64_NUMBER_ENTRIES_TOTAL_CD64_DIRECTORY_SIZE_CD64_OFFSET_START_CENTDIRrStructr4rBrHr
rtrDobjectrr
rrrr&rrCrKrPrRrlrrwrrr
rrdictfromkeysrrrrr	rrZrrrr<module>rsD
												











KKKJEEDNEEEJJJJ
CCCKKKKDDD
								9 
#
	


  !122
	
$  !122


!! 
#  
"  !122
 !
%))&/*CDD"""6?#566!"
#fmE*** 999x999x`````v```N
	 ###L"""""""".8wxxx	
xx
yzy{	 	!"#(NNN&



 PPP$%!%!%!%!%!%!%!%!P(FFFFF"FFFR
P+P+P+P+P+B%P+P+P+hPPPPPPPPfk$k$k$k$k$k$k$k$\666&+++6-/HHH999997999x&7777
y%y%y%y%y%y%y%y%xC,C,C,C,LzDFFFFFs6AAA!A&&A0/A04A99BB