Uname: Linux server.digisquadtech.com 4.18.0-553.100.1.el8_10.x86_64 #1 SMP Mon Feb 2 04:13:33 EST 2026 x86_64
User: 1091 (madhavfluid)
Group: 1090 (madhavfluid)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//usr/lib64/python3.6///__pycache__      ( Reset | Go to )
File Name: zipfile.cpython-36.opt-1.pyc
3
]i482@sdZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z y ddl Z Wne k
r|ddlZ YnXyddlZejZWne k
rdZe jZYnXy ddlZWne k
rdZYnXy ddlZWne k
rdZYnXddddddd    d
d d d dg ZGdddeZGdddeZeZZdfZdhZdjZdZdZdZdZdZ 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'e3Z5dZ6dZ7dZ8dZ9dZ:d Z;d!Z<d"Z=dZ>d#Z?d&Z@d'ZAdZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJe
j'eIZKdZLdZMdZNdZOdZPd ZQd!ZRd"ZSdZTd#ZUd&ZVd'ZWd.ZXd/ZYe
j'eXZZd0Z[d1Z\e
j'e[Z]dZ^dZ_dZ`dZadZbd Zcd!Zdd"ZedZfd#Zgd2Zhe
jid3Zjd4d5Zkd6d7Zld8d
Zmd9d:Znd;d<ZoGd=d d epZqGd>d?d?ZrGd@dAdAZsGdBdCdCZtdDdEdFdFdFdFdGdHdIdJdGdKdLdMdNdOdPdQZudRdSZvdTdUZwdVdWZxGdXdYdYZyGdZd[d[ZzGd\d]d]ej{Z|Gd^d_d_ej{Z}Gd`d d Z~Gdad d e~ZdkdbdcZeddkredS)lzP
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 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
Cstj}d}g}d}}xf|dt|kr|||||d\}}|d|}    ||krv||krn|j||||    }d}|    }qW|s|Sdj|S)NFrr T)_EXTRA_FIELD_STRUCTunpacklenappendjoin)
extraZxidsr-ZmodifiedbufferstartiZxidZxlenjrrr _strip_extras  r6c Cs*yt|rdSWntk
r$YnXdS)NTF) _EndRecDataOSError)fprrr_check_zipfiles r:cCsVd}y8t|drt|d}nt|d}t|}WdQRXWntk
rPYnX|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.
    Fread)r9rbN)hasattrr:openr8)filenameresultr9rrrr    s
  cCsy|j|tdWntk
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)seeksizeEndCentDir64Locatorr8r;r.structr-structEndArchive64LocatorstringEndArchive64LocatorrsizeEndCentDir64structEndArchive64stringEndArchive64_ECD_SIGNATURE_ECD_DISK_NUMBER_ECD_DISK_START_ECD_ENTRIES_THIS_DISK_ECD_ENTRIES_TOTAL    _ECD_SIZE _ECD_OFFSET)fpinoffsetendrecdataZsigZdisknoZreloffZdisksZszcreate_versionZ read_versionZdisk_numZdisk_dirZdircountZ    dircount2ZdirsizeZ    diroffsetrrr _EndRecData64s6
 
  rUc     Csf|jdd|j}y|jt dWntk
r:dSX|j}t|tkr|ddtkr|d    ddkrtjt    |}t
|}|j d|j |tt |t |St |d
td}|j|d|j}|jt}|dkrb|||t}t|tkrdSt
tjt    |}|t}||t|t|}|j ||j ||t |||||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.rrNr sr+rri)rAtellsizeEndCentDirr8r;r.stringEndArchiverCr-structEndArchivelistr/rUmaxrfind_ECD_COMMENT_SIZE)    rPZfilesizerSrRZmaxCommentStartr3ZrecDataZ commentSizecommentrrrr7s>   
 


r7c@sVeZdZdZd)Zd+ddZddZd,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_systemrTextract_versionreserved    flag_bitsvolume internal_attr external_attr header_offsetCRC compress_size    file_size    _raw_time _end_offsetNoNamerrcCs||_|jtd}|dkr(|d|}tjdkrJtj|krJ|jtjd}||_||_|ddkrjtdt    |_
d|_ d|_ t jdkrd|_nd|_t|_t|_d|_d|_d|_d|_d|_d|_dS)Nr/iz+ZIP does not support timestamps before 1980r+Zwin32r)r`findchrossepreplacer?ra
ValueErrorrrbr_r1sysplatformrcDEFAULT_VERSIONrTrdrerfrgrhriro)selfr?raZ    null_byterrr__init__Xs0  
zZipInfo.__init__cCsd|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=%sriz  filemode=%rz external_attr=%#xz  file_size=%rz compress_size=%r>)    __class__rr?rbrr/compressor_namesgetristatfilemodeis_dirrmrlr0)r|r@hiloisdirrrr__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}|rd }
|tj|
dtj    |
d    ||}|tks|tkr|st
d d}d}t }    |j t krtt|    }    n|j tkrtt|    }    t|    |j|_t|    |j|_|j\} } tjtt|j|j| |j |||||t| t| } | | |S)z-Return the per-file header as a bytes object.rir$rr!rrr&r rNz<HHQQz'Filesize would require ZIP64 extensionsl)rarfrkrlrmr1 ZIP64_LIMITrCpackcalcsizer ZIP64_VERSIONrbrr\ BZIP2_VERSIONr LZMA_VERSIONrdrT_encodeFilenameFlagsstructFileHeaderstringFileHeaderrer.)r|zip64dtdosdatedostimerkrlrmr1 min_versionfmtr?rfheaderrrr
FileHeadersF$$
   
 

