Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \ú)ã2@sÂdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z y ddl Z Wne k r|ddlZ YnXyddlZejZWne k r®dZe jZYnXy ddlZWne k rÔdZYnXy ddlZWne k rúdZYnXddddddd d d d d dg ZGdd„deƒZGdd„deƒZeZZdfZdhZdjZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&e j'e%ƒZ(dZ)dZ*dZ+dZ,dZ-d Z.d!Z/d"Z0dZ1d#Z2d$Z3d%Z4e j'e3ƒZ5dZ6dZ7dZ8dZ9dZ:d Z;d!Zd#Z?d&Z@d'ZAdZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJe j'eIƒZKdZLdZMdZNdZOdZPd ZQd!ZRd"ZSdZTd#ZUd&ZVd'ZWd.ZXd/ZYe j'eXƒZZd0Z[d1Z\e j'e[ƒZ]dZ^dZ_dZ`dZadZbd Zcd!Zdd"ZedZfd#Zgd2Zhe jid3ƒZjd4d5„Zkd6d7„Zld8d „Zmd9d:„Znd;d<„ZoGd=d „d epƒZqGd>d?„d?ƒZrGd@dA„dAƒZsGdBdC„dCƒZtdDdEdFdFdFdFdGdHdIdJdGdKdLdMdNdOdPdQœZudRdS„ZvdTdU„ZwdVdW„ZxGdXdY„dYƒZyGdZd[„d[ƒZzGd\d]„d]ej{ƒZ|Gd^d_„d_ej{ƒZ}Gd`d „d ƒZ~Gdad „d e~ƒZdkdbdc„Z€e�ddk�r¾e€ƒdS)lzP Read and write ZIP files. XXX references to utf-8 need further investigation. éNÚ BadZipFileÚ BadZipfileÚerrorÚ ZIP_STOREDÚ ZIP_DEFLATEDÚ ZIP_BZIP2ÚZIP_LZMAÚ is_zipfileÚZipInfoÚZipFileÚ PyZipFileÚ LargeZipFilec@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©rrú/usr/lib64/python3.6/zipfile.pyr+sc@seZdZdZdS)r zu Raised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled. N)rrrÚ__doc__rrrrr /sééééé ééé-é.é?s<4s4H2LHsPKééééééé z<4s4B4HL2L5H2LsPKé é é éééz <4s2B4HL2L2HsPKz<4sLQLsPKz <4sQ2H2L4QsPKiPKz        r7c@sVeZdZdZd(Zd*dd„Zdd„Zd+dd„Zd d!„Zd"d#„Z e d,d$d%„ƒZ d&d'„Z dS)-r z>Class with attributes describing each file in the ZIP archive.Ú orig_filenamer?Ú date_timeÚ compress_typer_r1Ú create_systemrTÚextract_versionÚreservedÚ flag_bitsÚvolumeÚ internal_attrÚ external_attrÚ header_offsetÚCRCÚ compress_sizeÚ file_sizeÚ _raw_timeÚNoNameé¼rrcCsÂ||_|jtdƒƒ}|dkr(|d|…}tjdkrJtj|krJ|jtjdƒ}||_||_|ddkrjtdƒ‚t |_ d|_ d|_ t jdkrŽd|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nrú/i¼z+ZIP does not support timestamps before 1980r+Zwin32r)r`ÚfindÚchrÚosÚsepÚreplacer?raÚ ValueErrorrrbr_r1ÚsysÚplatformrcÚDEFAULT_VERSIONrTrdrerfrgrhri)Úselfr?raZ null_byterrrÚ__init__Ws.   zZipInfo.__init__cCsàd|jj|jfg}|jtkr8|jdtj|j|jƒƒ|jd?}|jd@}|rd|jdt j |ƒƒ|rv|jd|ƒ|j ƒ}| sŠ|j rš|jd|j ƒ| s¦|j rÌ|jtks¼|j |j krÌ|jd|j ƒ|jd ƒd j|ƒS) Nz<%s filename=%rz compress_type=%sriÿÿz filemode=%rz external_attr=%#xz file_size=%rz compress_size=%rú>Ú)Ú __class__rr?rbrr/Úcompressor_namesÚgetriÚstatÚfilemodeÚis_dirrmrlr0)r{r@ÚhiÚloÚisdirrrrÚ__repr__�s(         zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}|jd @rfd}}}n|j}|j}|j}|j}d} |d krš|tkp˜|tk}|rÂd } |tj| dtj | ƒd ||ƒ}|tksÒ|tkrê|sÞt d ƒ‚d}d}t } |j t k�rtt| ƒ} n|j tk�rtt| ƒ} t| |jƒ|_t| |jƒ|_|jƒ\} } tjtt|j|j| |j |||||t| ƒt|ƒƒ } | | |S)z-Return the per-file header as a bytes object.ri¼r$rr!rrr&r rNzy|jjdƒ|jfStk r8|jjdƒ|jdBfSXdS)NÚasciizutf-8i)r?ÚencoderfÚUnicodeEncodeError)r{rrrr�ÅszZipInfo._encodeFilenameFlagscCs(|j}tj}�xt|ƒdk�r"|d|dd…ƒ\}}|dk�r|dkrZ|d|dd…ƒ}nV|dkrv|d|dd …ƒ}n:|d kr’|d |dd …ƒ}n|d kr f}ntd||fƒ‚d }|jdkrÐ|||_|d7}|jdkrì|||_|d7}|jdk�r|j}|||_|d7}||dd…}qWdS)Nr z|_|rÎd|_|jdO_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"Nrrqiÿÿr)Ú isinstancertÚPathLikeÚfspathr‚ÚS_ISDIRÚst_modeÚtimeÚ localtimeÚst_mtimeÚpathÚnormpathÚ splitdriveruÚaltseprirmÚst_size)Úclsr?ÚarcnameÚstr‡ÚmtimeraÚzinforrrÚ from_fileïs(       zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.rrqéÿÿÿÿ)r?)r{rrrr„szZipInfo.is_dir)r`r?rarbr_r1rcrTrdrerfrgrhrirjrkrlrmrn©rprrrrr)rorº)N)N) rrrrÚ __slots__r|rˆr™r�r¥Ú classmethodr¸r„rrrrr >s8 * .$ !c@s<eZdZdZdd„ZdZdd„Zdd„Zd d „Zd d „Z dS) Ú _ZipDecrypteraClass to handle decryption of files stored within a ZIP archive. ZIP supports a password-based form of encryption. Even though known plaintext attacks have been found against it, it is still useful to be able to get data out of such a file. Usage: zd = _ZipDecrypter(mypwd) plain_char = zd(cypher_char) plain_text = map(zd, cypher_text) cCshd}dgd}xTtdƒD]H}|}x6tdƒD]*}|d@rH|d?d@|A}q*|d?d@}q*W|||<qW|S)zâGenerate a CRC-32 table. ZIP encryption uses the CRC32 one-byte primitive for scrambling some internal keys. We noticed that a direct implementation is faster than relying on binascii.crc32(). l q[rérriÿÿÿ)Úrange)ZpolyÚtabler4Úcrcr5rrrÚ_GenerateCRCTable#s  z_ZipDecrypter._GenerateCRCTableNcCs|d?d@|j||Ad@AS)z(Compute the CRC32 primitive on one byte.riÿÿÿéÿ)Úcrctable)r{ZchrÁrrrÚ_crc327sz_ZipDecrypter._crc32cCsBtjdkrtjƒt_d|_d|_d|_x|D]}|j|ƒq,WdS)NixV4i‰gE#i�xV4)r½rÄrÂÚkey0Úkey1Úkey2Ú _UpdateKeys)r{ÚpwdÚprrrr|;s   z_ZipDecrypter.__init__cCsX|j||jƒ|_|j|jd@d@|_|jddd@|_|j|jd?d@|jƒ|_dS)NrÃlÿÿi„rr�)rÅrÆrÇrÈ)r{ÚcrrrrÉDsz_ZipDecrypter._UpdateKeyscCs>t|tƒst‚|jdB}|||dAd?d@A}|j|ƒ|S)zDecrypt a single character.rrrrÃ)r¦ÚintÚAssertionErrorrÈrÉ)r{rÌÚkrrrÚ__call__Js   z_ZipDecrypter.__call__) rrrrrÂrÄrÅr|rÉrÐrrrrr½s  r½c@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) ÚLZMACompressorcCs d|_dS)N)Ú_comp)r{rrrr|UszLZMACompressor.__init__cCsFtjdtjiƒ}tjtjtjtj|ƒgd�|_tjdddt |ƒƒ|S)NÚid)Úfiltersz|jjd|jƒd}|dkr>|j|j|…}||_|Stjj||ƒS)zrRead and return a line from the stream. If limit is specified, at most limit bytes will be read. ró r)rrrrÚioÚBufferedIOBaseÚreadline)r{Úlimitr4Úlinerrrr1szZipExtFile.readlinecCsr|t|jƒ|jkr\|j|ƒ}t|ƒ|jkrJ||j|jd…|_d|_n|jt|ƒ8_|j|j|jd…S)z6Returns buffered bytes without advancing the position.Nri)r.rrr;)r{røÚchunkrrrÚpeekAs zZipExtFile.peekcCsdS)NTr)r{rrrÚreadableNszZipExtFile.readablecCs |dks|dkrL|j|jd…}d|_d|_x|jsF||j|jƒ7}q.W|S||j}|t|jƒkr~|j|j|…}||_|S|t|jƒ}|j|jd…}d|_d|_x^|dko¸|j �r|j|ƒ}|t|ƒkrð||_||_||d|…7}P||7}|t|ƒ8}qªW|S)z�Read and return up to n bytes. If the argument is omitted, None, or negative, data is read and returned until EOF is reached.. Nrr+)rrrÚ_read1ÚMAX_Nr.)r{røÚbufÚendrSrrrr;Qs4   zZipExtFile.readcCs@|jdkrdSt||jƒ|_|jr<|j|jkr      zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|ƒkrR||j|t|ƒƒ7}n |j|ƒ}|jtkrj|jdk|_nx|jtkrÂt ||j ƒ}|jj ||ƒ}|jj p¨|jdko¨|jj |_|jrâ||jj ƒ7}n |jj |ƒ}|jj pÞ|jdk|_|d|j…}|jt|ƒ8_|jdk�rd|_|j|ƒ|S)Nrr+T)rrrrZunconsumed_tailr.Ú_read2rrr\Ú MIN_READ_SIZEràrßrÛrr)r{rørSrrrr¡s2           zZipExtFile._read1cCsj|jdkrdSt||jƒ}t||jƒ}|jj|ƒ}|jt|ƒ8_|sLt‚|jdk rft t |j|ƒƒ}|S)Nrr+) rr\r Úminrýr;r.ÚEOFErrorrþÚbytesÚmap)r{rørSrrrrÅs     zZipExtFile._read2c s&z|jr|jjƒWdtƒjƒXdS)N)rÿrýröÚsuper)r{)rrrröÕszZipExtFile.closeéi@)NFr¹)r¹)rr¹)r¹)rrrrrr r|rˆrrrr;rrrrröÚ __classcell__rr)rrrüøs    ! %$rücs@eZdZdd„Zedd„ƒZdd„Zdd„Z‡fd d „Z‡Z S) Ú _ZipWriteFilecCs4||_||_||_t|jƒ|_d|_d|_d|_dS)Nr) Ú_zinfoÚ_zip64Ú_zipfilerìrbÚ _compressorÚ _file_sizeÚ_compress_sizeÚ_crc)r{Úzfr·r’rrrr|Þs z_ZipWriteFile.__init__cCs|jjS)N)r+r9)r{rrrrýçsz_ZipWriteFile._fileobjcCsdS)NTr)r{rrrÚwritableësz_ZipWriteFile.writablecCsf|jrtdƒ‚t|ƒ}|j|7_t||jƒ|_|jrV|jj|ƒ}|jt|ƒ7_|j j |ƒ|S)NzI/O operation on closed file.) rrwr.r-r r/r,rÚr.rýrû)r{rSÚnbytesrrrrûîs  z_ZipWriteFile.writecsX|jr dStƒjƒ|jrN|jjƒ}|jt|ƒ7_|jj|ƒ|j|j _ n |j |j _ |j |j _ |j |j _|j jd@r¼|jr‚dnd}|jjtj|t|j j |j j |j jƒƒ|jjƒ|j_nn|jsæ|j tkrÔtdƒ‚|jtkrætdƒ‚|jjƒ|j_|jj|j jƒ|jj|j j|jƒƒ|jj|jjƒd|j_|jjj|j ƒ|j |jj|j j <dS)Nrzd d!œd"d#„Zd?d$d%„Zd@d&d'„ZdAd(d)„Zed*d+„ƒZd,d-„Zd.d/„ZdBd0d1„ZdCd2d3„Zd4d5„Z d6d7„Z!d8d9„Z"d:d;„Z#dS)Dr aÉ Class with methods to open, read, write, close, list zip files. z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True) 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. NÚrTcCsF|dkrtdƒ‚t|ƒ||_d|_d|_i|_g|_||_||_d|_ d |_ t |t j ƒrdt j|ƒ}t |tƒrÜd|_||_d d d d d dddœ}||}x^ytj||ƒ|_Wn(tk rÒ||krÌ||}w˜‚YnXPq˜Wnd|_||_t|ddƒ|_d|_tjƒ|_d|_d|_�y|dk�r*|jƒnð|dk�r´d|_y|jjƒ|_Wn2t tfk �r|t!|jƒ|_d|_d|_Yn6Xy|jj"|jƒWn t tfk �r°d|_YnXnf|dk�ry|jƒ|jj"|jƒWn6t#k �r|jj"ddƒd|_|jjƒ|_YnXntdƒ‚Wn$|j}d|_|j$|ƒ‚YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x', or append 'a'.r8ÚwÚxÚaz+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr+r<zw+bzx+bzr+bÚwbZxb)r8r9r:r;zr+bzw+bzx+brr Trz"Mode must be 'r', 'w', 'x', or 'a')r8r9r:r;)r9r:)%rwrëÚ _allowZip64Ú _didModifyÚdebugr6r5rêrrÊÚ_commentr¦rtr§r¨ÚstrÚ _filePassedr?rr>r9r8ÚgetattrÚ _fileRefCntÚ threadingÚRLockròÚ _seekableróÚ_RealGetContentsrWr4ÚAttributeErrorrúrArÚ_fpclose)r{rôrrêÚ allowZip64ZmodeDictrƒr9rrrr|;s‚             zZipFile.__init__cCs|S)Nr)r{rrrÚ __enter__’szZipFile.__enter__cCs |jƒdS)N)rö)r{ÚtypeÚvalueÚ tracebackrrrÚ__exit__•szZipFile.__exit__cCs‚d|jj|jjfg}|jdk rd|jr8|jd|jƒn|jdk rR|jd|jƒ|jd|jƒn |jdƒ|jdƒdj|ƒS)Nz<%s.%sz file=%rz filename=%rz mode=%rz [closed]r}r~) rrrr9rBr/r?rr0)r{r@rrrrˆ˜s    zZipFile.__repr__cCs¾|j}y t|ƒ}Wntk r.tdƒ‚YnX|sösz$ZipFile.namelist..)r5)r{rrrÚnamelistôszZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the archive.)r5)r{rrrÚinfolistøszZipFile.infolistcCsPtdd |d�x:|jD]0}d|jdd…}td |j||jf|d�qWdS) z+Print a table of contents for the zip file.z%-46s %19s %12sú File Nameú Modified ÚSize)rôz%d-%02d-%02d %02d:%02d:%02dNr"z %-46s %s %12d)rjrkrl)rSr5rar?rm)r{rôr·ZdaterrrÚprintdirýs  zZipFile.printdircCs^d}xT|jD]J}y.|j|jdƒ�}x|j|ƒr0q$WWdQRXWq tk rT|jSXq WdS)z%Read all the files and check the CRC.rrr8Ni)r5r>r?r;r)r{Z chunk_sizer·ÚfrrrÚtestzips  zZipFile.testzipcCs$|jj|ƒ}|dkr td|ƒ‚|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r6r�ÚKeyError)r{r ÚinforrrÚgetinfos   zZipFile.getinfocCs8|r"t|tƒ r"tdt|ƒjƒ‚|r.||_nd|_dS)z)Set default password for encrypted files.zpwd: expected bytes, got %sN)r¦r#Ú TypeErrorrMrrÊ)r{rÊrrrÚ setpasswords zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)r@)r{rrrr_%szZipFile.commentcCs^t|tƒstdt|ƒjƒ‚t|ƒtkrNddl}|jdtdd�|dt…}||_ d|_ dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr)Ú stacklevelT) r¦r#rsrMrr.ÚZIP_MAX_COMMENTÚwarningsÚwarnr@r>)r{r_rwrrrr_*s    c Cs"|j|d|ƒ� }|jƒSQRXdS)zReturn file bytes for name.r8N)r>r;)r{r rÊr9rrrr;7sz ZipFile.readF)Ú force_zip64c sv|d krtdƒ‚|r2t|tƒ r2tdt|ƒjƒ‚|rF|dkrFtdƒ‚ˆjsTtdƒ‚t|tƒrd|}n$|dkr~t|ƒ}ˆj|_ n ˆj |ƒ}|dkržˆj ||d�Sˆj r¬tdƒ‚ˆj d 7_ tˆj|jˆjˆj‡fd d „ƒ}�y~|jtƒ}t|ƒtk�rþtd ƒ‚tjt|ƒ}|ttk�r td ƒ‚|j|tƒ}|t�rF|j|tƒ|jd@�rZtdƒ‚|jd@�rntdƒ‚|jd@�r†|jdƒ} n |jdƒ} | |j k�r®td|j |fƒ‚|jd @} d} | �rL|�sΈj!}|�sàt"d|ƒ‚t#|ƒ} |jdƒ} t$t%| | dd…ƒƒ} |jd@�r$|j&d?d@}n|j'd?d@}| d|k�rLt"d|ƒ‚t(|||| dƒS|j)ƒ‚YnXdS)!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. r8r9zopen() requires mode "r" or "w"zpwd: expected bytes, got %sz'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closed)ryzyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.rcsˆjS)N)rór)r{rrÚlszZipFile.open..zTruncated file headerz Bad magic number for file headeré z$compressed patched data (flag bit 5)é@zstrong encryption (flag bit 6)izutf-8rQz/File name in directory %r and header %r differ.Nz6File %r is encrypted, password required for extractionrrrrÃr�r&zBad password for file %rT>r9r8)*rwr¦r#rsrMrr9r rêrbrrÚ_open_to_writerórDrîrjrJròr;ÚsizeFileHeaderr.rrCr-r�Ú _FH_SIGNATUREr‘Ú_FH_FILENAME_LENGTHÚ_FH_EXTRA_FIELD_LENGTHrfrér\r`rÊrçr½r[r$rnrkrürö)r{r rrÊryr·Zzef_fileZfheaderÚfnameZ fname_strZ is_encryptedZzdr˜ÚhZ check_byter)r{rr><s~                  z ZipFile.opencCsè|r|j rtdƒ‚|jr"tdƒ‚t|dƒs2d|_d|_d|_d|_|jt kr\|jdO_|j sp|jdO_|j s|d |_ |jo’|p’|jd t k}|j r¨|j j|jƒ|j jƒ|_|j|ƒd |_|j j|j|ƒƒd |_t|||ƒ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.rmrrri€rgÍÌÌÌÌÌð?Ti€)r=rwrór=rmrlrkrfrbrrGrir‰r9rAr4rWrjÚ _writecheckr>rûr™r()r{r·ryr’rrrr}­s4     zZipFile._open_to_writecCs*|dkrtjƒ}n tj|ƒ}|j|||ƒ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'. N)rtÚgetcwdr¨Ú_extract_member)r{Úmemberr®rÊrrrÚextractØs  zZipFile.extractcCsL|dkr|jƒ}|dkr"tjƒ}n tj|ƒ}x|D]}|j|||ƒq2WdS)zõExtract 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)rhrtr…r¨r†)r{r®ÚmembersrÊr rrrÚ extractallås   zZipFile.extractallcCs^|j}|s(d}tj|dt|ƒƒ}||_|j|ƒ}dd„|j|ƒDƒ}|jdd„|Dƒƒ}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*Ú_css|]}|jdƒVqdS)Ú.N)Úrstrip)rfr:rrrú sz1ZipFile._sanitize_windows_name..css|]}|r|VqdS)Nr)rfr:rrrrŽs)Ú!_windows_illegal_name_trans_tablerAÚ maketransr.Ú translateÚsplitr0)r³r´ÚpathseprÀZillegalrrrÚ_sanitize_windows_nameös zZipFile._sanitize_windows_namecsNt|tƒs|j|ƒ}|jjdtjjƒ}tjjrB|jtjjtjjƒ}tjj |ƒd}dtjj tjj f‰tjjj ‡fdd„|j tjjƒDƒƒ}tjjdkr¦|j|tjjƒ}tjj ||ƒ}tjj|ƒ}tjj|ƒ}|rètjj|ƒ rètj|ƒ|jƒ�rtjj|ƒ�s tj|ƒ|S|j||d��(}t|dƒ�}tj||ƒWd QRXWd QRX|S) zbExtract the ZipInfo object 'member' to a physical file on the path targetpath. rqrr~c3s|]}|ˆkr|VqdS)Nr)rfr:)Úinvalid_path_partsrrrŽsz*ZipFile._extract_member..ú\)rÊr<N)r¦r rrr?rvrtr®rur±r°ÚcurdirÚpardirr0r’r”r¯ÚdirnameÚexistsÚmakedirsr„r‡Úmkdirr>ÚshutilÚ copyfileobj)r{r‡Z targetpathrÊr´Z upperdirsÚsourceÚtargetr)r•rr†s.  &        zZipFile._extract_membercCs¢|j|jkr(ddl}|jd|jdd�|jdkr:td ƒ‚|jsHtd ƒ‚t|jƒ|j sžd}t |j ƒt krpd }n|j tkr€d }n|jtkrŽd }|ržt|dƒ‚dS)z6Check for errors before writing a file to the archive.rNzDuplicate name: %rr)rur9r:r;z&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closedz Files countZFilesizez Zipfile sizez would require ZIP64 extensions)r9r:r;)r?r6rwrxrrwr9rërbr=r.r5ÚZIP_FILECOUNT_LIMITrmr‰rjr )r{r·rwÚrequires_zip64rrrr„/s(     zZipFile._writecheckcCs0|jstdƒ‚|jrtdƒ‚tj||ƒ}|jƒr>d|_d|_n|dk rN||_n|j |_|jƒrð|j �„|j rz|jj |j ƒ|jjƒ|_|jtkrž|jdO_|j|ƒd|_|jj|ƒ||j|j<|jj|jdƒƒ|jjƒ|_ WdQRXnCan't write to ZIP archive while an open writing handle existsrNrTFr<r9iri )r9rwrór r¸r„rlrkrbrêròrGrAr4rWrjrrfr„r>r5r/r6r?rûr™r>r�rž)r{r?r´rbr·ÚsrcÚdestrrrrûFs8      z ZipFile.writecCsât|tƒr|jdƒ}t|tƒspt|tjtjƒƒdd…d�}|j|_|jddkrhd|_ |j dO_ qtd|_ n|}|j s‚t d ƒ‚|j r�t d ƒ‚|dk rž||_t |ƒ|_|j�*|j|d d ��}|j|ƒWdQRXWdQRXdS)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.zutf-8Nr")r?rarrqiýAri€z7Attempt to write to ZIP archive that was already closedz?Can't write to ZIP archive while an open writing handle exists.r9)rr¹iýAi€)r¦rAr›r r«r¬rêrbr?rir9rwrór.rmròr>rû)r{Zzinfo_or_arcnamerSrbr·r¤rrrÚwritestrps.    zZipFile.writestrcCs |jƒdS)z2Call the "close()" method in case the user forgot.N)rö)r{rrrÚ__del__”szZipFile.__del__cCs||jdkrdS|jrtdƒ‚zB|jdkr\|jr\|j�"|jrJ|jj|jƒ|j ƒWdQRXWd|j}d|_|j |ƒXdS)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.r9r:r;)r9r:r;) r9rórwrr>ròrGrAr4Ú_write_end_recordrJ)r{r9rrrrö˜s z ZipFile.closecCsr�xP|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}g}|jtksv|jtkr˜|j|jƒ|j|jƒd }d }n |j}|j}|jtkrÀ|j|jƒd }n|j}|j} d} |�rt| dƒ} t j d d t |ƒdd t |ƒf|žŽ| } t } |j tk�r(tt| ƒ} n|j tk�r>tt| ƒ} t| |jƒ} t| |jƒ} yZ|jƒ\} }t j tt| |j| |j||j |||j||t | ƒt | ƒt |jƒd|j|j|ƒ}Wnltk �rttt| |j| |j|j |j |||j||t |j!ƒt | ƒt |jƒd|j|j|ft"j#d�‚YnX|j$j%|ƒ|j$j%| ƒ|j$j%| ƒ|j$j%|jƒq W|j$j&ƒ}t |jƒ}||j'}|j'}d}|t(k�rŒd}n|tk�rœd}n|tk�rªd}|�r*|j)�sÄt*|dƒ‚t j t+t,ddddd||||ƒ }|j$j%|ƒt j t-t.d|dƒ}|j$j%|ƒt/|dƒ}t/|d ƒ}t/|d ƒ}t j t0t1dd||||t |j2ƒƒ }|j$j%|ƒ|j$j%|j2ƒ|j$j3ƒdS)Nri¼r$rr!rrr&r lÿÿzr}rˆrŠr¼r”r†r„rûr¥r¦rör§rJrrrrr 's<WN     q +  * * $fc@s4eZdZdZdedd fdd„Zdd d „Zd d „ZdS)r zDClass to create ZIP archives with Python library files and packages.r8TrcCstj|||||d�||_dS)N)rrêrK)r r|Ú _optimize)r{rôrrêrKÚoptimizerrrr|s zPyZipFile.__init__r~NcCsÂtj|ƒ}|rF||ƒ rF|jrBtjj|ƒr.dnd}td||fƒdStjj|ƒ\}}tjj|ƒ�rntjj|dƒ}tjj|ƒ�r¼|r’d||f}n|}|jrªtd|d|ƒ|j |d d…|ƒ\}} |jrÒtd | ƒ|j || ƒtj |ƒ} | j dƒxÆ| D]¾} tjj|| ƒ} tjj | ƒ\} }tjj| ƒ�rRtjjtjj| dƒƒ�r¶|j| ||d �qø|d krø|�r€|| ƒ �r€|jrøtd| ƒqø|j | d d…|ƒ\}} |j�rªtd | ƒ|j || ƒqøWn°|j�rÎtd|ƒxîtj |ƒD]Ž} tjj|| ƒ} tjj | ƒ\} }|d k�rÚ|�r0|| ƒ �r0|j�rÚtd| ƒ�qÚ|j | d d…|ƒ\}} |j�rZtd | ƒ|j || ƒ�qÚWnP|dd…d k�rˆtdƒ‚|j |d d…|ƒ\}} |j�r²td| ƒ|j || ƒdS)a¦Add 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. r®rôz%s %r skipped by filterfuncNz __init__.pyz%s/%szAdding package inÚasrrZAdding)Ú filterfuncz.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding fileéýÿÿÿr±r±r±r±)rtr¨r?r®r‡rSr’r0ÚisfileÚ _get_codenamerûÚlistdirÚremoveÚsplitextÚwritepyrç)r{ÚpathnameÚbasenamer°ZlabelÚdirr Zinitnamer‚r´Zdirlistr?r®ÚrootZextrrrr·$sx                zPyZipFile.writepyc sd‡fdd„ }|d}|d}tjj|dd�}tjj|dd�}tjj|dd�}ˆjdk�r\tjj|ƒrˆtj|ƒjtj|ƒjkrˆ|} } nÒtjj|ƒr¶tj|ƒjtj|ƒjkr¶|} |} n¤tjj|ƒrätj|ƒjtj|ƒjkrä|} |} nvtjj|ƒ�rtj|ƒjtj|ƒjk�r|} |} nD||ƒ�rRt j j d k�r4|} nt j j dk�rH|} n|} |} n|} } n’ˆjd k�rr|} |} n<|} ˆjdk�rˆ|} n&ˆjdk�rš|} nd j ˆjƒ} t | ƒ‚tjj| ƒ�oÒtj| ƒjtj|ƒjk�sî||ˆjd ��sî|} } tjj| ƒd} |�rd || f} | | 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). rcs^ddl}ˆjrtd|ƒy|j|d|d�Wn,|jk rX}zt|jƒdSd}~XnXdS)NrZ CompilingT)Údoraiser®F)Ú py_compiler?rSÚcompileÚPyCompileErrorÚmsg)rôr®r½Úerr)r{rrÚ_compile}s  z)PyZipFile._get_codename.._compilez.pyz.pycr~)Ú optimizationrrz"invalid value for 'optimize': {!r})r®z%s/%sr¹)r¹r¹)Ú importlibÚutilÚcache_from_sourcer­rtr®r²r‚r­rxrcr®Úformatrwr’) r{r¸r¹rÂZfile_pyZfile_pycZ pycache_opt0Z pycache_opt1Z pycache_opt2r´r‚rÀZ archivenamer)r{rr³vs`             zPyZipFile._get_codenamer¹)r~N)rrrrrr|r·r³rrrrr s  Rc sddl}|jdƒ}|dkr(tjdd…}| s:|ddkrLt|ƒtjdƒ|ddkrœt|ƒdkrvt|ƒtjdƒt|dd ƒ�}|jƒWdQRX�n||ddk�r t|ƒdkrÈt|ƒtjdƒt|dd ƒ�}|j ƒ}WdQRX|�rþtd j |ƒƒtd ƒ�n|ddk�rbt|ƒd k�r8t|ƒtjdƒt|dd ƒ�}|j |dƒWdQRXn¶|ddk�rt|ƒd k�r�t|ƒtjdƒ‡fd d„‰t|ddƒ�h}x`|dd…D]P}t j j|ƒ}|�sät j jt j j|ƒƒ}|dt jt jfk�rüd}ˆ|||ƒ�qºWWdQRXdS)NraE Usage: zipfile.py -l zipfile.zip # Show listing of a zipfile zipfile.py -t zipfile.zip # Test if a zipfile is valid zipfile.py -e zipfile.zip target # Extract zipfile into target dir zipfile.py -c zipfile.zip src ... # Create zipfile from sources rú-lú-cú-eú-trr8z.The following enclosed file is corrupted: {!r}z Done testingrcsptjj|ƒr|j||tƒnPtjj|ƒrl|r8|j||ƒx2tj|ƒD]$}ˆ|tjj||ƒtjj||ƒƒqDWdS)N)rtr®r²rûrr‡r´r0)r0r®ÚzippathZnm)ÚaddToZiprrrÍ÷s   zmain..addToZipr9r~)rÈrÉrÊrË)ÚtextwrapÚdedentrxÚargvrSÚexitr.r rmrorÇrŠrtr®r¹r™r—r˜)ÚargsrÎZUSAGEr0Zbadfiler®rÌr)rÍrÚmainÉsT           rÓÚ__main__liÿÿÿiiÿÿiiÿÿ)N)‚rrrtÚreÚimportlib.utilrÄrxr«r‚r�rCZbinasciirEÚ ImportErrorZdummy_threadingrær rèrÕÚ__all__Ú Exceptionrr rrr‰r¡rvrrrrrzrŒr�rŽr`rZrYr‹rXrIrJrKrLrMrNrOr^rTrUrXrZrWrYZ_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ _CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr[r]r^Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr_r�r‘r~rZ_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMZ_FH_GENERAL_PURPOSE_FLAG_BITSZ_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr€r�rDrErBrGrHrFZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRr3ÚStructr,r6r:r rUr7Úobjectr r½rÑrÜr€rërìrírîrúrrür(r r rÓrrrrrÚs@              +=Y= fJy/ B