e9`SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r /SQr Sur r r rrSrSrSrSrS rS rS \R,-rS\SSS4S jrS r"SS5r"SS\5r"SS\R:5r"SS\R>5r Sr!Sr""SS\RF5r$\4SS.Sjjr%Sr&Sr'\(S:Xa\'"5 gg)zFunctions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.N) BadGzipFileGzipFileopencompress decompress)rbwbr ir cSU;aSU;a[SU<35eO*Ub [S5eUb [S5eUb [S5eURSS5n[U[[[ R 45(a [XU5nO;[US 5(d[US 5(a[SXbU5nO [S 5eSU;a-[R"U5n[R"XsXE5$U$) aOpen a gzip-compressed file in binary or text mode. The filename argument can be an actual filename (a str or bytes object), or an existing file object to read from or write to. The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is "rb", and the default compresslevel is 9. For binary mode, this function is equivalent to the GzipFile constructor: GzipFile(filename, mode, compresslevel). In this case, the encoding, errors and newline arguments must not be provided. For text mode, a GzipFile object is created, and wrapped in an io.TextIOWrapper instance with the specified encoding, error handling behavior, and line ending(s). tbzInvalid mode: Nz0Argument '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/imh/python3.13/lib/python3.13/gzip.pyrr!s( d{ $;49: :   OP P  MN N  NO Oll3#G(S%566x-@ 6 " "gh&@&@tWXF KLL d{##H- vGGcPUR[R"SU55 g)Nz\rSrSrSrS SjrSrS SjrSrSr Sr g ) _PaddedFileSzMinimal read-only file object that prepends a string to the contents of an actual file. Shouldn't be used outside of gzip.py, as it lacks essential functionality.cJX l[U5UlXlSUlgNr)_bufferlen_lengthfile_read)selffprepends r+__init___PaddedFile.__init__Xs 7|   r,cURcURRU5$URU-UR::a9URnU=RU- slURX R$URnSUlURUSURRXR- U-5-$N)r<r;rr:r8)r=sizers r+r_PaddedFile.read^s :: 99>>$' ' ::  ,::D JJ$ J<<ZZ0 0::DDJ<<&99>>$||"3D"89: :r,cURcXlOU=R[U5-slg[UR5UlSUlgr7)r<r8r9r:)r=r?s r+r?_PaddedFile.prependks= :: "L JJ#g, &J 4<<(  r,cTSUlSUlURRU5$rC)r<r8r;seek)r=offs r+rI_PaddedFile.seekts#  yy~~c""r,cgNTr=s r+seekable_PaddedFile.seekableyr,)r8r:r<r;N)r,) __name__ __module__ __qualname____firstlineno____doc__r@rr?rIrP__static_attributes__rNr,r+r4r4Ss   :# r,r4c\rSrSrSrSrg)r}z6Exception raised in some cases for invalid gzip files.rNN)rSrTrUrVrWrXrNr,r+rr}s@r,rc0\rSrSrSrSrSrSrSrSr g) _WriteBufferStreamz8Minimal object to pass WriteBuffer flushes into GzipFilec:[R"U5UlgrC)weakrefref gzip_file)r=ras r+r@_WriteBufferStream.__init__s Y/r,c`UR5nUc [S5eURU5$)Nzlost gzip_file)ra RuntimeError _write_raw)r=dataras r+r_WriteBufferStream.writes1NN$  /0 0##D))r,cg)NFrNrOs r+rP_WriteBufferStream.seekablesr,cgrMrNrOs r+writable_WriteBufferStream.writablerRr,)raN) rSrTrUrVrWr@rrPrkrXrNr,r+r\r\sB0* r,r\c^\rSrSrSrSrSS\SS4Sjr\S5r Sr Sr U4Sjr S r S rS rSS jrSS jrSr\S5rSrSr\R.4SjrSrSrSrSrSr\R>4Sjr SSjr!Sr"U=r#$)rzThe GzipFile class simulates most of the methods of a file object with the exception of the truncate() method. This class only supports opening files in binary mode. If you need to open a compressed file in text mode, use the gzip.open() function. NcU(a&SU;dSU;a[SRU55eU(a SU;aUS- nUc%[R"X=(d S5=o@lUc+[ USS5n[ U[[45(dSnO[R"U5nUnUc [ US S5nURS 5(a8[Ul [U5n[R "U5UlXlOURS 5(aUcS SKnUR)S [*S5 [,Ul UR/U5 [0R2"U[0R4[0R6*[0R8S 5UlXPl[>Ul [RB"[EU5UR@S9UlO[SRU55eX@l#UR[,:XaURIU5 gg! URK5 e=f)aConstructor for the GzipFile class. At least one of fileobj and filename must be given a non-trivial value. The new class instance is based on fileobj, which can be a regular file, an io.BytesIO object, or any other object which simulates a file. It defaults to None, in which case filename is opened to provide a file object. When fileobj is not None, the filename argument is only used to be included in the gzip file header, which may include the original filename of the uncompressed file. It defaults to the filename of fileobj, if discernible; otherwise, it defaults to the empty string, and in this case the original filename is not included in the header. The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or 'xb' depending on whether the file will be read or written. The default is the mode of fileobj if discernible; otherwise, the default is 'rb'. A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and 'wb', 'a' and 'ab', and 'x' and 'xb'. The compresslevel argument is an integer from 0 to 9 controlling the level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. 0 is no compression at all. The default is 9. The optional mtime argument is the timestamp requested by gzip. The time is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If mtime is omitted or None, the current time is used. Use mtime = 0 to generate a compressed stream that does not depend on creation time. rUzInvalid mode: {!r}rNr namerr$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$ _GzipReaderr BufferedReaderr8rqwarningswarn FutureWarningWRITE _init_writezlib compressobjDEFLATED MAX_WBITS DEF_MEM_LEVELr _write_mtime_WRITE_BUFFER_SIZE _buffer_sizeBufferedWriterr\fileobj_write_gzip_header_close) r=r#r$r%rmtimeorigmoderawrs r+r@GzipFile.__init__sH SD[C4K188>? ? CtO CKD2 +3==<4+PP."7FB7!(S%L99!H99X.H|w5s##  !'*!005 $ 11##MMP&q * "   * $ 0 01526..151C1C12 !4 %*!$6!!001CD1I=A=N=N P !!5!)reprrhexid)r=ss r+__repr__GzipFile.__repr__s8  !Ab'!C'#bh-7#==r,c~Xl[R"S5UlSUl/UlSUlSUlgNr,r)rqrcrc32crcrDwritebufbufsizeoffset)r=r#s r+rGzipFile._init_writes2 ::c?    r,ct>UR5 URR5 [TU]5$rC)_check_not_closedr8flushsupertellr= __class__s r+r GzipFile.tells+   w|~r,cfURRS5 URRS5 [RR UR 5n[ U[5(dURS5nURS5(aUSSnSnU(a[nURR[U5RS55 URnUc[R"5n[UR[!U55 U[":XaSnOU[$:XaS nOS nURRU5 URRS 5 U(aURRUS -5 gg![a SnGN f=f) Nzlatin-1s.gzr,r)rrrpathbasenamerqrrencodeendswithUnicodeEncodeErrorFNAMEchrrtimer2int_COMPRESS_LEVEL_BEST_COMPRESS_LEVEL_FAST)r=r%fnameflagsrxfls r+rGzipFile._write_gzip_headersP ;' 7# GG$$TYY/EeU++ Y/~~f%%cr  E 3u:,,Y78!! =IIKEs5z* 0 0C 2 2CC 3 7#  LL  uw / %" E sA*F F0/F0cUR5 UR[:waSSKn[ UR S5eUR c [S5eURRU5$)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object) rr$rerrnoOSErrorEBADFrrr8r)r=rfrs r+rGzipFile.write3sZ  99  %++'MN N << @A A||!!$''r,c[U[[45(a [U5nO[ U5nUR nUS:aUR RURRU55 U=RU- sl [R"XR5Ul U=RU- sl U$r7)rr bytearrayr9 memoryviewnbytesrrrrDrrrr)r=rflengths r+reGzipFile._write_raw>s dUI. / /YFd#D[[F A: LL  t}}55d; < II Izz$1DH KK6 !K r,cUR5 UR[:waSSKn[ UR S5eUR RU5$)Nrz$read() on write-only GzipFile object)rr$r}rrrr8rr=rDrs r+r GzipFile.readOsD  99  %++'MN N||  &&r,cUR5 UR[:waSSKn[ UR S5eUS:a[ RnURRU5$)z\Implements BufferedIOBase.read1() Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object) rr$r}rrrr DEFAULT_BUFFER_SIZEr8read1rs r+rGzipFile.read1VsX  99  %++'NO O !8))D||!!$''r,cUR5 UR[:waSSKn[ UR S5eUR RU5$)Nrz$peek() on write-only GzipFile object)rr$r}rrrr8peek)r=nrs r+r GzipFile.peekcsD  99  %++'MN N||  ##r,cURSL$rC)rrOs r+closedGzipFile.closedjs||t##r,c URnUbURR(agUR[:XaqURR 5 UR URR 55 [XR5 [XRS-5 O.UR[:XaURR5 UR5 g!UR5 f=f)N)rr8rr$rrrrr2rrDr}closer)r=rs r+rGzipFile.closens,, ?dll11  yyE! ""$ dmm1134((+))j"89d" ""$ KKMDKKMs B3C11Dc`SUlURnUbSUlUR5 ggrC)rryr)r=rys r+rGzipFile._close~s. NN  !DN OO  !r,cUR5 UR[:XaiURR 5 UR R URR U55 UR R 5 ggrC)rr$rr8rrrr)r= zlib_modes r+rGzipFile.flushs`  99  LL   LL  t}}229= > LL   r,c6URR5$)zInvoke the underlying file object's fileno() method. This will raise AttributeError if the underlying file object doesn't support fileno(). )rfilenorOs r+rGzipFile.filenos ||""$$r,cxUR[:wa [S5eURR S5 g)zSReturn the uncompressed stream file position indicator to the beginning of the filezCan't rewind in write moderN)r$r}rr8rIrOs r+rewindGzipFile.rewinds. 99 67 7 !r,c(UR[:H$rC)r$r}rOs r+readableGzipFile.readablesyyD  r,c(UR[:H$rC)r$rrOs r+rkGzipFile.writablesyyE!!r,cgrMrNrOs r+rPGzipFile.seekablerRr,cUR[:XaUR5 URR 5 U[ R :wa/U[ R:XaURU-nO [S5eXR:a [S5eXR- nSUR-n[X0R-5HnURU5 M URSX0R--5 UR$UR[:Xa+UR5 URRX5$UR$)NzSeek from end not supportedzNegative seek in write moder)r$rrr8rr SEEK_SETSEEK_CURrrrrrangerr}rI)r=rwhencecountchunkis r+rI GzipFile.seeks 99   " " $ LL   $R[[(![[61F$%BCC #;<<[[(ED---E5$5$556 5!7 JJu(9(9 9: ; {{ YY$   " " $<<$$V4 4{{r,cXUR5 URRU5$rC)rr8readline)r=rDs r+rGzipFile.readlines#  ||$$T**r,) r8rrrrrrr$ryrqrrDrr)$rSrTrUrVrWryrr@propertyrrrrrrrerrrrrrr Z_SYNC_FLUSHrrrrrkrPr rrIrrX __classcell__rs@r+rrsI $43T[z,,> 0@ ("' ($$$ "..!%!"#%++.++r,rcURU5n[U5U:aDURU[U5- 5nU(d [S5eX#- n[U5U:aMDU$)zqRead exactly *n* bytes from `fp` This method is required because fp may be unbuffered, i.e. return short reads. ACompressed file ended before the end-of-stream marker was reached)rr9EOFError)fprrfrs r+ _read_exactr sb 771:D d)a- GGAD M ">? ?  d)a- Kr,c4URS5nUS:XagUS:wa[SU-5e[R"S[ US55up#nUS:wa [S5eU[ -(a.[R"S [ US55un[ X5 U[ -(a"URS 5nU(aUS :XaOM!U[-(a"URS 5nU(aUS :XaOM!U[-(a [ US5 U$) zRead a gzip header from `fp` and progress to the end of the header. Returns last mtime if header was present or None otherwise. r r,NrzNot a gzipped file (%r)z[TU][U5[R[R *S9 SUlSUlg)NwbitsT)rr@r4r_ZlibDecompressorr _new_memberr)r=r rs r+r@_GzipReader.__init__s> R$*@*@ $  0 r,cH[R"S5UlSUlgr)rr_crc _stream_sizerOs r+ _init_read_GzipReader._init_readsJJsO r,cB[UR5nUcgXlg)NFT)r_fpr)r=rs r+r_GzipReader._read_gzip_headers"&txx0  %r,cUS:aUR5$U(dgURR(a8UR5 SUlUR "S0UR D6UlUR(a>UR5 UR5(dURUl gSUlURR(a;URR[5nURRX!5nOURRSU5nURR S:wa/URR#URR 5 US:waOWS:Xa [%S5eGMx[&R("X0R*5UlU=R,[/U5- slU=R[/U5- sl U$)Nrr,TFr rN)readall _decompressoreof _read_eofr_decomp_factory _decomp_argsr#r_pos_size needs_inputr&rREAD_BUFFER_SIZEr unused_datar?r rrr!r"r9)r=rDbuf uncompresss r+r_GzipReader.read s !8<<> ! !!%%  #' %)%9%9&)''&)"!--//!%DJ#( !!--hhmm$45!//::3E !//::3E !!--4  !3!3!?!?@S cz BCCGLJJz995  S_, S_$ r,c[R"S[URS55upXR:wa/[ S[ U5<S[ UR5<35eX RS-:wa [ S5eSnUS:Xa#URRS5nUS:XaM#U(aURRU5 gg) Ns }}UK!,DE  II SZ=@^MN N ((:5 6AB B 7l a A7l HH  Q  r,c0>[TU]5 SUlgrM)r_rewindrrs r+r>_GzipReader._rewindSs r,)r!r*rrr0r"r) rSrTrUrVr@r#rrr,r>rXrrs@r+r~r~s' 3j *  r,r~)rc[R"XSS9nUc[R"5n[R"SU[ U5USS5nXCSS-$)zCompress data in one shot and return the compressed string. compresslevel sets the compression level in range of 0-9. mtime can be used to set the modification time. The modification time is set to the current time by default. )levelrNz<4sLBBr )rrrr.r/r)rfr%r gzip_dataheaders r+rrXsS drBI } [[9c%j)A, LF bcN ""r,c/n[R"U5n[U5cSRU5$[R "[R *S9nURXR5S5nUR(a[UR5S:a [S5e[R"SURSS5upVU[R"U5:wa [!S5eU[U5S-:wa [!S 5eUR#U5 URSSR%S 5nGMF) zQDecompress a gzip compressed string in one shot. Return the decompressed string. Nr,rr r r8zCRC check failedrr9r)r BytesIOrjoinr decompressobjrrrr+r9r3r r.rrrappendlstrip)rfdecompressed_membersr do decompressedrrs r+rris  ZZ  R (8801 1   t~~o 6}}T'')*%56 vvR^^,q001 1mmE2>>"1+=>  $**\* *01 1 c,'*4 5AB B##L1~~ab!((1# r,cSSKJn U"SS9nUR5nURSSSS9 URS SS S9 URS S SS S9 URSSS/SS9 UR 5n[ nUR (a[nOUR(a[nURGHnUR(aUS:Xa>[SS[RRS9n[R RnOUSSS:wa[R""SU<35 [%US5n[&R$"USSS5nOkUS:Xa?[RRn[SS[R RUS9nO&[&R$"US5n[%US-S5nUR)[*5nU(dOUR-U5 M0U[R RLaUR/5 U[RRLdGMUR/5 GM g)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*-r;)nargsdefaultmetavarrr )r#r$rrz.gzzfilename doesn't end in .gz: r)r#r$rr%)argparserQadd_mutually_exclusive_group add_argument parse_args_COMPRESS_LEVEL_TRADEOFFfastrbestrrVrrsysstdinbufferstdoutexitrrxrr2rr) rQparsergrouprVr%argr>grs r+mainrls'  ,-F  / / 1E x ;LM x ;LM t^L>@ cC5&I    D,M yy, , yy ??czbtSYY=M=MNJJ%%rs8u$HHrts%  G(6%ufeX  ///,@tT+Z+ ''TA'A$k+|&&k+\  "J_ ,//_ D"6##"22.` zFr,