zZipInfo.FileHeaderc Cs>y|jjd|jfStk
r8|jjd|jdBfSXdS)Nasciizutf-8i)r?encoderfUnicodeEncodeError)r|rrrrszZipInfo._encodeFilenameFlagscCs(|j}tj}xt|dkr"|d|dd\}}|dkr|dkrZ|d|dd}nV|dkrv|d|dd    }n:|d
kr|d |dd }n|d krf}ntd||fd }|jdkr|||_|d7}|jdkr|||_|d7}|jdkr|j}|||_|d7}||dd}qWdS)Nr z<HHrz<QQQrz<QQrrz<Qrrz"Corrupt extra field %04x (size=%d))rr)r1rCr-r.rrmrlrj)r|r1r-tplnZcountsidxoldrrr _decodeExtras4




 
zZipInfo._decodeExtracCst|tjrtj|}tj|}tj|j}tj|j    }|dd}|dkrP|}tj
j tj
j |d}x$|dtj tjfkr|dd}qjW|r|d7}|||}|jd@d>|_|rd|_|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"Nrrrir)
isinstanceruPathLikefspathrS_ISDIRst_modetime    localtimest_mtimepathnormpath
splitdrivervaltseprirmst_size)clsr?arcnamestrmtimerazinforrr    from_files(


   
zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.rrr)r?)r|rrrrszZipInfo.is_dir)r`r?rarbr_r1rcrTrdrerfrgrhrirjrkrlrmrnrorqrrrrr)rpr)N)N) rrrr    __slots__r}rrrr classmethodrrrrrrr
>s:
+
.$ !c@s<eZdZdZddZdZddZddZd    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}xTtdD]H}|}x6tdD]*}|d@rH|d?d@|A}q*|d?d@}q*W|||<qW|S)zGenerate 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[rrri)range)Zpolytabler4crcr5rrr_GenerateCRCTable%s
 z_ZipDecrypter._GenerateCRCTableNcCs|d?d@|j||Ad@AS)z(Compute the CRC32 primitive on one byte.ri)crctable)r|Zchrrrr_crc329sz_ZipDecrypter._crc32cCsBtjdkrtjt_d|_d|_d|_x|D]}|j|q,WdS)NixV4igE#ixV4)rrrkey0key1key2 _UpdateKeys)r|pwdprrrr}=s


z_ZipDecrypter.__init__cCsX|j||j|_|j|jd@d@|_|jddd@|_|j|jd?d@|j|_dS)Nrlirr)rrrr)r|crrrrFsz_ZipDecrypter._UpdateKeyscCs0|jdB}|||dAd?d@A}|j||S)zDecrypt a single character.rrrr)rr)r|rkrrr__call__Ls

z_ZipDecrypter.__call__)
rrrrrrrr}rrrrrrrs     rc@s,eZdZddZddZddZddZd    S)
LZMACompressorcCs
d|_dS)N)_comp)r|rrrr}WszLZMACompressor.__init__cCsFtjdtji}tjtjtjtj|gd|_tjdddt    ||S)Nid)filtersz<BBHr$r )
lzmaZ_encode_filter_properties FILTER_LZMA1r
FORMAT_RAW_decode_filter_propertiesrrCrr.)r|Zpropsrrr_initZszLZMACompressor._initcCs*|jdkr|j|jj|S|jj|S)N)rrcompress)r|rSrrrras
zLZMACompressor.compresscCs&|jdkr|j|jjS|jjS)N)rrflush)r|rrrrfs
zLZMACompressor.flushN)rrrr}rrrrrrrrUsrc@seZdZddZddZdS)LZMADecompressorcCsd|_d|_d|_dS)Nr+F)_decomp _unconsumedeof)r|rrrr}nszLZMADecompressor.__init__cCs|jdkr|j|7_t|jdkr*dStjd|jdd\}t|jd|krXdStjtjtjtj    |jdd|gd|_|jd|d}|`|jj
|}|jj |_ |S)Nr r+z<Hr)r) rrr.rCr-rrrrr
decompressr)r|rSZpsizer@rrrrss
 
