U+#6 SrSrSrSrSSKJr SSKrSSKrSSK r SSK r SSK r SSK r SSK r SSKrSSKrSSKrSSKr\\\4r/SQrSrS r\S -rS rS rS rS rSrSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1\1r2\ \!\"\#\&\'\(\$\%\)\*\+4 r3\ \!\(\+4r4\)\*\+4r5Sr61S kr7\8\8\8\9\9\9S!.r:\RvS":XaS#rS%r?S&r@S'\24S(jrAS)rBS\S4S*jrCS+rD"S,S-\E5rF"S.S/\F5rG"S0S1\F5rH"S2S3\F5rI"S4S5\F5rJ"S6S7\F5rK"S8S9\K5rL"S:S;\K5rM"S<S=\K5rN"S>S?\K5rO"S@SA\K5rP"SBSC5rQ"SDSE5rR"SFSG\S5rT"SHSI\S5rU"SJSK\ R5rW"SLSM\F5rX"SNSO\X5rY"SPSQ\X5rZ"SRSS\X5r["STSU\X5r\"SVSW\X5r]"SXSY\X5r^\X\\G4r_SgSZjr`S[raS\rbS]rc\a\b\cS^.rd\S"5re\R"S_5rg"S`Sa\S5rh"SbSc\S5riSdrj\iR rSerk\lSf:Xa\k"5 gg!\a SrGN*f=f!\a SrGN4f=f)hz,Read from and write to tar format archives. z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.)openN)TarFileTarInfo is_tarfileTarError ReadErrorCompressionError StreamError ExtractError HeaderErrorENCODING USTAR_FORMAT GNU_FORMAT PAX_FORMATDEFAULT_FORMATrfully_trusted_filter data_filter tar_filter FilterErrorAbsoluteLinkErrorOutsideDestinationErrorSpecialFileErrorAbsolutePathErrorLinkOutsideDestinationErrorLinkFallbackErrorisustar sustar00d01234567LKSxgX)pathlinkpathsizemtimeuidgidunamegname>r0r7r6r1)atimectimer3r4r5r2ntutf-8cvUc [S5eURX#5nUSUU[U5- [--$)z8Convert a string to a null-terminated bytes object. Nzmetadata cannot contain None) ValueErrorencodelenNUL)slengthencodingerrorss ./opt/alt/python313/lib64/python3.13/tarfile.pystnrFsA y788 "A Wf:#a&C/ //c\URS5nUS:waUSUnURX5$)z8Convert a null-terminated bytes object to a string. rN)finddecode)rArCrDps rEntsrMs2 u ABw bqE 88H %%rGcJUSS;aOSn[[U5S- 5HnUS-nXUS-- nM USS:XaS[U5S- -U- *nU$[USS5n[UR 5=(d S S5nU$![ a [ S 5ef=f) z/Convert a number field to a python number. r)r.rPasciistrict0invalid header)ranger?rMintstripr=InvalidHeaderError)rAnis rEntir]s  t~ s1vz"A !GA 1q5MA# Q45=#a&1*%)*A H  7Aw)AAGGI$a(A H 7$%56 6 7s 0B B"rQcUn[U5nSUs=::a SUS- -:a O O[SUS- U4-S5[-nU$U[:XauSUS- -*Us=::a SUS- -:a[O OXUS:a [ S/5nO[ S/5nSU-U-n[ US- 5HnUR SUS-5 US-nM U$[S 5e) z/Convert a python number to a number field. rrQr.z%0*orSrRrOrPzoverflow in number field)rXbytesr@r bytearrayrWinsertr=)r[digitsformat original_nrAr\s rEitnresJ AAA!fqj!! &FQJ?*G 4s : H : 36A:#6"6!"Qcfqj>Q"Q 65'"A5'"Av !Avz"A HHQE " !GA# H344rGcS[[R"SU55-nS[[R"SU55-nX4$)azCalculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. rR 148B8x356B 148b8x356b)sumstruct unpack_from)bufunsigned_chksum signed_chksums rE calc_chksumsrosEC 2 2< EFFO#f00sCDDM  ))rGcU=(d SnUS:XagUc[R"XU5 g[X$5upV[U5H<nUR U5n[ U5U:aU"S5eUR U5 M> US:wa9UR U5n[ U5U:aU"S5eUR U5 g)z_Copy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. i@rNunexpected end of data)shutil copyfileobjdivmodrWreadr?write) srcdstrB exceptionbufsizeblocks remainderbrls rErsrss"G { ~3W-v/F 6]hhw s8g 45 5 #  A~hhy! s8i 45 5 # rGc[[RSS5nUb!URUS5R U5n[ USS9 g)NrCbackslashreplace )end)getattrsysstdoutr>rKprint)rArCs rE _safe_printrs@szz:t4H HHX1 2 9 9( C !rGc\rSrSrSrSrg)ri zBase exception.N__name__ __module__ __qualname____firstlineno____doc____static_attributes__rrGrErr srGrc\rSrSrSrSrg)r iz%General exception for extract errors.rNrrrGrEr r s/rGr c\rSrSrSrSrg)riz&Exception for unreadable tar archives.rNrrrGrErrs0rGrc\rSrSrSrSrg)r iz.Exception for unavailable compression methods.rNrrrGrEr r s8rGr c\rSrSrSrSrg)r iz=Exception for unsupported operations on stream-like TarFiles.rNrrrGrEr r sGrGr c\rSrSrSrSrg)r iz!Base exception for header errors.rNrrrGrEr r s+rGr c\rSrSrSrSrg)EmptyHeaderErrorizException for empty headers.rNrrrGrErrs&rGrc\rSrSrSrSrg)TruncatedHeaderErrori"z Exception for truncated headers.rNrrrGrErr"s*rGrc\rSrSrSrSrg)EOFHeaderErrori%z"Exception for end of file headers.rNrrrGrErr%s,rGrc\rSrSrSrSrg)rZi(zException for invalid headers.rNrrrGrErZrZ(s(rGrZc\rSrSrSrSrg)SubsequentHeaderErrori+z3Exception for missing and invalid extended headers.rNrrrGrErr+s=rGrc0\rSrSrSrSrSrSrSrSr g) _LowLevelFilei2zwLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. c[R[R[R-[R-S.Un[ [S5(aU[R -n[R"XS5Ulg)NrwO_BINARYi) osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrrrfd)selfnamemodes rE__init___LowLevelFile.__init__8sbrzz)BJJ6   2z " " BKK D''$e,rGcD[R"UR5 gN)rcloserrs rEr_LowLevelFile.closeAs rGcD[R"URU5$r)rrurrr2s rEru_LowLevelFile.readDswwtww%%rGcF[R"URU5 gr)rrvrrrAs rErv_LowLevelFile.writeGs !rG)rN) rrrrrrrrurvrrrGrErr2s -&rGrcd\rSrSrSrSrSrSrSrSr Sr S r S r SS jr S rS rSrSrg)_StreamiJaClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method that works with bytes, and the method is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin.buffer, sys.stdout.buffer, a socket, a tape device etc. _Stream is intended to be used only internally. c:SUlUc[X5nSUlUS:Xa[U5nUR5nU=(d SUlX lX0lX@lXPlSUl SUl SUl US:Xa[SSK nXpl URS5UlUS :Xa"UR"UlUR'5 gUR)U5 gUS :XaJSSKnUS :Xa(SUlUR/5Ul[2UlgUR5U5UlgUS :XaOSSKn US :Xa.SUlU R95UlU R:UlgU R=5UlgUS:wa[SU-5eg![a [S 5Sef=f![a [S 5Sef=f![a [S5Sef=f! UR(dURR?5 SUl e=f)z$Construct a _Stream object. TNF*rGrgzzzlib module is not availablerbz2bz2 module is not availablexzlzma module is not availabletarunknown compression type %r) _extfileobjr _StreamProxy getcomptyperrcomptypefileobjrzrlposclosedzlib ImportErrorr crc32crcerrorry _init_read_gz_init_write_gzrdbufBZ2DecompressorcmpOSError BZ2CompressorlzmaLZMADecompressor LZMAErrorLZMACompressorr) rrrrrrz compresslevelrrrs rEr_Stream.__init__Vs  ?#D/G$D  s?#7+G**,H       - 4U! ::c?3;%)ZZDN&&('' 6U"T3; #DI"224DH%,DN"00?DHT!U3; #DI#446DH%)^^DN#224DHU"&'Dx'OPP#E#U*+IJPTTU#T*+HItST#U*+IJPTTU ## ""$DK sy<G%FAG% G%G%$F1(-G%G%-G%4G 83G%,G%G%F..G%1GG% G""G%%5Hcl[US5(a#UR(dUR5 ggg)Nr)rrrrs rE__del___Stream.__del__s& 4 " "4;; JJL,7 "rGcURRUURRURR*URRS5Ul[ R"S[[R"555nURSU-S-5 URRS5(aURSSUl [RRUR5Ul URURR!SS 5["-5 g) z6Initialize for writing with gzip compression. rr@)rr timestamps rEr_Stream._init_write_gzs99(()-););*.))*=*=)=)-)@)@)* , KKc$))+&67  (94{BC 99  e $ $ #2DIGG$$TYY/  TYY%%lI>DErGc,URS:Xa*URRXR5UlU=R[ U5- slURS:waUR RU5nURU5 g)z&Write string s to the stream. rrN) rrrrrr?rcompressrrs rErv _Stream.writese ==D yyq((3DH CF ==E !!!!$A QrGc`U=RU- sl[UR5UR:avURR URSUR5 URURSUl[UR5UR:aMugg)zJWrite string s to the stream if a whole new block is ready to be written. N)rlr?rzrrvrs rE__write_Stream.__writesr A $((mdll* LL  txx 6 7xx .DH$((mdll*rGc4UR(agSUlURS:Xa=URS:wa-U=RURR 5- slURS:XaUR(aUR RUR5 SUlURS:XawUR R[R"SUR55 UR R[R"SURS-55 UR(dUR R5 gg!UR(dUR R5 ff=f) zHClose the _Stream object. No operation should be done on it afterwards. NTrrrGrrl)rrrrlrflushrrvrjrrrrrrs rEr _Stream.closes  ;;   %yyCDMMU$:DHHNN,,yyCDHH ""488,==D(LL&&v{{4'BCLL&&v{{4J9N'OP## ""$$4## ""$$s D!E)).FcURRURR*5UlSUlUR S5S:wa [ S5eUR S5S:wa [S5e[UR S55nUR S5 US -(aI[UR S55S [UR S55--nURU5 US -(a&UR S5nU(a U[:XaOM%US -(a&UR S5nU(a U[:XaOM%US-(aUR S5 g g )z:Initialize for reading a gzip compressed fileobj. rGr/snot a gzip filer.zunsupported compression methodrRrQN) r decompressobjrrr _Stream__readrr ordrur@)rflagxlenrAs rEr_Stream._init_read_gzs+99**DII,?,?+?@  ;;q>[ (-. . ;;q>W $"#CD D4;;q>" A !8t{{1~&s4;;q>/B)BBD IIdO !8KKNAH "9KKNAH !8 KKN rGcUR$)z3Return the stream's file pointer position. )rrs rEtell _Stream.tells xxrGcXR- S:an[XR- UR5up#[U5HnUR UR5 M UR U5 UR$[ S5e)zESet the stream's file pointer to pos. Negative seeking is forbidden. rz seeking backwards is not allowed)rrtrzrWrur )rrr{r|r\s rEseek _Stream.seeksn >Q  &sXX~t|| D F6] $,,'# IIi xx@A ArGcdURU5nU=R[U5- slU$)z5Return the next size number of bytes from the stream.)_readrr?)rr2rls rEru _Stream.read s)jj CH rGc@URS:XaURU5$[UR5nUR/nX!:aUR(aURnSUlO-UR R UR5nU(dOBURRU5nURU5 U[U5- nX!:aMSRU5nX1SUlUSU$!URan[S5UeSnAff=f)z+Return size bytes from the stream. rrGzinvalid compressed dataN)rrr?rrlrrurzr decompressryrappendjoin)rr2ctrles rEr _Stream._reads ==E !;;t$ $  N YYKhxxhhll'' 5 Bhh))#. HHSM SMAh HHQKeH $x >> B 9:A BsC<<D DDc4[UR5nUR/nX!:aSURRUR5nU(dO&UR U5 U[U5- nX!:aMSSR U5nX1SUlUSU$)z`Return size bytes from stream. If internal buffer is empty, read another block from the stream. rGN)r?rlrrurzrr)rr2rrrls rE__read_Stream.__read.s M XXJh,,##DLL1C HHSM SMA h HHQKU8$xrG)rrlrzrrrrrryrrrrrN)r)rrrrrrrrrvrrrr r rurrrrrGrErrJsF ENF"/%,> 6rGrc0\rSrSrSrSrSrSrSrSr g) ri?zhSmall proxy class that enables transparent compression detection for the Stream interface (mode 'r|*'). cXXlURR[5Ulgr)rru BLOCKSIZErl)rrs rEr_StreamProxy.__init__Ds <<$$Y/rGcPURRUlUR$r)rrurlrs rEru_StreamProxy.readHsLL%% xxrGcURRS5(agURSSS:XaURSSS:Xag URRS 5(ag g ) NsrrsBZhr s1AY&SYr)s]s7zXZrr)rl startswithrs rEr_StreamProxy.getcomptypeLs\ 88   / / XXa]f $!B9)D XX !C D DrGc8URR5 gr)rrrs rEr_StreamProxy.closeVs rG)rlrruN) rrrrrrrurrrrrGrErr?s0rGrc\rSrSrSrSSjrSr\S5rSr Sr S r S r \ R4S jrSS jrS rSrSrg) _FileInFilei]zmA thin wrapper around an existing file object that provides a part of its data as an individual file object. NcXlX lX0lSUlX@lSUlUcSU4/nSUl/UlSnURnUHQup#X&:aURRSXbS45 URRSX"U-U45 Xs- nX#-nMS X`R:a)URRSX`RS45 gg)NrFT) roffsetr2positionrr map_indexmapr)rrr-r2r blockinfolastposrealposs rEr_FileInFile.__init__cs       T I++%LF >? HHOOT6D='B C OGmG & YY  HHOOUGYY= > rGcgrrrs rEr_FileInFile.flush|s rGcg)Nrbrrs rEr_FileInFile.modesrGcgNTrrs rEreadable_FileInFile.readablesrGcgNFrrs rEwritable_FileInFile.writablesrGc6URR5$r)rseekablers rErC_FileInFile.seekables||$$&&rGcUR$)z*Return the current file position. )r.rs rEr _FileInFile.tell}}rGc8U[R:Xa1[[US5UR5UlUR $U[R :XaeUS:a*[UR U-S5UlUR $[UR U-UR5UlUR $U[R:Xa>[[URU-UR5S5UlUR $[S5e)z(Seek to a position in the file. rzInvalid argument) ioSEEK_SETminmaxr2r.SEEK_CURSEEK_ENDr=)rr.whences rEr _FileInFile.seeks R[[ Ha 0$)) rGr+c(^\rSrSrU4SjrSrU=r$) ExFileObjectic>[URURURURUR 5n[ TU]U5 gr)r+r offset_datar2rsparsesuperr)rtarfiletarinfor __class__s rErExFileObject.__init__s;goow/B/B gllGNN< !rGrrrrrrr __classcell__rds@rEr]r]s ""rGr]c\rSrSrSrg)rirN)rrrrrrrGrErrsrGrc(^\rSrSrU4SjrSrU=r$)ricN>Xl[TU] SUR<S35 g)Nzmember z has an absolute pathrcrarrrrcrds rErAbsolutePathError.__init__s$  77<<"22GHIrGrcrfrhs@rErrsJJrGrc(^\rSrSrU4SjrSrU=r$)ricf>XlX l[TU] UR<SU<S3S-5 g)Nz would be extracted to , which is outside the destinationrc_pathrarrrrcr0rds rEr OutsideDestinationError.__init__s7   GLL++B4("M=> ?rGrurcrfrhs@rErr ??rGrc(^\rSrSrU4SjrSrU=r$)ricL>Xl[TU] UR<S35 g)Nz is a special filerlrms rErSpecialFileError.__init__s"  GLL++=>?rGrorfrhs@rErrs@@rGrc(^\rSrSrU4SjrSrU=r$)ricL>Xl[TU] UR<S35 g)Nz is a link to an absolute pathrlrms rErAbsoluteLinkError.__init__s"  GLL++IJKrGrorfrhs@rErrsLLrGrc(^\rSrSrU4SjrSrU=r$)ricf>XlX l[TU] UR<SU<S3S-5 g)Nz would link to rrrsrtrvs rEr$LinkOutsideDestinationError.__init__s6   GLL+?4("E=> ?rGrxrfrhs@rErrryrGrc(^\rSrSrU4SjrSrU=r$)ricj>XlX l[TU] SUR<S3SU<S3-5 g)Nzlink z would be extracted as a zcopy of z, which was rejectedrtrvs rErLinkFallbackError.__init__s?   5 00IJ%dX-ABC DrGrxrfrhs@rErrsDDrGrc0nURn[RRU[RRS9nUR S[R 45(a0URRS[R -5=oCS'[RRU5(a [U5e[RR[RRX5[RRS9n[RRXQ/5U:wa [X5eURnUbUS-nU(awUR5(dUR5(aUS-(dUS-nUS-nO8UR!5(dUR#5(aSnO [%U5eX`R:waXcS'U(GaUR&bSUS 'UR(bSUS 'UR*bSUS 'UR,bSUS 'UR5(dUR#5(Gab[RRUR.5(a [1U5e[RR3UR.5nXpR.:waXsS 'UR#5(aI[RRU[RR5U5UR.5nO*[RRUUR.5n[RRU[RRS9n[RRXQ/5U:wa [7X5eU$)N)rT/ri@irr4r5r6r7linkname)rrr0realpath ALLOW_MISSINGr&seplstripisabsrr commonpathrrisregislnkisdirissymrr4r5r6r7rrnormpathdirnamer)member dest_pathfor_data new_attrsr target_pathr normalizeds rE_get_filtered_attrsrsI ;;D  2773H3H II RVV}%%#);;#5#5cBFFl#CC  ww}}T ''''""277<< #@*,''*?*?#AK ww;23y@%f:: ;;D e| ||~~e|FND 6<<>>'v.. ;;  $f  :: !#Ie  :: !#Ie  << #!%Ig  << #!%Ig  <<>>V\\^^ww}}V__--'//))&//:J__,(2*%||~~ ggll9+-77??4+@+1??< !ggll9+1??< ''**;24''2G2G+IKww!!;":;yH1&FF rGcU$rr)rrs rErrFs MrGcX[XS5nU(aUR"S0UDSS0D6$U$)NFdeeprrrrrrs rErrIs-#Fu=I~~6 666 MrGcX[XS5nU(aUR"S0UDSS0D6$U$)NTrFrrrs rErrOs-#Ft5r\S?5r\S@5r\SA5r SBr!SCr"SDr#SEr$SFr%SGr&SHr'SIr(SJr)SKr*SLr+SMr,SNr-SOr.SPr/SQr0SRr1SSr2STr3SUr4SVr5SWr6g&)ZriezInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. rzName of the archive member.rzPermission bits.r4z6User ID of the user who originally stored this member.r5z7Group ID of the user who originally stored this member.r2zSize in bytes.r3zTime of last modification.chksumzHeader checksum.typezFile type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.rzcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.r6z User name.r7z Group name.devmajorzDevice major number.devminorzDevice minor number.r-zThe tar header starts here.r_zThe file's data starts here. pax_headerszMA dictionary containing key-value pairs of an associated pax extended header.r`zSparse member information._tarfileN_sparse_structs _link_targetcXlSUlSUlSUlSUlSUlSUl[UlSUl SUl SUl SUl SUl SUlSUlSUl0Ulg)zEConstruct a TarInfo object. name is the optional name of the member. irrN)rrr4r5r2r3rREGTYPErrr6r7rrr-r_r`rrrs rErTarInfo.__init__s{             rGcLSSKnURS[SS9 UR$NrzhThe undocumented "tarfile" attribute of TarInfo objects is deprecated and will be removed in Python 3.16r/ stacklevelwarningswarnDeprecationWarningr)rrs rErbTarInfo.tarfiles-  A 1  .}}rGcBSSKnURS[SS9 Xlgrr)rrbrs rErbrs(  A 1  . rGcUR$)z(In pax headers, "name" is called "path".rrs rEr0 TarInfo.pathsyyrGcXlgrrrs rEr0rs rGcUR$)z0In pax headers, "linkname" is called "linkpath".rrs rEr1TarInfo.linkpathrGrGcXlgrr)rrs rEr1rs rGc`SURRUR[U54-$)Nz<%s %r at %#x>)rdrridrs rE__repr__TarInfo.__repr__s&4>>#:#:499RX"NNNrGT) rr3rrr4r5r6r7r_KEEPc U (a[R"U5n O[R"U5n XLaXlX*LaX+lX:LaX;lXJLaXKlXZLaX[lXjLaXklXzLaX{lXLaXl U $)zGReturn a deep copy of self with the given attributes replaced. ) copydeepcopyrr3rrr4r5r6r7) rrr3rrr4r5r6r7rrresults rErTarInfo.replaces ]]4(FYYt_F  K   L  K  &O  J  J   L   L rGcURcSnOURS-nURUURURURUR UR URURURURURURS. nUS[:Xa&USRS5(d US==S- ss'U$)z9Return the TarInfo's attributes as a dictionary. N) rrr4r5r2r3rrrr6r7rrrrr)rrr4r5r2r3rrrr6r7rrDIRTYPEr)rrinfos rEget_infoTarInfo.get_infos 99 D99v%D            <7 "4<+@+@+E+E LC L rGsurrogateescapec2UR5nUR5HupVUbM [SU-5e U[:XaUR XBU5$U[ :XaUR XBU5$U[:XaURXB5$[S5e)z LENGTH_LINKr= LENGTH_NAME_posix_split_name_create_headerr)rrrCrDs rErTarInfo.create_ustar_headers$W tJ&&x8 9K G34 4 tF|""84 5 C+/+A+A$v,PX+a (DNDL""4xHHrGcN[US'Sn[USRX#55[:aX@R US[ X#5- n[USRX#55[ :aX@R US[X#5- nX@RU[X#5-$)z:Return the object as a GNU header block sequence. rrGrr) GNU_MAGICr?r>r_create_gnu_long_headerGNUTYPE_LONGLINKrGNUTYPE_LONGNAMErr)rrrCrDrls rErTarInfo.create_gnu_headers"W  tJ&&x8 9K G //Z0@BRT\e eC tF|""84 5 C //V >NPXa aC((z8LLLrGc[US'URR5nSS[4SS[4SS4H;upEnXS;aM XR SS 5 [X5U:dM5XX5'M= S HuupGS nXn [U [5n U (a [U 5OU n S U s=::a S US- -:d O S X'SnO U (aXU'SnU(dMaXC;dMh[U 5X4'Mw U(aURU[U5n OSn XRU[SS5-$![ a XX5'GM f=f)zReturn the object as a ustar header block. If it cannot be represented this way, prepend a pax extended header sequence with supplement information. rrr0rr1)r6r6 )r7r7rrSrT))r4rQ)r5rQ)r2 )r3rFrrQr.TrGr)rrrrrr>UnicodeEncodeErrorr? isinstancefloatroundstr_create_pax_generic_headerXHDTYPErr) rrrCrrhnamerBrb needs_paxval val_is_floatval_intrls rErTarInfo.create_pax_header+sb $W &&++- - J /T&(>$@ D#  !!'84 4:'%)Z "!$@(RLDI*C%c51L$0eCjcG3! "33  %T  yT4$'H !%R* 11+wQCC((|WiPPPG& %)Z " sD--EEc0URU[S5$)zAReturn the object as a pax global header block sequence. r;)rXGLTYPE)clsrs rEcreate_pax_global_header TarInfo.create_pax_global_headeres--k7GLLrGcTURS5n[S[U55HtnSRUSU5nSRXES5n[UR X#55[ ::dMN[UR X#55[ ::dMr Xa4$ [S5e)zBSplit a name longer than 100 chars into a prefix and a name part. rr.Nzname is too long)splitrWr?rr> LENGTH_PREFIXrr=)rrrCrD componentsr\rs rErTarInfo._posix_split_nameksZZ_ q#j/*AXXj!n-F88JrN+D6==23}D H56+E|+/0 0rGcjURS5[[4;nU(a;[URSS5SU5n[URSS5SU5nO[ SSX#5n[ SSX#5nURS[ 5nUc [ S5e[ URS S5S X#5[URS S5S -SU5[URS S5SU5[URSS5SU5[URSS5SU5[URSS5SU5SU[ URSS5S X#5URS[5[ URSS5SX#5[ URSS5SX#5UU[ URSS5SX#5/n[R"S[-SRU55n [U [*S5Sn U SS[SU -S5-U SS-n U $) zqReturn a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants. rrrrQrrNzTarInfo.type must not be Nonerrrrr4r5r2rr3s rrr6rr7rrz%dsrGiz%06orSi)getCHRTYPEBLKTYPErerFrr=rrjrrrror_) rrcrCrDhas_device_fieldsrrfiletypepartsrlrs rErTarInfo._create_header{s !HHV,'0BB 488J2Av>H488J2Av>H2q(3H2q(3H88FG,  <= = $c8 < #f,a 8 "Av . "Av . #R 0 !$b& 1   R(#x @ HHWk * "%r8 < "%r8 <   2&X > $kk%)+SXXe_=c9*+./2%4j5F!2G<r@r?rrrr)rrrrCrDrs rErTarInfo._create_gnu_long_headersn {{8,s2&V V 4yV !W !!$ hG##D)* *rGcSnUR5HupVURSS5 M SnU(aUS- nUR5HupVURS5nU(aURUS5nOURS5n[U5[U5-S-nS =pU[[ U 55-n X:XaOU n M!U[ [ U 5S 5S -U-S -U-S -- nM 0n SU S'X+S'[U5U S'[ U S'URU [S S5URU5-$![a Sn GM&f=f)zReturn a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings. Fr;rTTrGs21 hdrcharset=BINARY rr$rrS = z././@PaxHeaderrrr2rr) rr>rr?rr_rrrr) rrrrCbinarykeywordrrecordslr[rLrs rEr"TarInfo._create_pax_generic_headersw)//1NG  Wh/2  0 0G)//1NGnnW-G X/@A W-G s5z)A-AIACF O6  uSVW-4w>EMPUU UG!2('V V 7|V #W !!$ gyI##G,- -I&  sE EEc[U5S:Xa [S5e[U5[:wa [S5eUR [ 5[:Xa [ S5e[USS5nU[U5;a [S5eU"5n[USSX#5Ul [USS 5Ul [US S 5Ul [US S 5Ul[US S 5Ul[US S5UlXElUSS Ul[US SX#5Ul[USSX#5Ul[USSX#5Ul[USS5Ul[USS5Ul[USSX#5nUR$[0:Xa+URR3S5(a [4UlUR$[6:XavSn/n[9S5H>n [XUS-5n [XS-US-5n UR=X45 US- nM@ [?US5n [USS5n XU 4Ul URC5(a URRES5Ul U(a+UR$[F;aUS-UR-Ul U$![:a  Mf=f)zAConstruct a TarInfo object from a 512 byte bytes object. rz empty headerztruncated headerzend of file headerz bad checksumrlt|ii i)iIiQiYirirriii)$r?rrrcountr@rr]rorZrMrrr4r5r2r3rrrr6r7rrAREGTYPErrGNUTYPE_SPARSErWr=rboolrrrstrip GNU_TYPES)rrlrCrDrobjrrstructsr\r-numbytes isextendedorigsizes rEfrombufTarInfo.frombufs s8q=">2 2 s8y &'9: : 99S>Y & !56 6SS\" c* *$^4 4es1Sz84s3s|$c#cl#c#cl#s3s|$C %  s3<3s3<: C h7 C h7 3s3<( 3s3<( SS\84 88x CHH$5$5c$:$:CH 88~ %CG1X r!23F"3Rxb#9:H12r c#hJ3s3<(H#*"AC  99;;xxs+CH chhi/|chh.CH "s*#J66 KKcURR[5nURX!RUR 5nURR 5[- UlURU5$)z>'* *%%g. .rGcURR5UlURnUR5(dUR[ ;aX R UR5- nX!lURURURUR5 UR5(a URRS5UlU$)zSProcess a builtin type or an unknown type which will be treated as a regular file. r)rr r_rrSUPPORTED_TYPES_blockr2r-_apply_pax_inforrCrDrrr*)rrbr-s rEr<TarInfo._proc_builtinTs#??//1!! ::<<499O; kk$)), ,F W00'2B2BGNNS ::<< ((-DI rGcRURRURUR55nUR U5nURUlUR[:Xa&[X!RUR5UlO9UR[:Xa%[X!RUR5UlUR#5(a URR%S5UlU$![ an[ [U55SeSnAff=f)z@Process the blocks that hold a GNU longname or longlink member. Nr)rrur@r2r5r rrr-rrrMrCrDrrrr removesuffix)rrbrlnextrs rEr8TarInfo._proc_gnulongjsoo""4;;tyy#9: :##G,D kk 99( (C!1!17>>BDI YY* *%5%5w~~FDM ::<< ..s3DI ! :'A/T 9 :sD D& D!!D&c0URup#nU?U(aURR[5nSn[ S5HLn[ XVUS-5n[ XVS-US-5n U(aU (aURX45 US- nMN [US5nU(aMX l URR5Ul URURUR5-UlX@l U$![ a  Mf=f)z8Process a GNU sparse header plus extra headers. rrr%i)rrrurrWr]r=rr)r`r r_r@r2r-) rrbr-r/r0rlrr\r-r.s rEr9TarInfo._proc_sparses)-(<(<%X  //&&y1CC2Y r!23F"3Rxb#9:HhNNF#56r c#hJj "??//1))DKK ,BB  "s #D DDcHURRURUR55nUR[ :Xa UR nOUR R5nSnSn/n[U5U:Ga(X$S:wGa[RX$5=n(d [S5e[URS55nUS:a [S5eXH-[U5:a [S5eURS5U-S- n X'R!S5S-U n U R#S5upn U (aU S:wdX)S:wa [S5eUR%XU 45 U S:XaUcU S :Xa UR&nOS nXH- n[U5U:a X$S:waGMUcS nUHxupn UR)U S S UR*5nU[,;a(UR)XUR&UR*5nOUR)U S S UR*5nXU'Mz UR/U5nS U;aUR7UU5 OUS U;aUR9UU5 O[@4;aURCX1R&UR*5 URDUl"SU;aZURFnURI5(dUR[J;aUURUR5- nUUl"U$![a [S5ef=f![0an[3[5U55SeSnAff=f)zCProcess an extended or global header as described in POSIX.1-2008. rNrVr.rr%s hdrcharsetsBINARYr;GNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrUr2)&rrur@r2rrrrr?_header_length_prefix_rematchrZrXgroupr=rSr partitionrrC_decode_pax_fieldrDPAX_NAME_FIELDSr5r rr_proc_gnusparse_01_proc_gnusparse_00r_proc_gnusparse_10rr:rAr-r_rr?)rrbrlrrrC raw_headersrPrBheader_value_end_offsetkeyword_and_value raw_keywordequals raw_valuerrrErr-s rEr;TarInfo._proc_paxso oo""4;;tyy#9: 99 !--K!--224K  #hnT!15;;CEEEE()9:: ;U[[^, z()9::|c#h&()9::&+kk!nv&=&A # #IIaL1$45L M ->-H-H-N *K&D.C4PTX4X()9::   Y? @m+0@ )&//H&H MCM#hnT!1R  H/: *F,,['7NN$G/)..yGDTDT(..y'7($) #/:( :##G,D { *  # #D+ 6 + -  # #D+ 6 __/ 0C 7KOOL^<_cf.> O++DK$))::<<499O#Cdkk$))44F!' y ;()9:: ;| :'A/T 9 :s$7M$2M=$M:= N!NN!c~/n/nUHhupVnUS:Xa+UR[UR555 M7US:XdM?UR[UR555 Mj [ [ X455Ulg![a [ S5ef=f![a [ S5ef=f)z?Process a GNU tar extended sparse header, version 0.0. sGNU.sparse.offsetrVsGNU.sparse.numbytesN)rrXrKr=rZlistzipr`)rrErXoffsetsr._rrs rErVTarInfo._proc_gnusparse_00s!, A..?NN3u||~#6722?OOC $78"-3w12 "?,-=>>? "?,-=>>?s(B (B& B#&B<c USRS5Vs/sHn[U5PM nn[[USSS2USSS255Ulgs snf)z?Process a GNU tar extended sparse header, version 0.1. rL,Nr/r.)rrXr`rar`)rrErxr`s rErUTarInfo._proc_gnusparse_01.sZ#..>"?"E"Ec"JK"JQ#a&"JK3vcc{F14a4L9: LsAc Sn/nURR[5nURSS5upF[ U5n[ U5US-:aiSU;a!XcRR[5- nURSS5upvUR [ U55 [ U5US-:aMiURR5Ul[[USSS2USSS255Ul g)z?Process a GNU tar extended sparse header, version 1.0. Nrr.r/) rrurrrXr?rr r_r`rar`)rrErrbfieldsr`rlnumbers rErWTarInfo._proc_gnusparse_104soo""9-iiq) V&kFQJ&C++I66))E1-KF MM#f+ & &kFQJ& #??//13vcc{F14a4L9: rGcUR5HupEUS:Xa[USU5 MUS:Xa[US[U55 M8US:Xa[US[U55 MVU[;dMbU[;a[U"U5nUS:XaUR S5n[XU5 M UR5Ulg![ a SnNKf=f) z\Replace fields with supplemental information from a previous pax extended or global header. zGNU.sparse.namer0rMr2zGNU.sparse.realsizerrN) rsetattrrX PAX_FIELDSPAX_NUMBER_FIELDSr=r*rr)rrrCrDrrs rErATarInfo._apply_pax_infoDs*//1NG++fe,--fc%j111fc%j1J&//" 1' :5 Af$!LL-Eu-2"'++- &" !"s>C  CCcjURUS5$![a URX45s$f=f)z1Decode a single field from a pax record. rT)rKUnicodeDecodeError)rrrCfallback_encodingfallback_errorss rErSTarInfo._decode_pax_field[s: D<<(3 3! D<< 1C C Ds 22cP[U[5up#U(aUS- nU[-$)zLRound up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. r.)rtr)rr&r{r|s rEr@TarInfo._blockcs*#5)4  aKF !!rGc(UR[;$z4Return True if the Tarinfo object is a regular file.)r REGULAR_TYPESrs rEr TarInfo.isreglsyyM))rGc"UR5$rz)rrs rEisfileTarInfo.isfilepszz|rGc(UR[:H$)z!Return True if it is a directory.)rrrs rEr TarInfo.isdirtyyG##rGc(UR[:H$)z%Return True if it is a symbolic link.)rSYMTYPErs rEr TarInfo.issymxrrGc(UR[:H$)z!Return True if it is a hard link.)rLNKTYPErs rEr TarInfo.islnk|rrGc(UR[:H$)z(Return True if it is a character device.)rrrs rEischr TarInfo.ischrrrGc(UR[:H$)z$Return True if it is a block device.)rr rs rEisblk TarInfo.isblkrrGc(UR[:H$)zReturn True if it is a FIFO.)rFIFOTYPErs rEisfifoTarInfo.isfifosyyH$$rGcURSL$r)r`rs rEissparseTarInfo.issparses{{$&&rGc>UR[[[4;$)zCReturn True if it is one of character device, block device or FIFO.)rrr rrs rEisdev TarInfo.isdevsyyWgx888rG)rrrrr5r7rrr3rr-r_rr2r`rr4r6r)r)7rrrrrdict __slots__rr[rbsetterr0r1rrrrrr rrrr classmethodrr staticmethodrrrrr1r5r4r<r8r9r;rVrUrWrArSr@rr~rrrrrrrrrrrGrErres , ! G H    -  $ > F   * *! "/# $5% &9' *.+ ,- ./ 01 I60 ^^   [[__!!O%eeuE88*HEV/" I M8QtMM  ''R** 0-0-d<<|))( /,68wr3(; ; ..D"*$$$$$%'9rGrc\rSrSrSrSrSrSrSr\ r \ r Sr \r\rSrS=Sjr\SSS\4S j5r\S>S j5r\S?S j5r\S?S j5r\S@S j5rSSSSS.rSrSrSrSrSASjr SBSS.Sjjr!SCSS.Sjjr"SDSjr#Sr$SESSS.Sjjr%S r&SFSSS.S!jjr'S"r(SDS#jr)S$r*S%r+S&r,SGSSS'.S(jjr-S)r.S*r/S+r0S,r1S-r2S.r3S/r4S0r5S1r6S2r7S3r8SHS4jr9S5r:SDS6jr;S7rS:r?S;r@S5 UR"RIU5nUR8RKU5 M^URS;aS UlUR.(amUR"RSUR.RU55nURRWU5 U=R>[YU5- slg g g ![La) URRGUR>5 M[Nan[Q[U55S eS nAff=f! UR(dURR[5 S Ule=f)aOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. r8zr+bwbxbrarrg!mode must be 'r', 'a', 'w' or 'x'rrFNrrTrrrrg).r=r_moderr0exists bltn_openrrrrrr_abspathrstreamrcrc dereference ignore_zerosrCrDrrdebug errorlevel copybufsizermembers_loadedr r-inodes firstmemberrEr r5rrr rrrrvr?r)rrrrrcrcrrrCrDrrrrrmodesrrls rErTarFile.__init__sT=  @A A [ yyCt(<(< ! jj1G$D  &!9!97<<#u66||w''$\\ #D -1BGGOOD)t      K  "L  "*   # ,   $M  "t{{j'@* !D   J  !(O'   ll'')   yyC#' #'99; yyCLL%%dkk2:"&,,":":4"@ ++G4 yyO+# ##,,??@P@P@U@U@WXCLL&&s+KK3s8+K$, * ))$++6&:'A/T9: ## ""$DK s> A"M*6L9BM*/M'M* M' M""M''M**5Nc ^U(dU(d [S5eUS;azU4Sjn/n[TRUS9H;n[TTRU5n UbUR 5n U "USU40UD6s $ S RU5n [ S U 35eS U;alURS S 5upU =(d Sn U=(d S nUTR;a[TTRU5n O[ SU-5eU "XU40UD6$SU;aoURSS 5upU =(d Sn U=(d S nU S;a [S5eURSS5n[XXUU5nT"XU40UD6nSUlU$US;aTR"XU40UD6$[S5e![ [ 4a8n URSUSU <35 UbURW 5 Sn A GMSn A ff=f! UR5 e=f)a^Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'r:xz' open for reading with lzma compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'w:xz' open for writing with lzma compression 'x' or 'x:' create a tarfile exclusively without compression, raise an exception if the file is already created 'x:gz' create a gzip compressed tarfile, raise an exception if the file is already created 'x:bz2' create a bzip2 compressed tarfile, raise an exception if the file is already created 'x:xz' create an lzma compressed tarfile, raise an exception if the file is already created 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'r|xz' open an lzma compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing 'w|xz' open an lzma compressed stream for writing znothing to open)rr:*c(>TRUS:H$)Ntaropen) OPEN_METH)rrs rEnot_compressed$TarFile.open..not_compressedKs}}X.);;rG)keyNrz - method z:  z'file could not be opened successfully: :r.rr|rzmode must be 'r' or 'w'r Frzundiscernible mode)r=sortedrrr rr rr rrpoprrrr)rrrrrzkwargsr error_msgsrfunc saved_posrerror_msgs_summaryfilemoderrrs` rEr TarFile.open!s%JG./ / <  <J"3==nEsCMM($;<& ' Ic7=f== F"&:!6 FGYFZ[\ \ D[!%C!3 H3H(5H3==(sCMM($;<&'Dx'OPP:6: : D[!%C!3 H3H(5Hz) !:;;"JJ:MTX*,F 9&9"AMH _ $;;t7=f= =-..W"#34%% (2aU&CD* Y/ D  s$- F'/ G2'G/7,G**G/2Hc 8US;a [S5eU"XU40UD6$)zCOpen uncompressed tar archive name for reading or writing. rr)r=)rrrrrs rErTarFile.taropens+ + +@A A4w1&11rGc US;a [S5eSSKJn U"XS-XC5nUR"XU40UD6nS Ul U$![a [ S5Sef=f![ anUbUS:Xa [ S 5UeeSnAff=f![ a(nUR5 US:Xa [ S 5UeeSnAf UR5 e=f) zXOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. rrrgmode must be 'r', 'w' or 'x'r)GzipFilezgzip module is not availableNr}rrF) r=gziprrr rrrrr) rrrrrrrrrs rEgzopenTarFile.gzopens  &;< < M % tCZHG  D:6:A + M"#AB L M  "ts{ 129    MMOs{ 129   MMO s9A ABA B(A>>B C #B33C c ZUS;a [S5eSSKJn U"U=(d UX$S9nUR "XU40UD6nS Ul U$![a [ S5Sef=f![ [4a(nUR5 US:Xa [S 5UeeSnAf UR5 e=f) zYOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. rrr)BZ2FilerN)rrznot a bzip2 fileF) r=rrrr rrEOFErrorrrr) rrrrrrrrrs rEbz2openTarFile.bz2opens  &;< < L #'/T4M  D:6:A ! L"#@At K L"  MMOs{ 23:   MMO s"AA!A!B*1#BB*c VUS;a [S5eSSKJnJn U"U=(d UX$S9nUR "XU40UD6nS Ul U$![a [ S5Sef=f!U[4a(n UR5 US:Xa [S 5U eeSn A f UR5 e=f) zXOpen lzma compressed tar archive name for reading or writing. Appending is not allowed. rrr)LZMAFilerrN)presetrznot an lzma fileF) r=rrrrr rrrrr) rrrrrrrrrrs rExzopenTarFile.xzopens  &;< < M 07?dD@  D:6:A ! M"#AB L M8$  MMOs{ 23:   MMO s"A A# A # B(/#BB(rrrr)rrrrc2UR(agSUlURS;aURR[[ S--5 U=R [ S-- sl[UR [5upUS:a)URR[[U- -5 UR(dURR5 gg!UR(dURR5 ff=f)zYClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NTrr/r) rrrrvr@rr-rt RECORDSIZErr)rr{r|s rEr TarFile.closes ;;   %yyO+ ""3)a-#89 A . %+4;; $C!q=LL&&sj9.D'EF## ""$$4## ""$$s B C((.DchURURS55nUc[SU-5eU$)zReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. rzfilename %r not found) _getmemberr*KeyError)rrrcs rE getmemberTarFile.getmembers6 //$++c"23 ?2T9: :rGc|UR5 UR(dUR5 UR$)z{Return the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. )_checkr_loadrrs rE getmembersTarFile.getmembers s' || JJL||rGc`UR5Vs/sHoRPM sn$s snf)zxReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). )rr)rrcs rEgetnamesTarFile.getnamess'-1OO,=>,= ,=>>>s+cURS5 Ub URnUcUn[RR U5upBUR [R S5nURS5nUR5nXl Uc?UR(d[R"U5nO;[R"U5nO$[R"UR55nSnURn[R "U5(aUR"UR$4n UR(dGUR&S:a7XR(;a(X R(U :wa[*n UR(U nO[,n U S(aX R(U 'O[R."U5(a[0n O[R2"U5(a[4n O}[R6"U5(a[8n [R:"U5nOE[R<"U5(a[>n O#[R@"U5(a[Bn OgX%lXl"URFUl$URJUl&U [,:XaURNUl(OSUl(URRUl*Xl+Xul,[Z(a)[ZR\"URH5SUl/[b(a)[bRd"URL5SUl3U [>[B4;at[i[S5(a_[i[S5(aJ[Rj"URl5Ul7[Rp"URl5Ul9U$![`a Nf=f![`a Nf=f) aCreate a TarInfo object from the result of os.stat or equivalent on an existing file. The file is either named by `name', or specified as a file object `fileobj' with a file descriptor. If given, `arcname' specifies an alternative name for the file in the archive, otherwise, the name is taken from the 'name' attribute of 'fileobj', or the 'name' argument. The name should be a text string. awxNrrr.rmajorminor):rrrr0 splitdriverrrrcrrlstatstatfstatfilenost_modeS_ISREGst_inost_devst_nlinkrrrS_ISDIRrS_ISFIFOrS_ISLNKrreadlinkS_ISCHRrS_ISBLKr rst_uidr4st_gidr5st_sizer2st_mtimer3rrpwdgetpwuidr6rgrpgetgrgidr7rrst_rdevrrr) rrarcnamerdrvrcstatresrstmdinoders rE gettarinfoTarFile.gettarinfos E  <URA5(aSOS -5 U(aZURC5(a[S URD-5 URG5(a[S URD-5 [I5 GM g)zPrint a table of contents to sys.stdout. If `verbose' is False, only the names of the members are printed. If it is True, an `ls -l'-like output is produced. `members' is optional and must be a subset of the list returned by getmembers(). Nz ??????????rrz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02drrz-> zlink to )%rrS_IFREGrS_IFLNKrS_IFIFOrS_IFCHRrS_IFDIRr S_IFBLKrrrrrrr6r4r7r5rrrrr2r3r localtimerrrrrr)rverboser type2modercmodetypes rEr` TarFile.listsdllGT\\t||WdlldllGT\\C  ?GG<<' -(}}W\\1=H h.E FGw}}'C 'C'.}}'C 'CEF==??gmmoo$(8(8':J:J'KK!MN  56==( 56 ="&.."?"C!DE  w}}BG H==??(8(8 89==?? W-=-= => G7rGfiltercURS5 UcUnURbC[RR U5UR:XaUR SSU-5 gUR SU5 UR X5nUcUR SSU-5 gUb!U"U5nUcUR SSU-5 gUR5(a'[US5nURXV5 SSS5 gUR5(aURU5 U(ar[[R"U55HNnUR[RRX5[RRX&5X4S 9 MP ggURU5 g!,(df  g=f) aAdd the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. rNr/ztarfile: Skipped %rr.ztarfile: Unsupported type %rtarfile: Excluded %rr8r)rrrr0r_dbgrrraddfilerrlistdiraddr)rrr  recursiverrcfs rEr% TarFile.addsk E ?G 99 RWW__T%:dii%G IIa.5 6  !T//$0 ? IIa7$> ?   WoG !3d:; ==??4&! W('&]]__ LL ! 4 01AHHRWW\\$2BGGLL4L%62 LL !'&s (F55 GcURS5 Uc0UR5(aURS:wa [S5e[R"U5nUR UR URUR5nURRU5 U=R[U5- sl URnUb[X RURUS9 [UR[ 5upVUS:a.URR["[ U- -5 US- nU=RU[ -- sl UR$R'U5 g)aAdd the TarInfo object `tarinfo' to the archive. If `tarinfo' represents a non zero-size regular file, the `fileobj' argument should be a binary file, and tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects directly, or by using gettarinfo(). rNrz3fileobj not provided for non zero-size regular file)rzr.)rrr2r=rrrcrCrDrrvr-r?rrsrtrr@rr)rrcrrlrzr{r|s rEr#TarFile.addfiles E ?w}}7<<13DRS S))G$mmDKK D 3 s3x      w||W M &w||Y ? F1} ""3)i*?#@A!  KK6I- -K G$rGcUcPURnUcSSKnURS[SS9 [$[ U[ 5(a [S5eU$[U5(aU$[U$![a [SU<S35Sef=f)NrzPython 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.r$rzrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.zfilter z not found) extraction_filterrrrrrr TypeErrorcallable_NAMED_FILTERSrr=)rrrs rE_get_filter_functionTarFile._get_filter_functions >++F~ J'1 6 ,+&#&&677M F  M G!&) ) Gwvj ;<$ F Gs 'A00B ) numeric_ownerrc /nURU5nUcUnUHgnURXvU5upUcMUR5(aURU 5 UR XUR5(+UUS9 Mi UR SSS9 UHn U"X5nUcURU S5 M$[RRXR5n [R"U 5n [R "U R"5(dURUS5 MUR%XUS 9 UR'X5 UR)X5 M g![ a&n URU [U 55 Sn A MSn A ff=f![a URUS5 GM'f=f![*an UR-U 5 Sn A GMMSn A ff=f) a-Extract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). If `numeric_owner` is True, only the numbers for user/group names are used and not the names. The `filter` function will be called on each member just before extraction. It can return a changed TarInfo or None to skip the member. String names of common filters are accepted. N) set_attrsr2filter_functioncUR$rr)rs rE$TarFile.extractall..5 sqvvrGT)rreversezexcluded by filtermissingznot a directory)r2)r0_get_extract_tarinforr _extract_onesort_FILTER_ERRORS_log_no_directory_fixupreprrr0rrrFileNotFoundErrorrrrchownutimechmodr _handle_nonfatal_error)rr0rr2r directoriesr5rrc unfilteredexcdirpathrrs rE extractallTarFile.extractall s 33F; ?GF"&";";#/ G}}"":.   g7==?7J,9.=  ? -t<&J /-j?G?001EG'',,t\\:HHW-E||EMM2200:KL 7= I 7, 7,5& &00T#YG)00)D  /++A.. /slE-&G=)G'F =7G62G- F7FGFG G<GGG G+G&&G+cNURSSUR<SU<S35 g)Nr/z!tarfile: Not fixing up directory z ())r"r)rrreasons rEr?TarFile._log_no_directory_fixupW s !;;( )rGczURU5nURXU5upxUbURXrX45 gg)aDExtract 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 TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. If `numeric_owner` is True, only the numbers for user/group names are used and not the names. The `filter` function will be called before extraction. It can return a changed TarInfo or None to skip the member. String names of common filters are accepted. N)r0r;r<) rrr0r4r2rr5rcrGs rEextractTarFile.extract[ sG33F;"77 T+     gY F rGc[U[5(aURU5nOUnSnU"XC5nUc URSSUR-5 gUR5(aD[R"U5n[RRX5R 5UlXT4$![[[ 4anUR U5 SnANSnAf[anURU5 SnANSnAff=f)zrGet (filtered, unfiltered) TarInfos from *member* *member* might be a string. Return (None, None) if not found. Nr/r!)NN)rrrrrr_handle_fatal_errorr rEr"rrrrr0rrr)rrr5r0rGfilteredrs rEr;TarFile._get_extract_tarinfoo s fc " "/JJ +&z8H   IIa/*//A B >>  yy*H$&GGLL7H7H$IH !##+[9 (  $ $Q ' ' +  ' ' * * +s#B44D C D,DDc @URS5 URU[RR X!R 5UUUUS9 g![ [4anURU5 SnAgSnAf[anURU5 SnAgSnAff=f)zExtract from filtered tarinfo to disk. filter_function is only used when extracting a *different* member (e.g. as fallback to creating a symlink) r)r4r2r5extraction_rootN) r_extract_memberrr0rrrrrTr rE)rrcr0r4r2r5rs rEr<TarFile._extract_one s C +  "'',,t\\*J+4/<1@15 ! 7 +, (  $ $Q ' ' +  ' ' * * +s#;ABA55 BBBcPURS:aeURSSU-5 g)z=Handle non-fatal error (ExtractError) according to errorlevelr. tarfile: %sN)rr"rrs rErETarFile._handle_nonfatal_error s$ ??Q   IIa* +rGcbURS:ae[U[5(a\URc UR SSUR -5 gUR SSUR <SUR<35 gUR SS[ U5R<SU<35 g)z1Handle "fatal" error according to self.errorlevelrNr.r\z tarfile: r)rrrfilenamer"strerrorrrr]s rErTTarFile._handle_fatal_error sw ??Q   7 # #zz! !]QZZ78 !QZZHI IIaT!W-=-=qA BrGcURS5 [U[5(aURU5nOUnUR 5(dUR [ ;aURX5$UR5(dUR5(aJ[UR[5(a [S5eURURU55$g)a(Extract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file or a link, an io.BufferedReader object is returned. For all other existing members, None is returned. If `member' does not appear in the archive, KeyError is raised. rz'cannot extract (sym)link as file objectN)rrrrrrr? fileobjectrrrrr extractfile_find_link_target)rrrcs rEreTarFile.extractfile s C fc " "nnV,GG ==??gll/A??41 1 ]]__ $,,00""KLL''(>(>w(GHHrGr5rXcURS5nURS[R5n[RR U5nU(a9[RR U5(d[R"USS9 UR5(dUR5(a.URSUR<SUR<35 OURSUR5 UR5(aURX5 OUR5(aUR!X5 OUR#5(aUR%X5 OUR'5(dUR)5(aUR+X5 OsUR5(dUR5(aUR-XUUS9 O7UR.[0;aUR3X5 OURX5 U(aKUR5XU5 UR5(d#UR7X5 UR9X5 ggg)zExtract the filtered TarInfo object tarinfo to a physical file called targetpath. filter_function is only used when extracting a *different* member (e.g. as fallback to creating a symlink) rT)exist_okr.z -> rhN)r*rrrr0rrmakedirsrrr"rrrmakefilermakedirrmakefiforrmakedevmakelink_with_filterrr? makeunknownrBrDrC)rrc targetpathr4r2r5rX upperdirss rErYTarFile._extract_member s &&s+ ''RVV4 GGOOJ/ RWW^^I66 KK D 1 ==??gmmoo IIaw||W5E5EF G IIa & ==?? MM' . ]]__ LL - ^^   MM' . ]]__  LL - ]]__   % % / / & 1\\ 0   W 1 MM' .  JJwM :==?? 7/ 7/# rGcURc[R"U5 g[R"US5 g![a( [RR U5(degf=f)z,Make a directory called targetpath. Ni)rrmkdirFileExistsErrorr0rrrcrrs rErmTarFile.makedir sW ||#$U+ 77==,,- s#>>/A0/A0c URnURUR5 URn[ US5nUR bdUR H(upgURU5 [ X5U[U5 M* URUR5 UR5 O[ X5UR[U5 SSS5 g!,(df  g=f)z'Make a file called targetpath. rN) rr r_rrr`rsrr2truncate)rrcrrsourcerztargetr-r2s rErlTarFile.makefile s G''("" z4 (F~~)$+NNLFKK'iI%3 GLL)!FGLL)WM) ( (s BC C%cdURX5 URSSUR-5 g)zFMake a file from a TarInfo object with an unknown type at targetpath. r.z9tarfile: Unknown file type %r, extracted as regular file.N)rlr"rrxs rErqTarFile.makeunknown+ s1 g* !24;LLA BrGcp[[S5(a[R"U5 g[S5e)z'Make a fifo called targetpath. mkfifozfifo not supported by systemN)rrrr rxs rErnTarFile.makefifo3 s) 2x IIj !=> >rGc[[S5(a[[S5(d [S5eURnUcSnUR 5(aU[ R -nOU[ R-n[R"X#[R"URUR55 g)z.>? ArGc(URXSS5$r)rprxs rEmakelinkTarFile.makelinkM s((dDIIrGcSnUR5(a\[RRU5(a[R"U5 [R "UR U5 g[RRUR5(a"[R"URU5 gURU5nUcUnOUc [S5eU"Xd5nUbUR#XrUUS9 gg![a SnNSf=f![a U(a [S5Seef=f![an[XR 5UeSnAff=f)aMake a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. filter_function is only used when extracting a *different* member (e.g. as fallback to creating a link). FNTz%unable to resolve link inside archivez[makelink_with_filter: if filter_function is not None, extraction_root must also not be Nonerh)rrr0lexistsunlinksymlinkrrrlinksymlink_exceptionrfrr r>rrrY) rrcrrr5rXkeyerror_to_extracterrorrGrUcauses rErpTarFile.makelink_with_filterP s_$)  ,}}77??:..IIj) 7++Z877>>'"6"677GGG00*=8  //8J  "!H&">?? M*:G    1@1@ ! B /! ,'+ $ ,  '";=BFG   " M'AuL Ms=A0D 5AD D-D? DDD<? E$ EE$c[[S5(Ga[R"5S:XGaURnURnU(d[ (a4UR (a#[ R"UR 5Sn[(a4UR(a#[R"UR5SnUcSnUcSnUR5(a-[[S5(a[R"X%U5 g[R"X%U5 ggg![a Nf=f![a Nf=f![[ 4an[#S5UeSnAff=f)zSet owner of targetpath according to tarinfo. If numeric_owner is True, use .gid/.uid instead of .gname/.uname. If numeric_owner is False, fall back to .gid/.uid when the search based on name fails. geteuidrr/NrIlchownzcould not change owner)rrrr5r4rr7getgrnamrrr6getpwnamrrrBr OverflowErrorr )rrcrrr2gurs rErB TarFile.chown s% 2y ! !bjjla&7 A A sw}}LL7:sw}}LL7:yy D==??wr8'<'<IIjQ/HHZA./'8 !   ]+ D"#; ?s 1 A  AA cURnUcg[[S5(dg[R"X#U45 g![an[ S5UeSnAff=f)zBSet modification time of targetpath according to tarinfo. NrCz"could not change modification time)r3rrrCrr )rrcrrr3rs rErC TarFile.utime s[  = r7##  L HHZ 0 LCD! K LsA A AAcURS5 URbURnSUlU$URURR 5:wadURS:XagURR URS- 5 URR S5(d [S5eSnURRU5nUb.UR0(dUR2R5U5 U$SUlU$![a[nUR(a@URSSURU4-5 U=R[- slSnAMSnANSnAf[anUR(aAURSSURU4-5 U=R[- slSnAGMURS:Xa[[U55SeSnAGN%SnAf[ a URS:Xa [S 5SeGNQ["a0nURS:Xa[[U55SeSnAGNSnAf[$an[[U55SeSnAf[&aEnSSKn[+X4R,5(a[S U35SeUe![.a Uef=fSnAff=f) zReturn the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. raNrr.rqTr/z0x%X: %sz empty filez zlib error: )rrr-rr r rurrcr5rrr"rrZrrrr Exceptionrrrrrrrr)rmrcrrs rErE TarFile.next s] D    '  A#D H ;;$,,++- -{{a LL  dkkAo .<<$$Q'' 899 ,,2248<   ;; ##G, DLM" $$IIat{{A.>!>?KK9,K%& 6$$IIat{{A.>!>?KK9,K[[A%#CF+5&# <;;!##L1t;$' 6;;!##CF+5$( 2A'T1 !!ZZ00',qc(:;E"G sbD K$A E:: KA H%H)K0 K9%I$$ K1J K/K KKKcUR5nSnUbURU5nUSUnU(a[RR U5n[ U5HnnU(aURUR:XaSnM(U(a*[RR UR5nO URnX:XdMlUs $ U(a [U5eg![a SnNf=f)zjFind an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. FNT) rindexr=rr0rreversedr-r) rrrc normalizerskippingrr member_names rErTarFile._getmember s //#   * g."&5/ 77##D)Dw'F>>V]]2$H gg..v{{; $kk " ( W% % 1   sC## C21C2cUR(d-UR5bUR5bMSUlgg)zvRead through the entire archive file and look for readable members. This should not run if the file is set to stream. NT)rrErrs rEr TarFile._load' s4{{))+)))+)DLrGcUR(a"[SURR-5eUb)URU;a[SUR-5egg)z[Check if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. z %s is closedNzbad operation for mode %r)rrrdrr)rrs rErTarFile._check0 sS ;;.4>>+B+BBC C    55 AB B!6 rGc0UR5(aQSR[S[RR UR 5UR455nSnOURnUnURX#SS9nUc[SU-5eU$)zGFind the target member of a symlink or hardlink member in the archive. rNT)rcrzlinkname %r not found) rrrrr0rrrrr)rrcrlimitrs rErfTarFile._find_link_target9 s ==??xxtbggoogll.KWM]M]-^ _`HE''HEDI >2X=> > rGc#x# UR(aURShvN gSnURbUR5nUS- nUv U[ UR5:aURUnO2UR(d UR5nU(dSUlgOgUS- nUv MfN7f)z$Provide an iterator object. Nrr.T)rrrrEr?)rrrcs rE__iter__TarFile.__iter__L s <<|| # #     'iikG QJEMs4<<((,,u-\\))+#'DL QJEM $s!B:B8BB:cTXR::a[U[RS9 gg)z.Write debugging output to sys.stderr. fileN)rrrstderr)rlevelmsgs rEr" TarFile._dbgk s! JJ  #CJJ ' rGc&UR5 U$r)rrs rE __enter__TarFile.__enter__q s  rGcUcUR5 gUR(dURR5 SUlgr;)rrrr)rrr tracebacks rE__exit__TarFile.__exit__u s2 < JJL## ""$DKrG)rrrrrrrrCrrDrrrcrrrrrr-rrrc)NrNNNNNNrNNNNF)rN)rNr)rNN)NNNTr;r).N)rT)TFr?)Brrrrrrrrrrrcr rCrDrrcr]rdr,rrrrrrrrrrrrrrr`r%r#r0rJr?rQr;r<rErTrerYrmrlrqrnrorrprBrDrCrErrrrfrr"rrrrrGrErrs EKLJFH FGJAEHL>B6;db#tZ]/]/~22@6: I%* ? aF)D)V1"1"f%8G0C/%C/J)GG($>&*+(, C@>B&+10@D(,10p N B?A$J0Bd DD? L>F&&P C&>( rGrc[US5(a+UR5n[US9nURU5 O [U5nUR 5 g![ a gf=f)zReturn True if name points to a tar archive that we are able to handle, else return False. 'name' should be a string, file, or file-like object. ru)rTF)rr rr rr)rrrs rErr s[  4 ))+CT"A IIcNT A   sAA A'&A'c SSKnSnURUS9nURSSSSSS 9 URS S [S S 9 UR SS9nURSSSSS9 URSSSSSS9 URSSSSSS9 URSS SS!S9 UR 5nUR (aURcURS"S#5 URbURn[U5(ax[US$5nUR5 [UR5[RS%9 SSS5 UR (a[S&R#U55 ggURS"S'R#U55 gUR$bwUR$n[U5(a9[&RUS(5nUR%UR S)9 SSS5 gURS"S'R#U55 gURGb3[)UR5S":Xa URSn[*R,nOH[)UR5S*:XaURupXO URS"UR/55 [W5(a[&RUS(5nUR1WUR S+9 SSS5 UR (a5WS,:XaS-R#U5n OS.R#XX5n [U 5 ggURS"S'R#U55 gUR2bUR2R5S5n [*R6R9U 5upS/S/S0S0S1S1S1S1S2.n X;aS3X-OS4nUR2n[&RX5nUHnUR;U5 M SSS5 UR (a[S5R#U 55 ggg!,(df  GN=f!,(df  g=f!,(df  GNo=f!,(df  Nq=f)6Nrz3A simple command-line interface for tarfile module.) descriptionz-vz --verbose store_trueFzVerbose output)actiondefaulthelpz--filterz zFilter for extraction)metavarchoicesrT)requiredz-lz--list zShow listing of a tarfile)rrz-ez --extract+)rz zExtract tarfile into target dir)nargsrrz-cz--create)zzzCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr.z&--filter is only valid for extraction rrz{!r} is a tar archive.z{!r} is not a tar archive. r)rr/)r0rrz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.rrr)rz.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:rz{!r} file created.)argparseArgumentParser add_argumentr/add_mutually_exclusive_group parse_argsrrQexittestrrrrrrrrcr`rr?rcurdir format_helprJcreaterr0splitextr%)rrparserrQargsrwrtfrrtar_namercext compressionstar_mode tar_files file_names rEmainr sGK  $ $ $ =F k,-/  N .46  / / / >E tX{79 t[<=? tZs39; tX{8:    D {{t||+ A@A yyii c??c33 cnn&SZZ8 ||.55c:; KK9@@E F  ii c??c5)R -*) KK9@@E F  ! t||  !,,q/CYYF  ! #,,KC KK6--/ 0 c??c5)R 6$++ >*||S=3::3?C2396#3Fc  KK9@@E F  ;;??1%!!(+  03/B4,++KK \\( -& y!'. << &--h7 8 / !M *)*)>. -s0 7P4QQ#Q)4 Q Q Q&) Q7__main__r)mrversion __author__ __credits__builtinsrrrrrIrrrrrjrrerrrAttributeErrorNotImplementedErrorrr__all__r@rrrrrrrrr'rrrr rrCONTTYPErrr(rrr:rrrrr?r{r+rorTrrXrprr getfilesystemencodingrFrMr]rerorsrrrr rr r r rrrrZrrrobjectrr+BufferedReaderr]rrrrrrrr>rrrrr/rcompilerOrrrrrrrGrErs:6 H ' $%8'B ?   ^                    HgGXWg#%5! #(>+ /   . 9       77d?H((*H 0& (N < *"&$ 2 y  8    x  (  (  {  ;  [    K 0rrj6