e 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]SeSXjr^SYr_SZr`S[ra\_\`\aS\.rb\S"5rc\R"S]5re"S^S_\S5rf"S`Sa\S5rgSbrh\gR rScri\jSd:Xa\i"5 gg!\a SrGNf=f!\a SrGN$f=f)fz,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 FilterErrorAbsoluteLinkErrorOutsideDestinationErrorSpecialFileErrorAbsolutePathErrorLinkOutsideDestinationErrorisustar sustar00d01234567LKSxgX)pathlinkpathsizemtimeuidgidunamegname>r/r6r5r0)atimectimer2r3r4r1ntutf-8cvUc [S5eURX#5nUSUU[U5- [--$)z8Convert a string to a null-terminated bytes object. Nzmetadata cannot contain None) ValueErrorencodelenNUL)slengthencodingerrorss -/opt/imh/python3.13/lib/python3.13/tarfile.pystnrEsA y788 "A Wf:#a&C/ //c\URS5nUS:waUSUnURX5$)z8Convert a null-terminated bytes object to a string. rN)finddecode)r@rBrCps rDntsrLs2 u ABw bqE 88H %%rFcJUSS;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-rOasciistrict0invalid header)ranger>rLintstripr<InvalidHeaderError)r@nis rDntir\s  t~ s1vz"A !GA 1q5MA# Q45=#a&1*%)*A H  7Aw)AAGGI$a(A H 7$%56 6 7s 0B B"rPcUn[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. rrPr-z%0*orRrQrNrOzoverflow in number field)rWbytesr?r bytearrayrVinsertr<)rZdigitsformat original_nr@r[s rDitnrdsJ AAA!fqj!! &FQJ?*G 4s : H : 36A:#6"6!"Qcfqj>Q"Q 65'"A5'"Av !Avz"A HHQE " !GA# H344rFcS[[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. rQ 148B8x356B 148b8x356b)sumstruct unpack_from)bufunsigned_chksum signed_chksums rD calc_chksumsrnsEC 2 2< EFFO#f00sCDDM  ))rFcU=(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 copyfileobjdivmodrVreadr>write) srcdstrA exceptionbufsizeblocks remainderbrks rDrrrrs"G { ~3W-v/F 6]hhw s8g 45 5 #  A~hhy! s8i 45 5 # rFc[[RSS5nUb!URUS5R U5n[ USS9 g)NrBbackslashreplace )end)getattrsysstdoutr=rJprint)r@rBs rD _safe_printrs@szz:t4H HHX1 2 9 9( C !rFc\rSrSrSrSrg)ri zBase exception.N__name__ __module__ __qualname____firstlineno____doc____static_attributes__rrFrDrr srFrc\rSrSrSrSrg)r iz%General exception for extract errors.rNrrrFrDr r s/rFr c\rSrSrSrSrg)riz&Exception for unreadable tar archives.rNrrrFrDrrs0rFrc\rSrSrSrSrg)r iz.Exception for unavailable compression methods.rNrrrFrDr r s8rFr c\rSrSrSrSrg)r iz=Exception for unsupported operations on stream-like TarFiles.rNrrrFrDr r sGrFr c\rSrSrSrSrg)r iz!Base exception for header errors.rNrrrFrDr r s+rFr c\rSrSrSrSrg)EmptyHeaderErrorizException for empty headers.rNrrrFrDrrs&rFrc\rSrSrSrSrg)TruncatedHeaderErrori"z Exception for truncated headers.rNrrrFrDrr"s*rFrc\rSrSrSrSrg)EOFHeaderErrori%z"Exception for end of file headers.rNrrrFrDrr%s,rFrc\rSrSrSrSrg)rYi(zException for invalid headers.rNrrrFrDrYrY(s(rFrYc\rSrSrSrSrg)SubsequentHeaderErrori+z3Exception for missing and invalid extended headers.rNrrrFrDrr+s=rFrc0\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 rD__init___LowLevelFile.__init__8sbrzz)BJJ6   2z " " BKK D''$e,rFcD[R"UR5 gN)rcloserrs rDr_LowLevelFile.closeAs rFcD[R"URU5$r)rrtrrr1s rDrt_LowLevelFile.readDswwtww%%rFcF[R"URU5 gr)rrurrr@s rDru_LowLevelFile.writeGs !rF)rN) rrrrrrrrtrurrrFrDrr2s -&rFrcd\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*rFrgzzzlib module is not availablerbz2bz2 module is not availablexzlzma module is not availabletarunknown compression type %r) _extfileobjr _StreamProxy getcomptyperrcomptypefileobjryrkposclosedzlib ImportErrorr crc32crcerrorrx _init_read_gz_init_write_gzrdbufBZ2DecompressorcmpOSError BZ2CompressorlzmaLZMADecompressor LZMAErrorLZMACompressorr) rrrrrry compresslevelrrrs rDr_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 rD__del___Stream.__del__s& 4 " "4;; JJL,7 "rFcURRUURRURR*URRS5Ul[ R"S[[R"555nURSU-S-5 URRS5(aURSSUl [RRUR5Ul URURR!SS 5["-5 g) z6Initialize for writing with gzip compression. rDErFc,URS:Xa*URRXR5UlU=R[ U5- slURS:waUR RU5nURU5 g)z&Write string s to the stream. rrN) rrrrrr>rcompressrrs rDru _Stream.writese ==D yyq((3DH CF ==E !!!!$A QrFc`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)rkr>ryrrurs rD__write_Stream.__writesr A $((mdll* LL  txx 6 7xx .DH$((mdll*rFc4UR(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. NTrrrFrrl)rrrrkrflushrrurirrrrrrs rDr _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. rFr.snot a gzip filer-zunsupported compression methodrQrPN) r decompressobjrrr _Stream__readrr ordrtr?)rflagxlenr@s rDr_Stream._init_read_gzs+99**DII,?,?+?@  ;;q>[ (-. . ;;q>W $"#CD D4;;q>" A !8t{{1~&s4;;q>/B)BBD IIdO !8KKNAH "9KKNAH !8 KKN rFcUR$)z3Return the stream's file pointer position. )rrs rDtell _Stream.tells xxrFcXR- 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)rrsryrVrtr )rrrzr{r[s rDseek _Stream.seeksn >Q  &sXX~t|| D F6] $,,'# IIi xx@A ArFcnUceURU5nU=R[U5- slU$)z5Return the next size number of bytes from the stream.)_readrr>)rr1rks rDrt _Stream.read s3jj CH rFc@URS:XaURU5$[UR5nUR/nX!:aUR(aURnSUlO-UR R UR5nU(dOBURRU5nURU5 U[U5- nX!:aMSRU5nX1SUlUSU$!URan[S5UeSnAff=f)z+Return size bytes from the stream. rrFzinvalid compressed dataN)rrr>rrkrrtryr decompressrxrappendjoin)rr1ctrkes rDr _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. rFN)r>rkrrtryrr)rr1rrrks rD__read_Stream.__read.s M XXJh,,##DLL1C HHSM SMA h HHQKU8$xrF)rrkryrrrrrrxrrrrrN)r)rrrrrrrrrurrrr r rtrrrrrFrDrrJsF ENF"/%,> 6rFrc0\rSrSrSrSrSrSrSrSr g) ri?zhSmall proxy class that enables transparent compression detection for the Stream interface (mode 'r|*'). cXXlURR[5Ulgr)rrt BLOCKSIZErk)rrs rDr_StreamProxy.__init__Ds <<$$Y/rFcPURRUlUR$r)rrtrkrs rDrt_StreamProxy.readHsLL%% xxrFcURRS5(agURSSS:XaURSSS:Xag URRS 5(ag g ) NsrrsBZhr s1AY&SYr)s]s7zXZrr)rk startswithrs rDr_StreamProxy.getcomptypeLs\ 88   / / XXa]f $!B9)D XX !C D DrFc8URR5 gr)rrrs rDr_StreamProxy.closeVs rF)rkrrtN) rrrrrrrtrrrrrFrDrr?s0rFrc\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) roffsetr1positionrr map_indexmapr)rrr,r1r blockinfolastposrealposs rDr_FileInFile.__init__cs       T I++%LF >? HHOOT6D='B C OGmG & YY  HHOOUGYY= > rFcgrrrs rDr_FileInFile.flush|s rFcg)Nrbrrs rDr_FileInFile.modesrFcgNTrrs rDreadable_FileInFile.readablesrFcgNFrrs rDwritable_FileInFile.writablesrFc6URR5$r)rseekablers rDrB_FileInFile.seekables||$$&&rFcUR$)z*Return the current file position. )r-rs rDr _FileInFile.tell}}rFc8U[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_SETminmaxr1r-SEEK_CURSEEK_ENDr<)rr-whences rDr _FileInFile.seeks R[[ Ha 0$))rr rtrr?) rr1rkdatastartstopr,rAr|s rDrt_FileInFile.reads4 <99t}},DtYY67DQh,0HHT^^,D)TMM0D0NNa'N~~TXX6)*dmm34F !!&MME,A"BCLL%%f-q6V##$<==sV|# ND MMV #M'Qh( rFcfUR[U55nX!S[U5&[U5$r)rtr>)rr|rks rDreadinto_FileInFile.readintos*iiA)3s8 3xrFcSUlgr:)rrs rDr_FileInFile.closes  rF)rrr/r.rr,r-r1r)rrrrrrrpropertyrr;r?rBr rHrIr rtrVrrrrFrDr*r*]sV ?2 ' %'KK > rFr*c(^\rSrSrU4SjrSrU=r$) ExFileObjectic>[URURURURUR 5n[ TU]U5 gr)r*r offset_datar1rsparsesuperr)rtarfiletarinfor __class__s rDrExFileObject.__init__s;goow/B/B gllGNN< !rFrrrrrrr __classcell__rcs@rDr\r\s ""rFr\c\rSrSrSrg)rirN)rrrrrrrFrDrrsrFrc(^\rSrSrU4SjrSrU=r$)ricN>Xl[TU] SUR<S35 g)Nzmember z has an absolute pathrbr`rrrrbrcs rDrAbsolutePathError.__init__s$  77<<"22GHIrFrbrergs@rDrrsJJrFrc(^\rSrSrU4SjrSrU=r$)ricf>XlX l[TU] UR<SU<S3S-5 g)Nz would be extracted to , which is outside the destinationrb_pathr`rrrrbr/rcs rDr OutsideDestinationError.__init__s7   GLL++B4("M=> ?rFrtrbrergs@rDrr ??rFrc(^\rSrSrU4SjrSrU=r$)ricL>Xl[TU] UR<S35 g)Nz is a special filerkrls rDrSpecialFileError.__init__s"  GLL++=>?rFrnrergs@rDrrs@@rFrc(^\rSrSrU4SjrSrU=r$)ricL>Xl[TU] UR<S35 g)Nz is a link to an absolute pathrkrls rDrAbsoluteLinkError.__init__s"  GLL++IJKrFrnrergs@rDrrsLLrFrc(^\rSrSrU4SjrSrU=r$)ricf>XlX l[TU] UR<SU<S3S-5 g)Nz would link to rqrrrsrus rDr$LinkOutsideDestinationError.__init__s6   GLL+?4("E=> ?rFrwrergs@rDrrrxrFrc0nURn[RRU5nUR S[R 45(a0URR S[R -5=oCS'[RRU5(a [U5e[RR[RRX55n[RRXQ/5U:wa [X5eURnUbUS-nU(awUR5(dUR5(aUS-(dUS-nUS-nO8UR5(dUR!5(aSnO [#U5eX`R:waXcS'U(GaUR$bSUS'UR&bSUS 'UR(bSUS 'UR*bSUS 'UR5(dUR!5(Ga[RRUR,5(a [/U5eUR!5(aI[RRU[RR1U5UR,5nO*[RRUUR,5n[RRU5n[RRXQ/5U:wa [3X5eU$) N/ri@irr3r4r5r6)rrr/realpathr%seplstripisabsrr commonpathrrisregislnkisdirissymrr3r4r5r6linknamerdirnamer)member dest_pathfor_data new_attrsr target_pathrs rD_get_filtered_attrsrseI ;;D  +I 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__--'//||~~ ggll9+-77??4+@+1??< !ggll9+1??< ''**;7Kww!!;":;yH1&FF rFcU$rr)rrs rDrr5s MrFcX[XS5nU(aUR"S0UDSS0D6$U$)NFdeeprrrrrrs rDrr8s-#Fu=I~~6 666 MrFcX[XS5nU(aUR"S0UDSS0D6$U$)NTrFrrrs rDrr>s-#Ft5r\S?5r\S@5r\SA5r SBr!SCr"SDr#SEr$SFr%SGr&SHr'SIr(SJr)SKr*SLr+SMr,SNr-SOr.SPr/SQr0SRr1SSr2STr3SUr4SVr5SWr6g&)ZriTzInformational 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.r3z6User ID of the user who originally stored this member.r4z7Group ID of the user who originally stored this member.r1zSize in bytes.r2zTime 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.r5z User name.r6z 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)rrr3r4r1r2rREGTYPErrr5r6rrr,r^r_rrrs rDrTarInfo.__init__ws{             rFcLSSKnURS[SS9 UR$NrzhThe undocumented "tarfile" attribute of TarInfo objects is deprecated and will be removed in Python 3.16r. stacklevelwarningswarnDeprecationWarningr)rrs rDraTarInfo.tarfiles-  A 1  .}}rFcBSSKnURS[SS9 Xlgrr)rrars rDrars(  A 1  . rFcUR$)z(In pax headers, "name" is called "path".rrs rDr/ TarInfo.pathsyyrFcXlgrrrs rDr/rs rFcUR$)z0In pax headers, "linkname" is called "linkpath".rrs rDr0TarInfo.linkpathrFrFcXlgrr)rrs rDr0rs rFc`SURRUR[U54-$)Nz<%s %r at %#x>)rcrridrs rD__repr__TarInfo.__repr__s&4>>#:#:499RX"NNNrFT) rr2rrr3r4r5r6r_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. ) copydeepcopyrr2rrr3r4r5r6) rrr2rrr3r4r5r6rrresults rDrTarInfo.replaces ]]4(FYYt_F  K   L  K  &O  J  J   L   L rFcURcSnOURS-nURUURURURUR UR URURURURURURS. nUS[:Xa&USRS5(d US==S- ss'U$)z9Return the TarInfo's attributes as a dictionary. N) rrr3r4r1r2rrrr5r6rrrrr)rrr3r4r1r2rrrr5r6rrDIRTYPEr)rrinfos rDget_infoTarInfo.get_infos 99 D99v%D            <7 "4<+@+@+E+E LC L rFsurrogateescapec2UR5nUR5HupVUbM [SU-5e U[:XaUR XBU5$U[ :XaUR XBU5$U[:XaURXB5$[S5e)zr= LENGTH_LINKr< LENGTH_NAME_posix_split_name_create_headerr)rrrBrCs rDrTarInfo.create_ustar_headers$W tJ&&x8 9K G34 4 tF|""84 5 C+/+A+A$v,PX+a (DNDL""4xHHrFcN[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. rrFrr) GNU_MAGICr>r=r_create_gnu_long_headerGNUTYPE_LONGLINKrGNUTYPE_LONGNAMErr)rrrBrCrks rDrTarInfo.create_gnu_header s"W  tJ&&x8 9K G //Z0@BRT\e eC tF|""84 5 C //V >NPXa aC((z8LLLrFc[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. rrr/rr0)r5r5 )r6r6rrRrS))r3rP)r4rP)r1 )r2rFrrPr-TrFr)rrrrrr=UnicodeEncodeErrorr> isinstancefloatroundstr_create_pax_generic_headerXHDTYPErr) rrrBrrhnamerAra needs_paxval val_is_floatval_intrks rDrTarInfo.create_pax_headersb $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 rDcreate_pax_global_header TarInfo.create_pax_global_headerTs--k7GLLrFcTURS5n[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)splitrVr>rr= LENGTH_PREFIXrr<)rrrBrC componentsr[rs rDrTarInfo._posix_split_nameZsZZ_ q#j/*AXXj!n-F88JrN+D6==23}D H56+E|+/0 0rFcjURS5[[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. rrrrPrrNzTarInfo.type must not be Nonerrrrr3r4r1rr2s rrr5rr6rrz%dsrFiz%06orRi)getCHRTYPEBLKTYPErdrErr<rrirrrrnr^) rrbrBrChas_device_fieldsrrfiletypepartsrkrs rDrTarInfo._create_headerjs !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<rr?)payloadrzr{s rD_create_payloadTarInfo._create_payloads7 #3w<; q=  I-4 4GrFcURX45[-n0nSUS'X%S'[U5US'[US'UR U[ X45UR U5-$)zAReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name. z ././@LongLinkrrr1r)r=r?r>rrrr )rrrrBrCrs rDrTarInfo._create_gnu_long_headersn {{8,s2&V V 4yV !W !!$ hG##D)* *rFcSnUR5HupVURSS5 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:rSTrFs21 hdrcharset=BINARY rr#rrR = z././@PaxHeaderrrr1rr) rr=rr>rr^rrrr ) rrrrBbinarykeywordrrecordslrZrKrs rDr"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\rnrYrLrrr3r4r1r2rrrr5r6rrAREGTYPErrGNUTYPE_SPARSErVr<rboolrrrstrip GNU_TYPES)rrkrBrCrobjrrstructsr[r,numbytes isextendedorigsizes rDfrombufTarInfo.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. .rFcURR5UlURnUR5(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_blockr1r,_apply_pax_inforrBrCrrr#)rrar,s rDr5TarInfo._proc_builtinCs#??//1!! ::<<499O; kk$)), ,F W00'2B2BGNNS ::<< ((-DI rFcRURRURUR55nUR 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)rrtr9r1r.r rrr,rrrLrBrCrrrr removesuffix)rrarknextrs rDr1TarInfo._proc_gnulongYsoo""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. rrri)rrrtrrVr\r<rr"r_r r^r9r1r,) rrar&r(r)rkrr[r,r's rDr2TarInfo._proc_sparsets)-(<(<%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. rNrUr-rr$s hdrcharsetsBINARYr:GNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrTr1)&rrtr9r1rrrrr>_header_length_prefix_rematchrYrWgroupr<rRr partitionrrB_decode_pax_fieldrCPAX_NAME_FIELDSr.r rr_proc_gnusparse_01_proc_gnusparse_00r_proc_gnusparse_10rr3r:r,r^rr8)rrarkrrrB raw_headersrIrAheader_value_end_offsetkeyword_and_value raw_keywordequals raw_valuerrr>rr,s rDr4TarInfo._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.offsetrUsGNU.sparse.numbytesN)rrWrJr<rYlistzipr_)rr>rQoffsetsr'_rrs rDrOTarInfo._proc_gnusparse_00 s!, 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. rE,Nr.r-)rrWrYrZr_)rr>rxr_s rDrNTarInfo._proc_gnusparse_01sZ#..>"?"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.) rrtrrrWr>rr r^rYrZr_)rr>rrafieldsr_rknumbers rDrPTarInfo._proc_gnusparse_10#soo""9-iiq) V&kFQJ&C++I66))E1-KF MM#f+ & &kFQJ& #??//13vcc{F14a4L9: rFcUR5HupEUS: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.namer/rFr1zGNU.sparse.realsizerrN) rsetattrrW PAX_FIELDSPAX_NUMBER_FIELDSr<r#rr)rrrBrCrrs rDr:TarInfo._apply_pax_info3s*//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. rS)rJUnicodeDecodeError)rrrBfallback_encodingfallback_errorss rDrLTarInfo._decode_pax_fieldJs: 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-)rsr)rrrzr{s rDr9TarInfo._blockRs*#5)4  aKF !!rFc(UR[;$z4Return True if the Tarinfo object is a regular file.)r REGULAR_TYPESrs rDr TarInfo.isreg[syyM))rFc"UR5$rs)rrs rDisfileTarInfo.isfile_szz|rFc(UR[:H$)z!Return True if it is a directory.)rrrs rDr TarInfo.isdircyyG##rFc(UR[:H$)z%Return True if it is a symbolic link.)rSYMTYPErs rDr TarInfo.issymgr{rFc(UR[:H$)z!Return True if it is a hard link.)rLNKTYPErs rDr TarInfo.islnkkr{rFc(UR[:H$)z(Return True if it is a character device.)rrrs rDischr TarInfo.ischror{rFc(UR[:H$)z$Return True if it is a block device.)rrrs rDisblk TarInfo.isblksr{rFc(UR[:H$)zReturn True if it is a FIFO.)rFIFOTYPErs rDisfifoTarInfo.isfifowsyyH$$rFcURSL$r)r_rs rDissparseTarInfo.issparse{s{{$&&rFc>UR[[[4;$)zCReturn True if it is one of character device, block device or FIFO.)rrrrrs rDisdev TarInfo.isdev~syyWgx888rF)rrrrr4r6rrr2rr,r^rr1r_rr3r5r)r)7rrrrrdict __slots__rrZrasetterr/r0rrrrrr rrrr classmethodrr staticmethodrr rrr*r.r-r5r1r2r4rOrNrPr:rLr9rrwrrrrrrrrrrrFrDrrTs , ! G H    -  $ > F   * *! "/# $5% &9' *.+ ,- ./ 01 I60 ^^   [[__!!O%eeuE88*HEV/" I M8QtMM  ''R** 0-0-d<<|))( /,68wr3(; ; ..D"*$$$$$%'9rFrc\rSrSrSrSrSrSrSr\ r \ r Sr \r\rSrS:Sjr\SSS\4S j5r\S;S j5r\SSjr S?SS.Sjjr!S@SS.Sjjr"SASjr#Sr$SBSSS.Sjjr%SCSSS.S jjr&S!r'S"r(S#r)S$r*S%r+SDS&jr,S'r-S(r.S)r/S*r0S+r1S,r2S-r3S.r4S/r5S0r6SES1jr7S2r8SAS3jr9S4r:S5r;S6rS9r?g)Friz=The TarFile Class provides an interface to tar archives. rFr-NrcDSSSSS.nX/;a [S5eX lXUlU(d_URS:Xa2[RR U5(dSUlSUl[ XR5nS UlOnUcB[US 5(a1[UR[[45(a URn[US 5(aURUlS UlU(a[RRU5OS Ul X0lXlUbX@lUbXPlUbX`lUbXplUbXlXlU bUR [,:XaXlO0UlU bXlU bXlXlS Ul/UlS UlURR=5Ul0Ul URS:XaS Ul!URE5Ul!URS:Xa_URRGUR>5 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. r7zr+bwbxbrarr`!mode must be 'r', 'a', 'w' or 'x'rrFNrrTrrrr`).r<r_moderr/exists bltn_openrrrrrr^abspathrstreamrbrb dereference ignore_zerosrBrCrrdebug errorlevel copybufsizermembers_loadedr r,inodes firstmemberr>r r.rrr rrrrur>r)rrrrrbrbrrrBrCrrrrrmodesrrks rDrTarFile.__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 rDnot_compressed$TarFile.open..not_compressed:s}}X.);;rF)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)rrrrrykwargsr error_msgsrfunc saved_posrerror_msgs_summaryfilemoderrrs` rDr TarFile.opens%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 rDrTarFile.taropenps+ + +@A A4w1&11rFc 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. rrr`mode must be 'r', 'w' or 'x'r)GzipFilezgzip module is not availableNr|rrF) r<gziprrr rrrrr) rrrrrrrrrs rDgzopenTarFile.gzopenxs  &;< < 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 rDbz2openTarFile.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 rDxzopenTarFile.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) rrrrur?rr,rs RECORDSIZErr)rrzr{s rDr 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)rrrbs rD getmemberTarFile.getmembers6 //$++c"23 ?2T9: :rFc|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 rD getmembersTarFile.getmemberss' || JJL||rFc`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)rrbs rDgetnamesTarFile.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):rrrr/ splitdriverrrrbrrlstatstatfstatfilenost_modeS_ISREGst_inost_devst_nlinkrrrS_ISDIRrS_ISFIFOrS_ISLNKr}readlinkS_ISCHRrS_ISBLKrrst_uidr3st_gidr4st_sizer1st_mtimer2rrpwdgetpwuidr5rgrpgetgrgidr6rrst_rdevrrr) rrarcnamerdrvrbstatresrstmdinoders rD gettarinfoTarFile.gettarinfo s 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_IFREGr}S_IFLNKrS_IFIFOrS_IFCHRrS_IFDIRrS_IFBLKrrrrrrr5r3r6r4rrrrr1r2r localtimerrrrrr)rverboser type2moderbmodetypes rDrY TarFile.listosdllGT\\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-=-= => G7rFfiltercURS5 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 %rr7r)rrrr/r_dbgr rraddfilerrlistdiraddr)rrr recursiverrbfs rDr 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)ryr-)rrr1r<rrrbrBrCrrur,r>rrrrsrr?rr)rrbrrkryrzr{s rDrTarFile.addfiles E ?w}}7<<13DRS S))G$mmDKK D 3 s3x      w||W M &w||Y ? F1} ""3)i*?#@A!  KK6I- -K G$rFcUcPURnUcSSKnURS[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 rD_get_filter_functionTarFile._get_filter_functions >++F~ J'1 6 ,+&#&&677M F  M G!&) ) Gwvj ;<$ F Gs 'A00B ) numeric_ownerrcF/nURU5nUcUnUHdnURXvU5nUcMUR5(aURU5 UR XUR5(+US9 Mf UR SSS9 UH_n[ RRXR5n URXUS9 URX5 URX5 Ma g![an URU 5 Sn A MSn 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_attrsr+cUR$rr)rs rD$TarFile.extractall.." sqvvrFT)rreverse)r+)r)_get_extract_tarinforr _extract_onesortrr/rrchownutimechmodr _handle_nonfatal_error) rr/rr+r directoriesfilter_functionrrbdirpathrs rD extractallTarFile.extractall s  33F; ?GF//NG}}""7+   g7==?7J,9  ; -t<#Gggll46G / 7= I 7, 7, #   /++A.. /s2C:: D DD cvURU5nURXU5nUbURXrX45 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)r)r3r4)rrr/r.r+rr;rbs rDextractTarFile.extract. sA33F;++FTJ     gY F rFc[U[5(aURU5nOUnUnU"XC5nUc URSSUR-5 gUR5(aD[R"U5n[RRX4R5UlU$![[4anUR U5 SnANSnAf[ anURU5 SnANSnAff=f)z@Get filtered TarInfo (or None) from member, which might be a strNr.r)rrrrr_handle_fatal_errorr r9rrrrrr/rrr)rrr;r/rb unfilteredrs rDr3TarFile._get_extract_tarinfoA s fc " "nnV,GG  +%g4G ? IIa/*//A B ==??ii(G#%77<<6F6F#GG % (  $ $Q ' ' +  ' ' * * +s#B33DC D&C<<Dc0URS5 URU[RR X!R 5UUS9 g![ anURU5 SnAgSnAf[anURU5 SnAgSnAff=f)z%Extract from filtered tarinfo to diskrr-N) r_extract_memberrr/rrrrCr r9)rrbr/r.r+rs rDr4TarFile._extract_oneX s~ C +  "'',,t\\*J+4/< ! > (  $ $Q ' ' +  ' ' * * +s#9A BA-- B:BBcPURS:aeURSSU-5 g)z=Handle non-fatal error (ExtractError) according to errorlevelr- tarfile: %sN)rrrrs rDr9TarFile._handle_nonfatal_errore s$ ??Q   IIa* +rFcbURS: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-rJz tarfile: r)rrrfilenamerstrerrorrrrKs rDrCTarFile._handle_fatal_errorl sw ??Q   7 # #zz! !]QZZ78 !QZZHI IIaT!W-=-=qA BrFcURS5 [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)rrrrrrr8 fileobjectrrrrr extractfile_find_link_target)rrrbs rDrSTarFile.extractfilex s C fc " "nnV,GG ==??gll/A??41 1 ]]__ $,,00""KLL''(>(>w(GHHrFcURS5nURS[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-X5 O7UR.[0;aUR3X5 OURX5 U(aKUR5XU5 UR5(d#UR7X5 UR9X5 ggg)zIExtract the TarInfo object tarinfo to a physical file called targetpath. rT)exist_okr-z -> N)r#rrrr/rrmakedirsrrrrrrmakefilermakedirrmakefiforrmakedevmakelinkrr8 makeunknownr6r8r7)rrb targetpathr.r+ upperdirss rDrGTarFile._extract_member s &&s+ ''RVV4 GGOOJ/ RWW^^I66 KK D 1 ==??gmmoo IIaw||W5E5EF G IIa & ==?? MM' . ]]__ LL - ^^   MM' . ]]__  LL - ]]__  MM' . \\ 0   W 1 MM' .  JJwM :==?? 7/ 7/# rFcURc[R"U5 g[R"US5 g![a( [RR U5(degf=f)z,Make a directory called targetpath. Ni)rrmkdirFileExistsErrorr/rrrbr_s rDrZTarFile.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_rrrr1truncate)rrbr_sourcerytargetr,r1s rDrYTarFile.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)rYrrres rDr^TarFile.makeunknown s1 g* !24;LLA BrFcp[[S5(a[R"U5 g[S5e)z'Make a fifo called targetpath. mkfifozfifo not supported by systemN)rrror res rDr[TarFile.makefifo s) 2x IIj !=> >rFc[[S5(a[[S5(d [S5eURnUcSnUR 5(aU[ R -nOU[ R-n[R"X#[R"URUR55 g)z.>? ArFcbUR5(a\[RRU5(a[R"U5 [R "UR U5 g[RRUR5(a"[R"URU5 gURURU5U5 g![a? URURU5U5 g![a [S5Sef=ff=f)zMake 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. z%unable to resolve link inside archiveN)rrr/lexistsunlinksymlinkrrrlinkrGrTsymlink_exceptionrr res rDr]TarFile.makelink s  V}}77??:..IIj) 7++Z877>>'"6"677GGG00*=(()?)?)H)35  V V$$T%;%;G%D%/1 V"#JKQUU V  Vs+A0C%3AC%!C%% D.0!DD**D.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.NrHlchownzcould not change owner)rrr|r4r3rr6getgrnamrrr5getpwnamrr}r6r OverflowErrorr )rrbr_r+gurs rDr6 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. Nr7z"could not change modification time)r2rrr7rr )rrbr_r2rs rDr7 TarFile.utimeO 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-rpTr.z0x%X: %sz empty filez zlib error: )rrr,rr r rtrrbr.rrrrrYrrrr Exceptionrrrrrrrr)rmrbrrs rDr> 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<rr/normpathreversedr,r) rrrb normalizerskippingrr member_names rDrTarFile._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)rr>rrs rDr TarFile._load s4{{))+)))+)DLrFcUR(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)rrrcrr)rrs rDrTarFile._check sS ;;.4>>+B+BBC C    55 AB B!6 rFc0UR5(aQSR[S[RR UR 5UR455nSnOURnUnURX#SS9nUc[SU-5eU$)zGFind the target member of a symlink or hardlink member in the archive. rNT)rbrzlinkname %r not found) rrrrr/rrrrr)rrbrlimitrs rDrTTarFile._find_link_target s ==??xxtbggoogll.KWM]M]-^ _`HE''HEDI >2X=> > rFc#x# UR(aURShvN gSnURbUR5nUS- nUv U[ UR5:aURUnO2UR(d UR5nU(dSUlgOgUS- nUv MfN7f)z$Provide an iterator object. Nrr-T)rrrr>r>)rrrbs rD__iter__TarFile.__iter__ s <<|| # #     'iikG QJEMs4<<((,,u-\\))+#'DL QJEM $s!B:B8BB:cTXR::a[U[RS9 gg)z.Write debugging output to sys.stderr. fileN)rrrstderr)rlevelmsgs rDr TarFile._dbg s! JJ  #CJJ ' rFc&UR5 U$r)rrs rD __enter__TarFile.__enter__ s  rFcUcUR5 gUR(dURR5 SUlgr:)rrrr)rrr tracebacks rD__exit__TarFile.__exit__ s2 < JJL## ""$DKrF)rrrrrrrrBrrCrrrbrrrrrr,rrrb)NrNNNNNNrNNNNF)rN)rNr)rNN)NNNTr:r).N)rT)TFr>)@rrrrrrrrrrrbr rBrCrrbr\rRr%rrrrrrrrrrrrrr rYrrr)r=r@r3r4r9rCrSrGrZrYr^r[r\r]r6r8r7r>rrrrTrrrrrrrFrDrrs EKLJFH FGJAEHL>B6;db#tZ]/]/~22@6: I%* ? aF)D)V1"1"f%8G0+/%+/ZGG&. +, C@>B&+*0b N B?A$V2 DD? L>F&&P C&>( rFrc[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. rt)rTF)rr rr rr)rrrs rDrr$ 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.)r/rrz{!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_argsrr@exittestrrrrrrrrbrYrr>rcurdir format_helpr=createrr/splitextr)rrparserrJargsrvrtfrrtar_namer\ext compressionstar_mode tar_files file_names rDmainr9 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)krversion __author__ __credits__builtinsrrrrrHrqrrrirrerrrAttributeErrorNotImplementedErrorrry__all__r?rrrrrrrrr rr}rrrrCONTTYPErrr!rrr3rrrrr8rtr$rhrMrrWrirr getfilesystemencodingrErLr\rdrnrrrrrr rr r r rrrrYrrrobjectrr*BufferedReaderr\rrrrrrrrrrr(rcompilerHrrrrrrrFrDrs:6 H ' $%8'B *   ^                    HgGXWg#%5! #(>+ /   . 9       77d?H((*H 0& (N < *"&$ 2 y  8    x  (  (  {  ;  [    K 0rrj6