zLZMADecompressor.decompressN)rrrr}rrrrrrlsrZstoreZshrinkreduceZimplodetokenizeZdeflateZ    deflate64Zbzip2rZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr*abcCsX|tkr
nJ|tkr tsTtdn4|tkr6tsTtdn|tkrLtsTtdntddS)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 RuntimeErrorrbz2rrNotImplementedError) compressionrrr_check_compressionsrcCs@|tkrtjtjtjdS|tkr*tjS|tkr8t    SdSdS)Nr(i)
rrZ compressobjZZ_DEFAULT_COMPRESSIONZDEFLATEDrrZ BZ2Compressorrr)rbrrr_get_compressors
rcCsn|tkr dS|tkrtjdS|tkr.tjS|tkr<tSt    j
|}|r\t d||fnt d|fdS)Nr(zcompression type %d (%s)zcompression type %di) rrrZ decompressobjrrZBZ2Decompressorrrrrr)rbZdescrrrr_get_decompressors

rc@s0eZdZddZd ddZdddZd    d
Zd S) _SharedFilecCs2||_||_||_||_||_|j|_|j|_dS)N)_file_pos_close_lock_writingseekablerW)r|fileposcloselockwritingrrrr}sz_SharedFile.__init__rc    CsB|j2|jrtd|jj|j|jj|_|jSQRXdS)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.)rrrxrrArrW)r|rQwhencerrrrAs  z_SharedFile.seekrc    CsL|j<|jrtd|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.)rrrxrrArr;rW)r|nrSrrrr;s  z_SharedFile.readcCs$|jdk    r |j}d|_|j|dS)N)rr)r|fileobjrrrrs
z_SharedFile.closeN)rr)r)rrrr}rAr;rrrrrrs    


rc@s4eZdZddZddZddZddZd    d
Zd S)     _TellablecCs||_d|_dS)Nr)r9rQ)r|r9rrrr}sz_Tellable.__init__cCs|jj|}|j|7_|S)N)r9writerQ)r|rSrrrrrs z_Tellable.writecCs|jS)N)rQ)r|rrrrWsz_Tellable.tellcCs|jjdS)N)r9r)r|rrrrsz_Tellable.flushcCs|jjdS)N)r9r)r|rrrrsz_Tellable.closeN)rrrr}rrWrrrrrrrs
rcseZdZdZd&ZdZd'Zd(dd    Zd
d Zd*d d Z    d+ddZ
ddZ d-ddZ ddZ ddZddZddZfddZddZd.d!d"Zd#d$ZZS)/
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    rrirNFc Cs||_||_||_|j|_|j|_|j|_t    |j|_
d|_ d|_ d|_ d|_|jdk    rf|jd8_||_|j|_t|dr|j|_td|_nd|_d|_y4|jr|j|_|j|_|j|_|j|_d|_Wntk
rYnXdS)NFr+rrrkT)_fileobj
_decrypter_close_fileobjrb_compress_typerl_compress_leftrm_leftr _decompressor_eof _readbuffer_offsetnewlinesmoder?namer=rk _expected_crccrc32 _running_crc    _seekablerrW_orig_compress_start_orig_compress_size_orig_file_size_orig_start_crcAttributeError)r|rr
zipinfoZ    decrypterZ close_fileobjrrrr}s: 

 

