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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /usr/lib64/python3.6/__pycache__
Viewing File: /usr/lib64/python3.6/__pycache__/zipfile.cpython-36.opt-1.pyc
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!Z<d"Z=dZ>d#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<HHc Cs�tj}d}g}d}}xf|dt|�kr|||||d��\}}|d|} ||krv||krn|j|||��| }d}| }qW|s�|Sdj|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join) �extraZxidsr-Zmodified�buffer�start�iZxidZxlen�jrrr� _strip_extra�s  r6c Cs*yt|�rdSWntk r$YnXdS)NTF)� _EndRecData�OSError)�fprrr�_check_zipfile�s r:cCsVd}y8t|d�rt|d�}nt|d��}t|�}WdQRXWntk rPYnX|S)z�Quickly 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. F�read)r9�rbN)�hasattrr:�openr8)�filename�resultr9rrrr �s   cCsy|j|td�Wntk r(|SX|jt�}t|�tkrD|Stjt|�\}}}}|tkrd|S|dkst|dkr|t d��|j|tt d�|jt �}t|�t kr�|Stjt |�\ }}} } } } } }}}|t kr�|S||t <| |t<| |t<| |t<||t<||t<||t<|S)zM Read the ZIP64 end-of-archive records and use that to update endrec rrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr8r;r.�structr-�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL� _ECD_SIZE� _ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZ read_versionZdisk_numZdisk_dirZdircountZ dircount2ZdirsizeZ diroffsetrrr� _EndRecData64�s6     rUc Csf|jdd�|j�}y|jt d�Wntk r:dSX|j�}t|�tkr�|dd�tkr�|d d�dkr�tjt |�}t |�}|j d�|j |t�t |t |�St |d td�}|j|d�|j�}|jt�}|dk�rb|||t�}t|�tk�rdSt tjt |��}|t}||t|t|�}|j |�|j ||�t |||||�SdS) z�Return 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.rrNr sr+rr���i)rA�tell�sizeEndCentDirr8r;r.�stringEndArchiverCr-�structEndArchive�listr/rU�max�rfind�_ECD_COMMENT_SIZE) rPZfilesizerSrRZmaxCommentStartr3ZrecDataZ commentSize�commentrrrr7s>        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 rNz<HHQQz'Filesize would require ZIP64 extensionsl��)rarfrkrlrmr1� ZIP64_LIMITrC�pack�calcsizer � ZIP64_VERSIONrbrr\� BZIP2_VERSIONr� LZMA_VERSIONrdrT�_encodeFilenameFlags�structFileHeader�stringFileHeaderrer.)r{�zip64�dt�dosdate�dostimerkrlrmr1� min_version�fmtr?rf�headerrrr� FileHeader�sF$$        zZipInfo.FileHeaderc Cs>y|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<HHr�z<QQQ�rz<QQrrz<Qrrz"Corrupt extra field %04x (size=%d)��������)r�r�)r1rCr-r.rrmrlrj)r{r1r-�tp�lnZcounts�idx�oldrrr� _decodeExtra�s4       zZipInfo._decodeExtracCs�t|tj�rtj|�}tj|�}tj|j�}tj|j �}|dd�}|dkrP|}tj j tj j |�d�}x$|dtj tjfkr�|dd�}qjW|r�|d7}|||�}|jd@d>|_|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._UpdateKeyscCs0|jdB}|||dAd?d@A}|j|�|S)zDecrypt a single character.rrrr�)r�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<BBHr$r ) �lzmaZ_encode_filter_properties� FILTER_LZMA1r�� FORMAT_RAW�_decode_filter_propertiesr�rCr�r.)r{Zpropsrrr�_initXszLZMACompressor._initcCs*|jdkr|j�|jj|�S|jj|�S)N)r�r��compress)r{rSrrrr�_s zLZMACompressor.compresscCs&|jdkr|j�|jj�S|jj�S)N)r�r��flush)r{rrrr�ds zLZMACompressor.flushN)rrrr|r�r�r�rrrrr�Ssr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr+F)�_decomp� _unconsumed�eof)r{rrrr|lszLZMADecompressor.__init__cCs�|jdkr�|j|7_t|j�dkr*dStjd|jdd��\}t|j�d|krXdStjtjtjtj |jdd|��gd�|_|jd|d�}|`|jj |�}|jj |_ |S)Nr r+z<Hr)r�) r�r�r.rCr-r�r�r�r�r�� decompressr�)r{rSZpsizer@rrrr�qs   zLZMADecompressor.decompressN)rrrr|r�rrrrr�jsr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr*��a�bcCsX|tkr nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)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) rr�zlib� RuntimeErrorr�bz2rr��NotImplementedError)� compressionrrr�_check_compression�sr�cCs@|tkrtjtjtjd�S|tkr*tj�S|tkr8t �SdSdS)Nr(i�) rr�Z compressobjZZ_DEFAULT_COMPRESSIONZDEFLATEDrr�Z BZ2Compressorrr�)rbrrr�_get_compressor�s r�cCsn|tkr dS|tkrtjd�S|tkr.tj�S|tkr<t�St j |�}|r\t d||f��nt d|f��dS)Nr(zcompression type %d (%s)zcompression type %di�) rrr�Z decompressobjrr�ZBZ2Decompressorrr�r�r�r�)rbZdescrrrr�_get_decompressor�s  r�c@s&eZdZdd�Zd dd�Zdd�ZdS) � _SharedFilecCs"||_||_||_||_||_dS)N)�_file�_pos�_close�_lock�_writing)r{�file�pos�close�lockZwritingrrrr|�s z_SharedFile.__init__rc CsL|j�<|j�rtd��|jj|j�|jj|�}|jj�|_|SQRXdS)NzyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)r�r�rwr�rAr�r;rW)r{�nrSrrrr;�s  z_SharedFile.readcCs$|jdk r |j}d|_|j|�dS)N)r�r�)r{�fileobjrrrr��s z_SharedFile.closeNr�)r�)rrrr|r;r�rrrrr��s r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd d �Zd S) � _TellablecCs||_d|_dS)Nr)r9rQ)r{r9rrrr|�sz_Tellable.__init__cCs|jj|�}|j|7_|S)N)r9�writerQ)r{rSr�rrrr��s z_Tellable.writecCs|jS)N)rQ)r{rrrrW�sz_Tellable.tellcCs|jj�dS)N)r9r�)r{rrrr��sz_Tellable.flushcCs|jj�dS)N)r9r�)r{rrrr��sz_Tellable.closeN)rrrr|r�rWr�r�rrrrr��s r�cs�eZdZdZdZdZddd�Zd d �Zd!d d �Zd"d d�Z dd�Z d$dd�Z dd�Z dd�Z dd�Zdd�Z�fdd�Z�ZS)%� ZipExtFilezZFile-like object for reading an archive member. Is returned by ZipFile.open(). rriNFcCs�||_||_||_|j|_|j|_|j|_t |j�|_ d|_ d|_ d|_ d|_|jdk rf|jd8_||_|j|_t|d�r�|j|_td�|_nd|_dS)NFr+rrrk)�_fileobj� _decrypter�_close_fileobjrb�_compress_typerl�_compress_leftrm�_leftr�� _decompressor�_eof� _readbuffer�_offset�newlines�moder?�namer=rk� _expected_crc�crc32� _running_crc)r{r�r�zipinfoZ decrypterZ close_fileobjrrrr|s&    zZipExtFile.__init__cCsvd|jj|jjfg}|jsX|jd|j|jf�|jtkrb|jdt j |j|j��n |jd�|jd�dj |�S)Nz<%s.%sz name=%r mode=%rz compress_type=%sz [closed]r}r~) rrr�closedr/rrr�rr�r�r0)r{r@rrrr�#s   zZipExtFile.__repr__cCsL|dkr>|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<td|j��dS)NzBad CRC-32 for file %r)rr r rrr)r{�newdatarrr� _update_crcrs  zZipExtFile._update_crccCs|dks|dkrV|j|jd�}d|_d|_x$|jsP|j|j�}|r.||7}Pq.W|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r xN|j�s |j|�}|t|�kr�||_||_||d|�7}P|r�||7}Pq�W|S)z7Read up to n bytes with at most one read() system call.Nrr+)rrrrrr.)r{r�rrSrrrr�read1|s>      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)rr�rrZunconsumed_tailr.�_read2rr�r\� 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+) r�r\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�)rrrrrrr|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.) r rwr.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)Nrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limitF)!r r#r�r*r�r,r.r�r�r'rlr+r-rkrmrfr(rCr�� _DD_SIGNATURErWr)� start_dirr�r�rArjr�r��filelistr/� NameToInfor?)r{rr�)rrrr��s8          z_ZipWriteFile.close) rrrr|�propertyr�r/r�r�r%rr)rrr&�s   r&c@seZdZdZdZdZdedfdd�Zdd�Zd d �Z d d �Z d d�Z dd�Z dd�Z d<dd�Zdd�Zdd�Zdd�Zedd��Zejdd��Zd=dd�Zd>d 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'.r6�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr+r<zw+bzx+bzr+b�wbZxb)r6r7r8r9zr+bzw+bzx+brrTrz"Mode must be 'r', 'w', 'x', or 'a')r6r7r8r9)r7r8)%rwr�� _allowZip64� _didModify�debugr4r3r�rr��_commentr�rtr�r��str� _filePassedr?rr>r9r8�getattr� _fileRefCnt� threading�RLockr�� _seekabler��_RealGetContentsrWr2�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~) rrrr9r@r/r?rr0)r{r@rrrr��s    zZipFile.__repr__cCs�|j}y t|�}Wntk r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_ |t ||}|t t kr�|t t8}|jdkr�||}td|||�|||_|j|jd�|j|�}tj|�}d}�x�||k�r�|jt�} t| �tk�rtd��tjt| �} | ttk�r0td��|jdk�rDt| �|j| t�} | d} | d @�rp| jd �} n | jd �} t| �} |j| t�| _|j| t �| _!| t"| _#| dd �\ | _$| _%| _&| _'| _(| _)} }| _*| _+| _,| j&t-k�r�t.d | j&d��| dd�\| _/| _0| _1| | _2|d?d|d?d@|d@| d?| d?d@| d@df| _3| j4�| j#|| _#|j5j6| �| |j7| j8<|t| t| t| t }|jdkr�td|�q�WdS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!izutf-8�cp437rzzip file version %.1fr%r(r*r$i�rr&r�totalN)9r9r7r8rr=�printrNrO� _ECD_COMMENTr>� _ECD_LOCATIONrIrHrFrBr2rAr;r�BytesIO�sizeCentralDirr.rCr-�structCentralDir� _CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder �_CD_EXTRA_FIELD_LENGTHr1�_CD_COMMENT_LENGTHr_�_CD_LOCAL_HEADER_OFFSETrjrTrcrdrerfrbrkrlrm�MAX_EXTRACT_VERSIONr�rgrhrirnrar�r3r/r4r?)r{r9rRZsize_cdZ offset_cd�concatZinferredrSrP�centdirr?�flagsr8�t�drrrrF�sp                4       zZipFile._RealGetContentscCsdd�|jD�S)z+Return a list of file names in the archive.cSsg|] }|j�qSr)r?)�.0rSrrr� <listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>)r3)r{rrr�namelist�szZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the archive.)r3)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)rhrirj)rQr3rar?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.rrr6Ni)r3r>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)r4r��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!� TypeErrorrKrr�)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!rqrKrr.�ZIP_MAX_COMMENT�warnings�warnr>r<)r{r_rurrrr_*s    c Cs"|j|d|�� }|j�SQRXdS)zReturn file bytes for name.r6N)r>r;)r{rr�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. r6r7zopen() 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)rwzyCan'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�<lambda>lszZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)izutf-8rOz/File name in directory %r and header %r differ.Nz6File %r is encrypted, password required for extractionrrrr�r�r&zBad password for file %rT>r6r7)*rwr�r!rqrKrr9r r�rbrp�_open_to_writer�rBr�rjrHr�r;�sizeFileHeaderr.rrCr-r�� _FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrfr�rZr`r�r�r�r[r"rnrkr�r�)r{rrr�rwr�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=rmrlrkrfrbrrErir�r9rAr2rWrj� _writecheckr<r�r�r&)r{r�rwr�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)rfrtr�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)rdr8rrr� <genexpr>sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdS)Nr)rdr8rrrr�s)�!_windows_illegal_name_trans_tabler?� 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)rdr8)�invalid_path_partsrrr�sz*ZipFile._extract_member.<locals>.<genexpr>�\)r�r:N)r�r rpr?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)rsr7r8r9z&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closedz Files countZFilesizez Zipfile sizez would require ZIP64 extensions)r7r8r9)r?r4rurvrrwr9r�rbr;r.r3�ZIP_FILECOUNT_LIMITrmr�rjr )r{r�ru�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�|_ WdQRXn<t|d��,}|j|d ��}tj||d �WdQRXWdQRXdS) zLPut the bytes from filename into the archive under the name arcname.z7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsrNrTFr<r7iri )r9rwr�r r�r�rlrkrbr�r�rErAr2rWrjrrfr�r<r3r/r4r?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.r7)rr�i�Ai�)r�r?r�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.r7r8r9)r7r8r9) r9r�rwrr<r�rErAr2�_write_end_recordrH)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��z<HH�Qr)r�z Files countzCentral directory offsetzCentral directory sizez would require ZIP64 extensions�,ri��)r)4r3rarmr�rlr/rjr1r6rCr�r.r�rbrr\r�rr�rdrTr�rVrXrcrerkr_rhri�DeprecationWarningrQrfr?rx�stderrr9r�rWr2r�r;r rGrHrDrErrZrYr>r�)r{r�r�r�r�r1rmrlrjZ extra_datar�rdrTr?rfr`Zpos2Z centDirCountZ centDirSizeZ centDirOffsetr�Z zip64endrecZ zip64locrecrRrrrr��s�$$                                     zZipFile._write_end_recordcCs*|jd8_|j r&|j r&|j�dS)Nr)rBr@r�)r{r9rrrrHszZipFile._fpclose)N)N)r6N)F)NN)NNN)NN)N)$rrrrr9r�rr|rJrNr�rFrfrgrkrmrprrr5r_�setterr;r>r{r�r�r�r�r�r�r�r�r�r�r�rHrrrrr 's<WN     q +  * * $fc@s4eZdZdZdedd fdd�Zdd d �Zd d �ZdS)r zDClass to create ZIP archives with Python library files and packages.r6TrcCstj|||||d�||_dS)N)rr�rI)r r|� _optimize)r{r�rr�rI�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�rQr�r0�isfile� _get_codenamer��listdir�remove�splitext�writepyr�)r{�pathname�basenamer�Zlabel�dirrZinitnamer�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=rQ�compile�PyCompileError�msg)r�r�r��err)r{rr�_compile}s  z)PyZipFile._get_codename.<locals>._compilez.pyz.pycr~)� optimizationrrz"invalid value for 'optimize': {!r})r�z%s/%sr�)r�r�)� importlib�util�cache_from_sourcer�rtr�r�r�r�rxrar��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�-trr6z.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)r.r��zippathZnm)�addToZiprrr��s   zmain.<locals>.addToZipr7r~)r�r�r�r�)�textwrap�dedentrx�argvrQ�exitr.r rkrmr�r�rtr�r�r�r�r�)�argsr�ZUSAGEr.Zbadfiler�r�r)r�r�main�sT           r��__main__li���ii��ii��)N)�rrrt�re�importlib.utilr�rxr�r�r�rCZbinasciirC� ImportErrorZdummy_threadingr�r r�r��__all__� Exceptionrr rrr�r�rtrrrrrzr�r�r�r^rZrYr�rXrIrJrKrLrMrNrOr^rRrSrVrXrUrWZ_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_SIZErYr[r\Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr]r�r�r|r}Z_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~rrDrErBrGrHrFZ_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_CENTDIRr1�Structr,r6r:r rUr7�objectr r�r�r�r�r�r�r�r�r�rr�r&r r r�rrrrr�<module>s@              +=Y= fJy/ B