Qfa ddlZddlZddlZddlZddlZddlZddlZddlZgdZd\Z Z Z Z Z d\ZZdZdZdZdZd ej(zZd edddfd Zd ZGd dZGddeZGddej6ZGddej:ZdZdZ GddejBZ" d!de#de$fdZ%efdddZ&dZ'dZ(e)d k(re(yy)"N) BadGzipFileGzipFileopencompress decompress))rr r ir rbc d|vrd|vr5td|| td| td| td|jdd}t|ttt j frt|||}n2t|ds t|d rtd|||}n td d|vr-tj|}tj||||S|S) NtbzInvalid mode: z0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary modereadwritez1filename must be a str or bytes object, or a file) ValueErrorreplace isinstancestrbytesosPathLikerhasattr TypeErrorio text_encoding TextIOWrapper)filenamemode compresslevelencodingerrorsnewlinegz_mode binary_files +/opt/alt/python312/lib64/python3.12/gzip.pyrrs$ d{ $;49: :  OP P  MN N  NO Oll3#G(S%56x-@ 6 "gh&@tWmXF KLL d{##H- XvwGGcN|jtjd|y)Nz>$' ' ::  ,::D JJ$ J<<TZZ0 0::DDJ<<&99>>$t||"3D"89: :r+c|j||_n|xjt|zc_yt|j|_d|_yr5)r:r6r7r8)r;r=s r*r=z_PaddedFile.prependfs? :: "DL JJ#g, &J 4<<(  r+cTd|_d|_|jj|Sr@)r:r6r9seek)r;offs r*rDz_PaddedFile.seekos#  yy~~c""r+cyNTr;s r*seekablez_PaddedFile.seekabletr+N)r+)__name__ __module__ __qualname__r>rr=rDrJrHr+r*r3r3Ns   :# r+r3c eZdZy)rN)rLrMrNrHr+r*rrxs@r+rc&eZdZ dZdZdZdZy)_WriteBufferStreamc||_yr@) gzip_file)r;rSs r*r>z_WriteBufferStream.__init__~s "r+c8|jj|Sr@)rS _write_raw)r;datas r*rz_WriteBufferStream.writes~~((..r+cy)NFrHrIs r*rJz_WriteBufferStream.seekablesr+cyrGrHrIs r*writablez_WriteBufferStream.writablerKr+N)rLrMrNr>rrJrYrHr+r*rQrQ|sB#/r+rQceZdZ dZddeddfdZedZdZdZ fdZ dZ dZ d Z dd Zdd Zd Zed ZdZej(fdZdZdZdZdZdZej8fdZddZxZS)rNc |r"d|vsd|vrtdj||r d|vr|dz }|!tj||xsdx}|_|&t |dd}t |ttfsd}ntj|}|}| t |dd}|jd r8t|_ t|}tj ||_||_n|jd r|d dl}|j)d t*d t,|_ |j/|t1j2|t0j4t0j6 t0j8d |_||_t>|_ tjBtE||j@|_ntdj|||_#|jt,k(r|jI|yy)NrUzInvalid mode: {!r}rrnamerr#r)waxrzGzipFile was opened for writing, but this will change in future Python releases. Specify the mode argument for opening it for writing.r ) buffer_size)%rformatbuiltinsr myfileobjgetattrrrrrfspath startswithREADr# _GzipReaderrBufferedReaderr6r]warningswarn FutureWarningWRITE _init_writezlib compressobjDEFLATED MAX_WBITS DEF_MEM_LEVELr _write_mtime_WRITE_BUFFER_SIZE _buffer_sizeBufferedWriterrQfileobj_write_gzip_header) r;r"r#r$rzmtimeorigmoderawrls r*r>zGzipFile.__init__s B SD[C4K188>? ? CtO CKD ?'/}}Xt|t'L LGdn  w3Hhe 5yy*H <7FD1D ??3 DIg&C,,S1DL DI ___ - L"1 & DI   X & ,,]-1]].2nn_-1-?-?-. 0DM !&D  2D ,,-?-E9=9J9JLDL188>? ? 99   # #M 2 r+cD |jjjSr@)r6r~ _last_mtimerIs r*r|zGzipFile.mtimes>||+++r+crt|j}d|ddzdztt|zdzS)Nz)reprrzhexid)r;ss r*__repr__zGzipFile.__repr__s8  !Ab'!C'#bh-7#==r+c~||_tjd|_d|_g|_d|_d|_yNr+r)r]rqcrc32crcrAwritebufbufsizeoffset)r;r"s r*rpzGzipFile._init_writes4 ::c?    r+ct|j|jjt|Sr@)_check_not_closedr6flushsupertellr; __class__s r*rz GzipFile.tells+   w|~r+c2|jjd|jjd tjj |j }t |ts|jd}|jdr|dd}d}|rt}|jjt|jd|j}|tj}t|jt!||t"k(rd}n|t$k(rd }nd }|jj||jjd |r|jj|d zyy#t$rd}YwxYw) Nzlatin-1s.gzr+r)rzrrpathbasenamer]rrencodeendswithUnicodeEncodeErrorFNAMEchrrvtimer1int_COMPRESS_LEVEL_BEST_COMPRESS_LEVEL_FAST)r;r$fnameflagsr|xfls r*r{zGzipFile._write_gzip_headersJ ;' 7# GG$$TYY/EeU+ Y/~~f%cr  E 3u:,,Y78!! =IIKEs5z* 0 0C 2 2CC 3 7#  LL  uw / %" E sA F FFc|j|jtk7rddl}t |j d|j td|jj|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object) rr#roerrnoOSErrorEBADFrzrr6r)r;rVrs r*rzGzipFile.write#sZ  99  %++'MN N << @A A||!!$''r+ct|ttfr t|}nt |}|j }|dkDr|j j|jj||xj|z c_ tj||j|_ |xj|z c_ |Sr5)rr bytearrayr7 memoryviewnbytesrzrrrArqrrr)r;rVlengths r*rUzGzipFile._write_raw.s dUI. /YFd#D[[F A: LL  t}}55d; < II Izz$1DH KK6 !K r+c|j|jtk7rddl}t |j d|j j|S)Nrz$read() on write-only GzipFile object)rr#rirrrr6rr;rArs r*rz GzipFile.read?sD  99  %++'MN N||  &&r+c |j|jtk7rddl}t |j d|dkrt j}|jj|S)Nrz%read1() on write-only GzipFile object) rr#rirrrrDEFAULT_BUFFER_SIZEr6read1rs r*rzGzipFile.read1Fs^ E  99  %++'NO O !8))D||!!$''r+c|j|jtk7rddl}t |j d|j j|S)Nrz$peek() on write-only GzipFile object)rr#rirrrr6peek)r;nrs r*rz GzipFile.peekSsD  99  %++'MN N||  ##r+c|jduSr@)rzrIs r*closedzGzipFile.closedZs||t##r+cH|j}|y |jtk(rs|jj |j |j j t||jt||jdzn-|jtk(r|jjd|_|j}|rd|_ |jyy#d|_|j}|rd|_ |jwwxYw)N) rzr#ror6rrrr1rrAriclosere)r;rzres r*rzGzipFile.close^s,, ?  "yyE! ""$ dmm1134$((+$))j"89d" ""$DLI!%! DLI!%!s B3C22/D!c|j|jtk(ri|jj |j j |jj ||j j yyr@)rr#ror6rrzrr)r; zlib_modes r*rzGzipFile.flushrs`  99  LL   LL  t}}229= > LL   r+c8 |jjSr@)rzfilenorIs r*rzGzipFile.filenozs ||""$$r+cx |jtk7r td|jj dy)NzCan't rewind in write moder)r#rirr6rDrIs r*rewindzGzipFile.rewinds1 ! 99 67 7 !r+c(|jtk(Sr@)r#rirIs r*readablezGzipFile.readablesyyD  r+c(|jtk(Sr@)r#rorIs r*rYzGzipFile.writablesyyE!!r+cyrGrHrIs r*rJzGzipFile.seekablerKr+c|jtk(r|j|jj |t j k7r.|t jk(r|j|z}n td||jkr td||jz }d|jz}t||jzD]}|j||jd||jzz|jS|jtk(r,|j|jj||S|jS)NzSeek from end not supportedzNegative seek in write moder)r#rorr6rrSEEK_SETSEEK_CURrrrrxrangerrirD)r;rwhencecountchunkis r*rDz GzipFile.seeks 99   " " $ LL   $R[[(![[61F$%BCC #;<<T[[(ED---E5D$5$556 5!7 JJu(9(9 9: ; {{ YY$   " " $<<$$VV4 4{{r+cX|j|jj|Sr@)rr6readline)r;rAs r*rzGzipFile.readlines#  ||$$T**r+r) rLrMrNrerr>propertyr|rrprr{rrUrrrrrrq Z_SYNC_FLUSHrrrrrYrJrrrDr __classcell__rs@r*rrsI $43TS3j,,> 0@ ("' ($$$"("..!%!"#%++.+r+rc |j|}t||kr>|j|t|z }|s td||z }t||kr>|S)NACompressed file ended before the end-of-stream marker was reached)rr7EOFError)fprrVrs r* _read_exactrsi 771:D d)a- GGAD M ">? ?   d)a- Kr+c |jd}|dk(ry|dk7rtd|ztjdt |d\}}}|dk7r td|t zr.tjdt |d\}t |||t zr |jd }|r|d k(rn|tzr |jd }|r|d k(rn|tzr t |d|S) Nr r+rzNot a gzipped file (%r)zr3rq_ZlibDecompressorrt _new_memberr)r;rrs r*r>z_GzipReader.__init__s> R$*@*@ $  0 r+cFtjd|_d|_yr)rqr_crc _stream_sizerIs r* _init_readz_GzipReader._init_readsJJsO r+cBt|j}|y||_y)NFT)r_fpr)r;rs r*rz_GzipReader._read_gzip_headers$&txx0  %r+c|dkr|jS|sy |jjr8|jd|_|j di|j |_|jr9|j|js|j|_ yd|_|jjr<|jjt}|jj||}n|jjd|}|jj dk7r/|jj#|jj |dk7rndk(r t%dat'j(||j*|_|xj,t/|z c_|xjt/|z c_ |S)Nrr+TFrrH)readall _decompressoreof _read_eofr_decomp_factory _decomp_argsrr_pos_size needs_inputrrREAD_BUFFER_SIZEr unused_datar=rrqrrrr7)r;rAbuf uncompresss r*rz_GzipReader.reads !8<<> ! !!%%  #' %9T%9%9&)''&)"!--/!%DJ#( !!--hhmm$45!//::3E !//::3E !!--4  !3!3!?!?@S cz BCCGLJJz4995  S_, S_$ r+ctjdt|jd\}}||jk7r-t dt |dt |j||jdzk7r t dd}|dk(r!|jjd}|dk(r!|r|jj|yy) Nrrrrr rrs@r*rjrjs' 3j *  r+rjr$returnc  |tj}|tk(rd}n|tk(rd}nd}tjdddddt ||dS) Nr r rz>"1+=> V $**\* *01 1 c,'*4 5AB B##L1~~ab!((1# r+cddlm}|d}|j}|jddd|jd dd |jd d dd |jdddgd|j }t }|j rt}n|jrt}|jD]}|jr|dk(rAtddtjj}tj j}n|dddk7rtj"d|t%|d}t'j$|ddd}nl|dk(rBtjj}tddtj j|}n%t'j$|d}t%|dzd} |j)t*}|sn|j-|*|tj jur|j/|tjjus}|j/y)Nr)ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.) descriptionz--fast store_truezcompress faster)actionhelpz--bestzcompress betterz-dz --decompresszact like gunzip instead of gzipargs*-r9)nargsdefaultmetavarrr)r"r#rzrz.gzzfilename doesn't end in .gz: wb)r"r#rzr$)argparser"add_mutually_exclusive_group add_argument parse_args_COMPRESS_LEVEL_TRADEOFFfastrbestrr'rrsysstdinbufferstdoutexitrrdrrrr) r"parsergroupr'r$argr<grs r*mainr>s'  ,-F  / / 1E x ;LM x ;LM t^L>@ cC5&I    D,M yy, , yy ??czbtSYY=M=MNJJ%%rs8u$HHrLrHr+r*rFs)%   G(6%ufeX e///,@tT+Z+ ''TA'A  `+|&&`+F  "J_ ,//_ F(,KcK05K*"6$22.` zFr+