zZipExtFile.__init__cCsvd|jj|jjfg}|jsX|jd|j|jf|jtkrb|jdt    j
|j|jn
|jd|jddj |S)Nz<%s.%sz name=%r mode=%rz compress_type=%sz     [closed]r~r) rrrclosedr/r r
rrrrr0)r|r@rrrr?s


zZipExtFile.__repr__cCsL|dkr>|jjd|jd}|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)rrsrioBufferedIOBasereadline)r|limitr4linerrrrMszZipExtFile.readlinecCsr|t|j|jkr\|j|}t||jkrJ||j|jd|_d|_n|jt|8_|j|j|jdS)z6Returns buffered bytes without advancing the position.Nri)r.rrr;)r|rchunkrrrpeek]s
zZipExtFile.peekcCsdS)NTr)r|rrrreadablejszZipExtFile.readablecCs |dks|dkrL|j|jd}d|_d|_x|jsF||j|j7}q.W|S||j}|t|jkr~|j|j|}||_|S|t|j}|j|jd}d|_d|_x^|dko|j r|j|}|t|kr||_||_||d|7}P||7}|t|8}qW|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..
        Nrr+)rrr_read1MAX_Nr.)r|rbufendrSrrrr;ms4

 zZipExtFile.readcCs@|jdkrdSt||j|_|jr<|j|jkr<td|jdS)NzBad CRC-32 for file %r)r r rrrr )r|newdatarrr _update_crcs

zZipExtFile._update_crccCs|dks|dkrV|j|jd}d|_d|_x$|jsP|j|j}|r.||7}Pq.W|S||j}|t|jkr|j|j|}||_|S|t|j}|j|jd}d|_d|_|dkr xN|js
|j|}|t|kr||_||_||d|7}P|r||7}PqW|S)z7Read up to n bytes with at most one read() system call.Nrr+)rrrr r!r.)r|rr"rSr#rrrread1s> 



 zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|krR||j|t|7}n
|j|}|jtkrj|jdk|_nx|jtkrt    ||j
}|jj ||}|jj p|jdko|jj |_|jr||jj 7}n |jj |}|jj p|jdk|_|d|j}|jt|8_|jdkrd|_|j||S)Nrr+T)rrrrZunconsumed_tailr._read2rrr\ MIN_READ_SIZErrrrr%)r|rrSrrrr s2
 


 
   
zZipExtFile._read1cCsj|jdkrdSt||j}t||j}|jj|}|jt|8_|sLt|jdk    rft    t
|j|}|S)Nrr+) rr\r(minrr;r.EOFErrorrbytesmap)r|rrSrrrr's
   
zZipExtFile._read2c
s&z|jr|jjWdtjXdS)N)rrrsuper)r|)rrrrszZipExtFile.closecCs|jS)N)r)r|rrrrszZipExtFile.seekablercCs,|jstjd|j}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd||jkrd|j}|dkrpd}||}||j}|dkr|t|jkr||_d}nR|dkr|j    j
|j |j |_ |j|_|j|_d|_d|_tj|j|_d|_|}x,|dkr"t|j|}|j|||8}qW|jS)Nz!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r+F)rrUnsupportedOperationrWrrxrr.rrrArrrrrrZzipfilerrrrr) MAX_SEEK_READr;)r|rQrZcurr_posZnew_posZ read_offsetZ buff_offsetZread_lenrrrrAsD

 

  
 zZipExtFile.seekcCs0|jstjd|j|jt|j|j}|S)Nz!underlying stream is not seekable)rrr.rrr.rr)r|ZfileposrrrrW*s
zZipExtFile.telli@i)NFr)r)rr)r)r)rrrrr!r(r/r}rrrrr;r%r&r r'rrrArW __classcell__rr)rrrs&
*


!
%$ 
/rcs@eZdZddZeddZddZddZfd    d
ZZ    S) _ZipWriteFilecCs4||_||_||_t|j|_d|_d|_d|_dS)Nr)    _zinfo_zip64_zipfilerrb _compressor
_file_size_compress_size_crc)r|zfrrrrrr}2s z_ZipWriteFile.__init__cCs|jjS)N)r5r9)r|rrrr;sz_ZipWriteFile._fileobjcCsdS)NTr)r|rrrwritable?sz_ZipWriteFile.writablecCsf|jrtdt|}|j|7_t||j|_|jrV|jj|}|jt|7_|j    j
||S)NzI/O operation on closed file.) rrxr.r7r r9r6rr8rr)r|rSnbytesrrrrBs  z_ZipWriteFile.writecsX|jr
dStj|jrN|jj}|jt|7_|jj||j|j    _
n
|j |j    _
|j |j    _ |j |j    _|j    jd@r|jrdnd}|jjtj|t|j    j |j    j
|j    j|jj|j_nn|js|j tkrtd|jtkrtd|jj|j_|jj|j    j|jj|j    j|j|jj|jjd|j_|jjj|j    |j    |jj|j    j <dS)Nrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limitF)!rr-rr6rr8r.rrr3rlr7r9rkrmrfr4rCr _DD_SIGNATURErWr5    start_dirrrrArjrrfilelistr/
NameToInfor?)r|r"r)rrrrNs8

  


 

z_ZipWriteFile.close)
rrrr}propertyrr;rrr1rr)rrr21s
      r2c@seZdZdZdZdZdedfddZddZd    d
Z    d d Z
d dZ ddZ ddZ d<ddZddZddZddZeddZejddZd=ddZd>d d!d"d#Zd?d$d%Zd@d&d'ZdAd(d)Zed*d+Zd,d-Zd.d/ZdBd0d1ZdCd2d3Zd4d5Z d6d7Z!d8d9Z"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.

    NrTcCsF|dkrtdt|||_d|_d|_i|_g|_||_||_d|_    d    |_
t |t j rdt j|}t |trd|_||_d
d d d d ddd}||}x^ytj|||_Wn(tk
r||kr||}wYnXPqWnd|_||_t|dd|_d|_tj|_d|_d|_y|dkr*|jn|dkrd|_y|jj|_Wn2t tfk
r|t!|j|_d|_d|_Yn6Xy|jj"|jWn t tfk
rd|_YnXnf|dkry|j|jj"|jWn6t#k
r|jj"ddd|_|jj|_YnXntdWn$|j}d|_|j$|YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.rBwxaz+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr+r<zw+bzx+bzr+bwbZxb)rBrCrDrEzr+bzw+bzx+brr Trz"Mode must be 'r', 'w', 'x', or 'a')rBrCrDrE)rCrD)%rxr _allowZip64
_didModifydebugr@r?rr
r_commentrrurrstr _filePassedr?rr>r9r8getattr _fileRefCnt    threadingRLockrrr_RealGetContentsrWr>rrrAr_fpclose)r|rr
r
allowZip64ZmodeDictrr9rrrr}s 

 



  
 
zZipFile.__init__cCs|S)Nr)r|rrr    __enter__szZipFile.__enter__cCs |jdS)N)r)r|typevalue    tracebackrrr__exit__szZipFile.__exit__cCsd|jj|jjfg}|jdk    rd|jr8|jd|jn|jdk    rR|jd|j|jd|jn
|jd|jddj|S)Nz<%s.%sz file=%rz  filename=%rz mode=%rz     [closed]r~r)    rrrr9rLr/r?r
r0)r|r@rrrrs



zZipFile.__repr__cCs|j}y t|}Wntk
r.tdYnX|s<td|jdkrNt||t}|t}|t|_    |t
||}|t t kr|t t8}|jdkr||}td||||||_|j|jd|j|}tj|}d}x||kr|jt}    t|    tkrtdtjt|    }    |    ttkr0td|jdkrDt|    |j|    t}
|    d} | d    @rp|
jd
}
n
|
jd }
t|
} |j|    t| _|j|    t | _!|    t"| _#|    dd \ | _$| _%| _&| _'| _(| _)} }| _*| _+| _,| j&t-krt.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 }|jdkrtd|qW|j}x*t9|j5ddddD]}||_:|j#}qWdS)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-8cp437rzzip file version %.1fr%r(r*r$irr&rtotalcSs|jS)N)rj)rrrr<lambda>Isz*ZipFile._RealGetContents.<locals>.<lambda>T)keyreverseN);r9r7r8rrIprintrNrO _ECD_COMMENTrJ _ECD_LOCATIONrIrHrFrBr>rAr;rBytesIOsizeCentralDirr.rCr-structCentralDir _CD_SIGNATUREstringCentralDir_CD_FILENAME_LENGTHdecoder
_CD_EXTRA_FIELD_LENGTHr1_CD_COMMENT_LENGTHr__CD_LOCAL_HEADER_OFFSETrjrTrcrdrerfrbrkrlrmMAX_EXTRACT_VERSIONrrgrhrirnrarr?r/r@r?sortedro)r|r9rRZsize_cdZ    offset_cdconcatZinferredrSrZcentdirr?flagsrDtdZ
end_offsetrrrrrQs| 

  




  
 

4      
 zZipFile._RealGetContentscCsdd|jDS)z+Return a list of file names in the archive.cSsg|]
}|jqSr)r?).0rSrrr
<listcomp>Psz$ZipFile.namelist.<locals>.<listcomp>)r?)r|rrrnamelistNszZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.)r?)r|rrrinfolistRszZipFile.infolistcCsPtdd
|dx:|jD]0}d|jdd}td    |j||jf|dqWdS) z+Print a table of contents for the zip file.z%-46s %19s %12s    File Name Modified    Size)rz%d-%02d-%02d %02d:%02d:%02dNr"z %-46s %s %12d)rvrwrx)r^r?rar?rm)r|rrZdaterrrprintdirWs  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.rrrBNi)r?r>r?r;r)r|Z
chunk_sizerfrrrtestzip`s  zZipFile.testzipcCs$|jj|}|dkr td||S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r@rKeyError)r|r inforrrgetinfoms
 
zZipFile.getinfocCs8|r"t|t r"tdt|j|r.||_nd|_dS)z)Set default password for encrypted files.zpwd: expected bytes, got %sN)rr+    TypeErrorrUrr)r|rrrr setpasswordvs
zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)rJ)r|rrrr_szZipFile.commentcCs^t|tstdt|jt|tkrNddl}|jdtdd|dt}||_    d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr)
stacklevelT) rr+rrUrr.ZIP_MAX_COMMENTwarningswarnrJrH)r|r_rrrrr_s
   c    Cs"|j|d|
}|jSQRXdS)zReturn file bytes for name.rBN)r>r;)r|r rr9rrrr;sz ZipFile.readF) force_zip64c s|d"krtd|r2t|t r2tdt|j|rF|dkrFtdjsTtdt|trd|}n$|dkr~t|}j|_    n
j
|}|dkrj ||dSj rtdj d    7_ tj|jjjfd
d }y|jt}t|tkrtd tjt|}|ttkr td |j|t}|trF|j|t|jd@rZtd|jd@rntd|jd@r|jd}    n
|jd}    |    |j krtd|j |f|j!dk    r|j"|j#|j!krtd|j d|jd    @}
d} |
r|sj$}|st%d|t&|} |jd} t't(| | dd} |jd@rX|j)d?d@}n|j*d?d@}| d|krt%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.
        rBrCzopen() 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)rzyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.rcsjS)N)rr)r|rrr[szZipFile.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-8rYz/File name in directory %r and header %r differ.NzOverlapped entries: z (possible zip bomb)z6File %r is encrypted, password required for extractionrrrrrr&zBad password for file %rT>rCrB)-rxrr+rrUrr9r
rrbr~_open_to_writerrNrrjrRrr;sizeFileHeaderr.rrCr-r _FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHrfrrgr`rorWrlrrrr[r,rnrkrr)r|r r
rrrZzef_fileZfheaderfnameZ    fname_strZ is_encryptedZzdrhZ
check_byter)r|rr>s 




 
    
  

  z ZipFile.opencCs|r|j rtd|jr"tdt|ds2d|_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.rmrrrirg?Ti)rGrxrr=rmrlrkrfrbrrrirr9rAr>rWrj _writecheckrHrrr2)r|rrrrrrr 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)rugetcwdr_extract_member)r|memberrrrrrextract6s

zZipFile.extractcCsL|dkr|j}|dkr"tj}n
tj|}x|D]}|j|||q2WdS)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)rtrurrr)r|rmembersrrrrr
extractallCs


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|]}|jdVqdS).N)rstrip)rrrDrrr    <genexpr>^sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdS)Nr)rrrDrrrr`s)!_windows_illegal_name_trans_tablerK    maketransr.    translatesplitr0)rrpathseprZillegalrrr_sanitize_windows_nameTs
zZipFile._sanitize_windows_namecsNt|ts|j|}|jjdtjj}tjjrB|jtjjtjj}tjj    |d}dtjj
tjj ftjjj fdd|j tjjD}tjjdkr|j|tjj}tjj ||}tjj|}tjj|}|rtjj| rtj||jrtjj|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.
        rrrrc3s|]}|kr|VqdS)Nr)rrrD)invalid_path_partsrrrtsz*ZipFile._extract_member.<locals>.<genexpr>\)rrFN)rr
r~r?rwrurrvrrcurdirpardirr0rrrdirnameexistsmakedirsrrmkdirr>shutil copyfileobj)r|rZ
targetpathrrZ    upperdirssourcetargetr)rrrcs.

&   


  zZipFile._extract_membercCs|j|jkr(ddl}|jd|jdd|jdkr:td    |jsHtd
t|j|j    sd}t
|j t krpd }n|j tkrd }n|jtkrd }|rt|ddS)z6Check for errors before writing a file to the archive.rNzDuplicate name: %rr)rrCrDrEz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closedz Files countZFilesizez Zipfile sizez would require ZIP64 extensions)rCrDrE)r?r@rrr
rxr9rrbrGr.r?ZIP_FILECOUNT_LIMITrmrrjr )r|rrrequires_zip64rrrrs( 



zZipFile._writecheckcCs0|jstd|jrtdtj||}|jr>d|_d|_n|dk    rN||_n|j    |_|jr|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<rCiri )r9rxrr
rrrlrkrbrrrrAr>rWrjrrfrrHr?r/r@r?rrr>rr)r|r?rrbrsrcdestrrrrs8  

  z ZipFile.writecCst|tr|jd}t|tspt|tjtjddd}|j|_|jddkrhd|_    |j    dO_    qtd|_    n|}|j
st d
|j rt 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?rarrriAriz7Attempt to write to ZIP archive that was already closedz?Can't write to ZIP archive while an open writing handle exists.rC)r
riAi)rrKrr
rrrrbr?rir9rxrr.rmrr>r)r|Zzinfo_or_arcnamerSrbrrrrrwritestrs.



zZipFile.writestrcCs |jdS)z2Call the "close()" method in case the user forgot.N)r)r|rrr__del__szZipFile.__del__cCs||jdkrdS|jrtdzB|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.rCrDrE)rCrDrE) r9rrxr
rHrrrAr>_write_end_recordrR)r|r9rrrrs
z ZipFile.closecCsrxP|jD]D}|j}|ddd>|dd>B|dB}|dd>|d    d>B|ddB}g}|jtksv|jtkr|j|j|j|jd
}d
}n |j}|j}|jtkr|j|jd
}n|j}|j}    d}
|rt|    d}    t    j
d d t |dd t |f||    }    t }
|j tkr(tt|
}
n|j tkr>tt|
}
t|
|j} t|
|j} yZ|j\} }t    j
tt| |j| |j||j |||j||t | t |    t |jd|j|j|}Wnltk
rttt| |j| |j|j |j |||j||t |j!t |    t |jd|j|j|ft"j#dYnX|j$j%||j$j%| |j$j%|    |j$j%|jq
W|j$j&}t |j}||j'}|j'}d}|t(krd}n|tkrd}n|tkrd}|r*|j)st*|dt    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$j3dS)Nrir$rr!rrr&r lz<HHQr)rz Files countzCentral directory offsetzCentral directory sizez would require ZIP64 extensions,ri)r)4r?rarmrrlr/rjr1r6rCrr.rrbrr\rrrrdrTrrcrercrerkr_rhriDeprecationWarningr^rfr?rystderrr9rrWr>rrGr rGrHrDrEr)rZrYrJr)r|rrrrr1rmrlrjZ
extra_datarrdrTr?rfrnZpos2Z centDirCountZ centDirSizeZ centDirOffsetrZ zip64endrecZ zip64locrecrRrrrr s$$

  
 
   
   




 
   





   


 zZipFile._write_end_recordcCs*|jd8_|j r&|j r&|jdS)Nr)rNrLr)r|r9rrrrRrszZipFile._fpclose)N)N)rBN)F)NN)NNN)NN)N)$rrrrr9rrr}rTrXrrQrtruryr{r~rrAr_setterr;r>rrrrrrrrrrrrrRrrrrr {s<WT
              
u
+

 *
*
$fc@s4eZdZdZdedd fddZdd    d
Zd d ZdS)r zDClass to create ZIP archives with Python library files and packages.rBTrcCstj|||||d||_dS)N)r
rrS)r r}    _optimize)r|rr
rrSoptimizerrrr}|s zPyZipFile.__init__rNcCstj|}|rF|| rF|jrBtjj|r.dnd}td||fdStjj|\}}tjj|rntjj|d}tjj|r|rd||f}n|}|jrtd|d||j    |d    d|\}}    |jrtd |    |j
||    tj |}
|
j dx|
D]} tjj|| } tjj | \} }tjj| rRtjjtjj| dr|j| ||d q|d kr|r||  r|jrtd| q|j    | d    d|\}}    |jrtd |    |j
||    qWn|jrtd|xtj |D]} tjj|| } tjj | \} }|d kr|r0||  r0|jrtd| q|j    | d    d|\}}    |jrZtd |    |j
||    qWnP|ddd krtd|j    |d    d|\}}    |jrtd|    |j
||    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%s %r skipped by filterfuncNz __init__.pyz%s/%szAdding package inasrrZAdding)
filterfuncz.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding filerrrr)rurrIrrr^rr0isfile _get_codenamerlistdirremovesplitextwritepyr)r|pathnamebasenamerZlabeldirr ZinitnamerrZdirlistr?rrootZextrrrrsx

 



 



 


zPyZipFile.writepyc sdfdd    }|d}|d}tjj|dd}tjj|dd}tjj|dd}jdkr\tjj|rtj|jtj|jkr|}    }
ntjj|rtj|jtj|jkr|}
|}    ntjj|rtj|jtj|jkr|}
|}    nvtjj|rtj|jtj|jkr|}
|}    nD||rRt    j
j d    kr4|}
nt    j
j dkrH|}
n|}
|}    n|}
}    njd    krr|}
|}    n<|}    jdkr|}
n&jdkr|}
nd
j j} t | tjj|
otj|
jtj|jks||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|dWn,|jk
rX}zt|jdSd}~XnXdS)NrZ    CompilingT)doraiserF)
py_compilerIr^compilePyCompileErrormsg)rrrerr)r|rr_compiles

z)PyZipFile._get_codename.<locals>._compilez.pyz.pycr) optimizationrrz"invalid value for 'optimize': {!r})rz%s/%sr)rr)    importlibutilcache_from_sourcerrurrrrryrorformatrxr) r|rrrZfile_pyZfile_pycZ pycache_opt0Z pycache_opt1Z pycache_opt2rrrZ archivenamer)r|rrs`   
  

     zPyZipFile._get_codenamer)rN)rrrrrr}rrrrrrr ys

Rc sddl}|jd}|dkr(tjdd}| s:|ddkrLt|tjd|ddkrt|dkrvt|tjdt|dd    }|jWdQRXn||ddkr
t|dkrt|tjdt|dd    }|j    }WdQRX|rtd
j
|td n|ddkrbt|d kr8t|tjdt|dd    }|j |dWdQRXn|ddkrt|d krt|tjdfd dt|ddh}x`|ddD]P}t j j|}|st j jt j j|}|dt jt jfkrd}|||qWWdQRXdS)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-trrBz.The following enclosed file is corrupted: {!r}z Done testingrcsptjj|r|j||tnPtjj|rl|r8|j||x2tj|D]$}|tjj||tjj||qDWdS)N)rurrrrrrr0)r:rzippathZnm)addToZiprrrUs   zmain.<locals>.addToZiprCr)rrrr)textwrapdedentryargvr^exitr.r ryr{rrrurrrrr)argsrZUSAGEr:Zbadfilerrr)rrmain'sT
  
 
 

  r__main__liiiii)N)rrrureimportlib.utilrryrrrrCZbinasciirO ImportErrorZdummy_threadingrr rr__all__    Exceptionrr rrrrrrrrrr{rrrrkrZrYrrXrIrJrKrLrMrNrOr^r_r`rcrerbrdZ_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_SIZErfrhriZ_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESrjrrrrZ_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_SIZErrrDrErBrGrHrFZ_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_CENTDIRr=ZStructr,r6r:r    rUr7objectr
rrrrrrrrrrrr2r r rrrrrr<module>sD 
  
 







+=[= &-J/
B


All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL