
    F\h                       S r SrSrSrSSKJr  SSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKrSSKr SSKr SSKr\\\4r/ SQrSrS	r\S
-  rSrSrSrSrSrSr Sr!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1\1r2\ \!\"\#\&\'\(\$\%\)\*\+4r3\ \!\(\+4r4\)\*\+4r5Sr61 S kr7\8\8\8\9\9\9S!.r:\Rv                  S":X  a  S#r<O\Rz                  " 5       r<S$ r>S% r?S& r@S'\24S( jrAS) rBS\S4S* jrCS+ rD " S, S-\E5      rF " S. S/\F5      rG " S0 S1\F5      rH " S2 S3\F5      rI " S4 S5\F5      rJ " S6 S7\F5      rK " S8 S9\K5      rL " S: S;\K5      rM " S< S=\K5      rN " S> S?\K5      rO " S@ SA\K5      rP " SB SC5      rQ " SD SE5      rR " SF SG\S5      rT " SH SI\S5      rU " SJ SK\	R                  5      rW " SL SM\F5      rX " SN SO\X5      rY " SP SQ\X5      rZ " SR SS\X5      r[ " ST SU\X5      r\ " SV SW\X5      r] " SX SY\X5      r^\X\\G4r_SgSZ jr`S[ raS\ rbS] rc\a\b\cS^.rd\S" 5       re\R                  " S_5      rg " S` Sa\S5      rh " Sb Sc\S5      riSd rj\iR
                  rSe rk\lSf:X  a  \k" 5         gg! \ a    Sr GN*f = f! \ a    Sr GN4f = f)hz,Read from and write to tar format archives.
z0.9.0u"   Lars Gustäbel (lars@gustaebel.de)u4   Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.    )openN)TarFileTarInfo
is_tarfileTarError	ReadErrorCompressionErrorStreamErrorExtractErrorHeaderErrorENCODINGUSTAR_FORMAT
GNU_FORMAT
PAX_FORMATDEFAULT_FORMATr   fully_trusted_filterdata_filter
tar_filterFilterErrorAbsoluteLinkErrorOutsideDestinationErrorSpecialFileErrorAbsolutePathErrorLinkOutsideDestinationErrorLinkFallbackError    i      s   ustar   s   ustar 00d         0   1   2   3   4   5   6   7   L   K   S   x   g   X      )pathlinkpathsizemtimeuidgidunamegname>   r0   r7   r6   r1   )atimectimer3   r4   r5   r2   ntutf-8c                 v    U c  [        S5      eU R                  X#5      n U SU U[        U 5      -
  [        -  -   $ )z8Convert a string to a null-terminated bytes object.
    Nzmetadata cannot contain None)
ValueErrorencodelenNUL)slengthencodingerrorss       /usr/lib/python3.13/tarfile.pystnrF      sA     	y788	"AWf:#a&C///    c                 \    U R                  S5      nUS:w  a  U SU n U R                  X5      $ )z8Convert a null-terminated bytes object to a string.
    r   N)finddecode)rA   rC   rD   ps       rE   ntsrM      s2     	
uABwbqE88H%%rG   c                 J   U S   S;   aO  Sn[        [        U 5      S-
  5       H  nUS-  nXUS-      -  nM     U S   S:X  a  S[        U 5      S-
  -  U-
  * nU$  [        U SS5      n [        U R	                  5       =(       d    S	S5      nU$ ! [
         a    [        S
5      ef = f)z/Convert a number field to a python number.
    r   )      r.      rP      asciistrict0invalid header)ranger?   rM   intstripr=   InvalidHeaderError)rA   nis      rE   ntir]      s    
 	t~s1vz"A!GA1q5MA # Q45=#a&1*%)*A H	7Aw)AAGGI$a(A H  	7$%566	7s   0B B"rQ   c                    U n[        U 5      n SU s=::  a  SUS-
  -  :  a   O  O[        SUS-
  U 4-  S5      [        -   nU$ U[        :X  au  SUS-
  -  * U s=::  a  SUS-
  -  :  a[  O  OXU S:  a  [	        S/5      nO[	        S/5      nSU-  U -   n [        US-
  5       H  nUR                  SU S-  5        U S-  n M     U$ [        S	5      e)
z/Convert a python number to a number field.
    r   rQ   r.   z%0*orS   rR   rO   rP   zoverflow in number field)rX   bytesr@   r   	bytearrayrW   insertr=   )r[   digitsformat
original_nrA   r\   s         rE   itnre      s     JAAA!fqj!!&FQJ?*G4s: H 
:	36A:#6"6!"Qcfqj>Q"Q65'"A5'"Av!Avz"AHHQE	"!GA # H 344rG   c                     S[        [        R                  " SU 5      5      -   nS[        [        R                  " SU 5      5      -   nX4$ )az  Calculate 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)sumstructunpack_from)bufunsigned_chksumsigned_chksums      rE   calc_chksumsro      sE     C 2 2< EFFO#f00sCDDM))rG   c                    U=(       d    SnUS:X  a  gUc  [         R                  " XU5        g[        X$5      u  pV[        U5       H<  nU R	                  U5      n[        U5      U:  a  U" S5      eUR                  U5        M>     US:w  a9  U R	                  U5      n[        U5      U:  a  U" S5      eUR                  U5        g)z_Copy length bytes from fileobj src to fileobj dst.
If length is None, copy the entire content.
i @  r   Nunexpected end of data)shutilcopyfileobjdivmodrW   readr?   write)	srcdstrB   	exceptionbufsizeblocks	remainderbrl   s	            rE   rs   rs      s     "G{~3W-v/F6]hhws8g455		#	  A~hhy!s8i455		#
rG   c                     [        [        R                  SS 5      nUb!  U R                  US5      R	                  U5      n [        U SS9  g )NrC   backslashreplace )end)getattrsysstdoutr>   rK   print)rA   rC   s     rE   _safe_printr     s@    szz:t4HHHX1299(C	!rG   c                       \ rS rSrSrSrg)r   i  zBase exception. N__name__
__module____qualname____firstlineno____doc____static_attributes__r   rG   rE   r   r     s    rG   r   c                       \ rS rSrSrSrg)r   i  z%General exception for extract errors.r   Nr   r   rG   rE   r   r     s    /rG   r   c                       \ rS rSrSrSrg)r   i  z&Exception for unreadable tar archives.r   Nr   r   rG   rE   r   r     s    0rG   r   c                       \ rS rSrSrSrg)r	   i  z.Exception for unavailable compression methods.r   Nr   r   rG   rE   r	   r	     s    8rG   r	   c                       \ rS rSrSrSrg)r
   i  z=Exception for unsupported operations on stream-like TarFiles.r   Nr   r   rG   rE   r
   r
     s    GrG   r
   c                       \ rS rSrSrSrg)r   i  z!Base exception for header errors.r   Nr   r   rG   rE   r   r     s    +rG   r   c                       \ rS rSrSrSrg)EmptyHeaderErrori  zException for empty headers.r   Nr   r   rG   rE   r   r     s    &rG   r   c                       \ rS rSrSrSrg)TruncatedHeaderErrori"  z Exception for truncated headers.r   Nr   r   rG   rE   r   r   "  s    *rG   r   c                       \ rS rSrSrSrg)EOFHeaderErrori%  z"Exception for end of file headers.r   Nr   r   rG   rE   r   r   %  s    ,rG   r   c                       \ rS rSrSrSrg)rZ   i(  zException for invalid headers.r   Nr   r   rG   rE   rZ   rZ   (  s    (rG   rZ   c                       \ rS rSrSrSrg)SubsequentHeaderErrori+  z3Exception for missing and invalid extended headers.r   Nr   r   rG   rE   r   r   +  s    =rG   r   c                   0    \ rS rSrSrS rS rS rS rSr	g)	_LowLevelFilei2  zwLow-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.U   n[        [         S5      (       a  U[         R                  -  n[         R                  " XS5      U l        g )NrwO_BINARYi  )	osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrr   r   fd)selfnamemodes      rE   __init___LowLevelFile.__init__8  sb    rzz)BJJ6
  2z""BKKD''$e,rG   c                 D    [         R                  " U R                  5        g N)r   closer   r   s    rE   r   _LowLevelFile.closeA  s    
rG   c                 D    [         R                  " U R                  U5      $ r   )r   ru   r   r   r2   s     rE   ru   _LowLevelFile.readD  s    wwtww%%rG   c                 F    [         R                  " U R                  U5        g r   )r   rv   r   r   rA   s     rE   rv   _LowLevelFile.writeG  s    
!rG   )r   N)
r   r   r   r   r   r   r   ru   rv   r   r   rG   rE   r   r   2  s    
-&rG   r   c                   d    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSS jrS rS rS rSrg)_StreamiJ  a  Class 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                 :   SU l         Uc  [        X5      nSU l         US:X  a  [        U5      nUR                  5       nU=(       d    SU l        X l        X0l        X@l        XPl        SU l	        SU l
        SU l         US:X  a[   SSKnXpl        UR                  S5      U l        US
:X  a"  UR"                  U l        U R'                  5         gU R)                  U5        gUS:X  aJ   SSKnUS
:X  a(  SU l        UR/                  5       U l        [2        U l        gUR5                  U5      U l        gUS:X  aO   SSKn	US
:X  a.  SU l        U	R9                  5       U l        U	R:                  U l        gU	R=                  5       U l        gUS:w  a  [        SU-  5      eg! [         a    [        S	5      Sef = f! [         a    [        S5      Sef = f! [         a    [        S5      Sef = f!   U R                   (       d  U R                  R?                  5         SU l        e = f)z$Construct a _Stream object.
        TNF* rG   r   gzzzlib module is not availabler   bz2bz2 module is not availablexzlzma module is not availabletarunknown compression type %r) _extfileobjr   _StreamProxygetcomptyper   r   comptypefileobjrz   rl   posclosedzlibImportErrorr	   crc32crcerrorry   _init_read_gz_init_write_gzr   dbufBZ2DecompressorcmpOSErrorBZ2CompressorlzmaLZMADecompressor	LZMAErrorLZMACompressorr   )
r   r   r   r   r   rz   compresslevelr   r   r   s
             rE   r   _Stream.__init__V  s     ?#D/G$Ds? #7+G**,H
		 -	4U !	::c?3;%)ZZDN&&(''6U"T 3; #DI"224DH%,DN"00?DHT!U 3; #DI#446DH%)^^DN#224DHU"&'Dx'OPP #E # U*+IJPTTU # T*+HItST # U*+IJPTTU	##""$DKsy   <G% F AG% G% G% $F1 (-G% G% -G% 4G 83G% ,G% G% F..G% 1GG% G""G% %5Hc                 l    [        U S5      (       a#  U R                  (       d  U R                  5         g g g )Nr   )r   r   r   r   s    rE   __del___Stream.__del__  s&    4""4;;JJL ,7"rG   c                    U R                   R                  UU R                   R                  U R                   R                  * U R                   R                  S5      U l        [        R                  " S[        [        R                  " 5       5      5      nU R                  SU-   S-   5        U R                  R                  S5      (       a  U R                  SS U l        [        R                  R                  U R                  5      U l        U R                  U R                  R!                  SS	5      ["        -   5        g)
z6Initialize for writing with gzip compression.
        r   <Ls   s   .gzNz
iso-8859-1replace)r   compressobjDEFLATED	MAX_WBITSDEF_MEM_LEVELr   rj   packrX   time_Stream__writer   endswithr   r0   basenamer>   r@   )r   r   	timestamps      rE   r   _Stream._init_write_gz  s     99(()-););*.))*=*=)=)-)@)@)*	,
 KKc$))+&67	(94{BC99e$$		#2DIGG$$TYY/	TYY%%lI>DErG   c                 ,   U R                   S:X  a*  U R                  R                  XR                  5      U l        U =R                  [        U5      -  sl        U R                   S:w  a  U R                  R                  U5      nU R                  U5        g)z&Write string s to the stream.
        r   r   N)	r   r   r   r   r   r?   r   compressr   r   s     rE   rv   _Stream.write  se     ==D yyq((3DHCF==E!!!!$AQrG   c                 `   U =R                   U-  sl         [        U R                   5      U R                  :  av  U R                  R	                  U R                   SU R                   5        U R                   U R                  S U l         [        U R                   5      U R                  :  a  Mu  gg)zJWrite string s to the stream if a whole new block
is ready to be written.
N)rl   r?   rz   r   rv   r   s     rE   __write_Stream.__write  sr     	A$((mdll*LLtxx67xx.DH $((mdll*rG   c                 4   U R                   (       a  gSU l          U R                  S:X  a=  U R                  S:w  a-  U =R                  U R                  R                  5       -  sl        U R                  S:X  a  U R                  (       a  U R                  R                  U R                  5        SU l        U R                  S:X  aw  U R                  R                  [        R                  " SU R                  5      5        U R                  R                  [        R                  " SU R                  S-  5      5        U R                  (       d  U R                  R                  5         gg! U R                  (       d  U R                  R                  5         f f = f)	zHClose the _Stream object. No operation should be
done on it afterwards.
NTr   r   rG   r   r   l    )r   r   r   rl   r   flushr   rv   rj   r   r   r   r   r   r   s    rE   r   _Stream.close  s	    ;;	%yyCDMMU$:DHHNN,,yyCDHH""488,==D(LL&&v{{4'BCLL&&v{{4J9N'OP##""$ $4##""$ $s   D!E) ).Fc                    U R                   R                  U R                   R                  * 5      U l        SU l        U R                  S5      S:w  a  [        S5      eU R                  S5      S:w  a  [        S5      e[        U R                  S5      5      nU R                  S5        US	-  (       aI  [        U R                  S5      5      S
[        U R                  S5      5      -  -   nU R                  U5        US-  (       a&   U R                  S5      nU(       a
  U[        :X  a  OM%  US-  (       a&   U R                  S5      nU(       a
  U[        :X  a  OM%  US-  (       a  U R                  S5        gg)z:Initialize for reading a gzip compressed fileobj.
        rG   r/   s   not a gzip filer.      zunsupported compression method      rR   rQ      N)r   decompressobjr   r   r   _Stream__readr   r	   ordru   r@   )r   flagxlenrA   s       rE   r   _Stream._init_read_gz  s+    99**DII,?,?+?@	 ;;q>[(-..;;q>W$"#CDD4;;q>"A!8t{{1~&s4;;q>/B)BBDIIdO!8KKNAH  "9KKNAH  !8KKN rG   c                     U R                   $ )z3Return the stream's file pointer position.
        )r   r   s    rE   tell_Stream.tell  s     xxrG   c                    XR                   -
  S:  an  [        XR                   -
  U R                  5      u  p#[        U5       H  nU R	                  U R                  5        M      U R	                  U5        U R                   $ [        S5      e)zESet the stream's file pointer to pos. Negative seeking
is forbidden.
r   z seeking backwards is not allowed)r   rt   rz   rW   ru   r
   )r   r   r{   r|   r\   s        rE   seek_Stream.seek  sn     >Q &sXX~t|| DF6]		$,,' #IIi  xx @AArG   c                 n    Uc   eU R                  U5      nU =R                  [        U5      -  sl        U$ )z5Return the next size number of bytes from the stream.)_readr   r?   )r   r2   rl   s      rE   ru   _Stream.read  s3    jjCH
rG   c                 @   U R                   S:X  a  U R                  U5      $ [        U R                  5      nU R                  /nX!:  a  U R                  (       a  U R                  nSU l        O-U R
                  R                  U R                  5      nU(       d  OB U R                  R                  U5      nUR                  U5        U[        U5      -  nX!:  a  M  SR                  U5      nX1S U l        USU $ ! U R                   a  n[        S5      UeSnAff = f)z+Return size bytes from the stream.
        r   rG   zinvalid compressed dataN)r   r  r?   r   rl   r   ru   rz   r   
decompressry   r   appendjoin)r   r2   ctrl   es         rE   r  _Stream._read  s     ==E!;;t$$		NYYKhxxhhll''5Bhh))#. HHSMSMA h HHQKeH	$x >> B 9:ABs   C< <DDDc                 4   [        U R                  5      nU R                  /nX!:  aS  U R                  R                  U R                  5      nU(       d  O&UR                  U5        U[        U5      -  nX!:  a  MS  SR                  U5      nX1S U l        USU $ )z`Return size bytes from stream. If internal buffer is empty,
read another block from the stream.
rG   N)r?   rl   r   ru   rz   r  r  )r   r2   r  r  rl   s        rE   __read_Stream.__read.  s     MXXJh,,##DLL1CHHSMSMA h HHQKU8$xrG   )r   rl   rz   r   r   r   r   r   ry   r   r   r   r   r   N)r   )r   r   r   r   r   r   r   r   rv   r   r   r   r
  r  ru   r  r  r   r   rG   rE   r   r   J  sF    	ENF"/%,>
6rG   r   c                   0    \ rS rSrSrS rS rS rS rSr	g)	r   i?  zhSmall proxy class that enables transparent compression
detection for the Stream interface (mode 'r|*').
c                 X    Xl         U R                   R                  [        5      U l        g r   )r   ru   	BLOCKSIZErl   )r   r   s     rE   r   _StreamProxy.__init__D  s    <<$$Y/rG   c                 P    U R                   R                  U l        U R                  $ r   )r   ru   rl   r   s     rE   ru   _StreamProxy.readH  s    LL%%	xxrG   c                     U R                   R                  S5      (       a  gU R                   SS S:X  a  U R                   SS S:X  a  g	U R                   R                  S
5      (       a  gg)Ns   r   r      s   BZhr  
   s   1AY&SYr   )s   ]  s   7zXZr   r   )rl   
startswithr   s    rE   r   _StreamProxy.getcomptypeL  s\    88//XXa]f$!B9)DXX  !CDDrG   c                 8    U R                   R                  5         g r   )r   r   r   s    rE   r   _StreamProxy.closeV  s    rG   )rl   r   ru   N)
r   r   r   r   r   r   ru   r   r   r   r   rG   rE   r   r   ?  s    0rG   r   c                       \ rS rSrSrSS jrS r\S 5       rS r	S r
S	 rS
 r\R                  4S jrSS jrS rS rSrg)_FileInFilei]  zmA thin wrapper around an existing file object that
provides a part of its data as an individual file
object.
Nc                    Xl         X l        X0l        SU l        X@l        SU l        Uc  SU4/nSU l        / U l        SnU R                  nU HQ  u  p#X&:  a  U R                  R                  SXbS 45        U R                  R                  SX"U-   U45        Xs-  nX#-   nMS     X`R                  :  a)  U R                  R                  SX`R                  S 45        g g )Nr   FT)	r   offsetr2   positionr   r   	map_indexmapr  )r   r   r-  r2   r   	blockinfolastposrealposs           rE   r   _FileInFile.__init__c  s    		TI ++%LF >?HHOOT6D='BCOGmG & YYHHOOUGYY=> rG   c                     g r   r   r   s    rE   r   _FileInFile.flush|  s    rG   c                     g)Nrbr   r   s    rE   r   _FileInFile.mode  s    rG   c                     gNTr   r   s    rE   readable_FileInFile.readable  s    rG   c                     gNFr   r   s    rE   writable_FileInFile.writable  s    rG   c                 6    U R                   R                  5       $ r   )r   seekabler   s    rE   rC  _FileInFile.seekable  s    ||$$&&rG   c                     U R                   $ )z*Return the current file position.
        )r.  r   s    rE   r
  _FileInFile.tell       }}rG   c                 8   U[         R                  :X  a1  [        [        US5      U R                  5      U l        U R
                  $ U[         R                  :X  ae  US:  a*  [        U R
                  U-   S5      U l        U R
                  $ [        U R
                  U-   U R                  5      U l         U R
                  $ U[         R                  :X  a>  [        [        U R                  U-   U R                  5      S5      U l        U R
                  $ [        S5      e)z(Seek to a position in the file.
        r   zInvalid argument)	ioSEEK_SETminmaxr2   r.  SEEK_CURSEEK_ENDr=   )r   r.  whences      rE   r  _FileInFile.seek  s     R[[ Ha 0$))<DM }} r{{"!| #DMMH$<a @ }} !$DMMH$<dii H
 }}	 r{{"DII$8$)) DaHDM }} /00rG   c                    Uc  U R                   U R                  -
  nO"[        XR                   U R                  -
  5      nSnUS:  Ga)   U R                  U R                     u  p4pVX@R                  s=::  a  U:  a  O  OOAU =R                  S-  sl        U R                  [        U R                  5      :X  a  SU l        Mw  [        XU R                  -
  5      nU(       ad  U R                  R                  X`R                  U-
  -   5        U R                  R                  U5      n[        U5      U:w  a  [        S5      eX(-  nOU[        U-  -  nX-  nU =R                  U-  sl        US:  a  GM)  U$ )z!Read data from the file.
        rG   r   r.   rq   )r2   r.  rK  r0  r/  r?   r   r  ru   r   r@   )	r   r2   rl   datastartstopr-  rB   r}   s	            rE   ru   _FileInFile.read  s4    <99t}},DtYY67DQh,0HHT^^,D)TMM0D0NNa'N~~TXX6)*  dmm34F!!&MME,A"BCLL%%f-q6V##$<==sV|#NDMMV#M' Qh( 
rG   c                 f    U R                  [        U5      5      nX!S [        U5      & [        U5      $ r   )ru   r?   )r   r}   rl   s      rE   readinto_FileInFile.readinto  s*    iiA)3s83xrG   c                     SU l         g r;  )r   r   s    rE   r   _FileInFile.close  s	    rG   )r   r   r0  r/  r   r-  r.  r2   r   )r   r   r   r   r   r   r   propertyr   r<  r@  rC  r
  rI  rJ  r  ru   rW  r   r   r   rG   rE   r+  r+  ]  sV    
?2  '
 %'KK  >
rG   r+  c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ExFileObjecti  c                    > [        UR                  UR                  UR                  UR                  UR
                  5      n[        TU ]  U5        g r   )r+  r   offset_datar2   r   sparsesuperr   )r   tarfiletarinfor   	__class__s       rE   r   ExFileObject.__init__  s;    goow/B/BgllGNN<!rG   r   r   r   r   r   r   r   __classcell__rd  s   @rE   r]  r]    s    " "rG   r]  c                       \ rS rSrSrg)r   i  r   N)r   r   r   r   r   r   rG   rE   r   r     s    rG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 N   > Xl         [        TU ]	  SUR                  < S35        g )Nzmember z has an absolute pathrc  ra  r   r   r   rc  rd  s     rE   r   AbsolutePathError.__init__  s$    77<<"22GHIrG   rc  rf  rh  s   @rE   r   r     s    J JrG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 f   > Xl         X l        [        TU ]  UR                  < SU< S3S-   5        g )Nz would be extracted to ,  which is outside the destinationrc  _pathra  r   r   r   rc  r0   rd  s      rE   r    OutsideDestinationError.__init__  s7    
GLL++B4("M=> 	?rG   ru  rc  rf  rh  s   @rE   r   r         ? ?rG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 L   > Xl         [        TU ]	  UR                  < S35        g )Nz is a special filerl  rm  s     rE   r   SpecialFileError.__init__  s"    GLL++=>?rG   ro  rf  rh  s   @rE   r   r     s    @ @rG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 L   > Xl         [        TU ]	  UR                  < S35        g )Nz is a link to an absolute pathrl  rm  s     rE   r   AbsoluteLinkError.__init__  s"    GLL++IJKrG   ro  rf  rh  s   @rE   r   r     s    L LrG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 f   > Xl         X l        [        TU ]  UR                  < SU< S3S-   5        g )Nz would link to rr  rs  rt  rv  s      rE   r   $LinkOutsideDestinationError.__init__  s6    
GLL+?4("E=> 	?rG   rx  rf  rh  s   @rE   r   r     ry  rG   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i  c                 j   > Xl         X l        [        TU ]  SUR                  < S3SU< S3-   5        g )Nzlink z would be extracted as a zcopy of z, which was rejectedrt  rv  s      rE   r   LinkFallbackError.__init__  s?    
5 00IJ%dX-ABC 	DrG   rx  rf  rh  s   @rE   r   r     s    D DrG   r   c                    0 nU R                   n[        R                  R                  U[        R                  R                  S9nUR                  S[        R                  45      (       a0  U R                  R                  S[        R                  -   5      =oCS'   [        R                  R                  U5      (       a  [        U 5      e[        R                  R                  [        R                  R                  X5      [        R                  R                  S9n[        R                  R                  XQ/5      U:w  a  [        X5      eU R                  nUb  US-  nU(       aw  U R                  5       (       d  U R                  5       (       a  US-  (       d  US-  nUS-  nO8U R!                  5       (       d  U R#                  5       (       a  S nO[%        U 5      eX`R                  :w  a  XcS'   U(       Ga  U R&                  b  S US	'   U R(                  b  S US
'   U R*                  b  S US'   U R,                  b  S US'   U R                  5       (       d  U R#                  5       (       Gab  [        R                  R                  U R.                  5      (       a  [1        U 5      e[        R                  R3                  U R.                  5      nXpR.                  :w  a  XsS'   U R#                  5       (       aI  [        R                  R                  U[        R                  R5                  U5      U R.                  5      nO*[        R                  R                  UU R.                  5      n[        R                  R                  U[        R                  R                  S9n[        R                  R                  XQ/5      U:w  a  [7        X5      eU$ )N)rT   /r   i  @   i  r   r4   r5   r6   r7   linkname)r   r   r0   realpathALLOW_MISSINGr&  seplstripisabsr   r  
commonpathr   r   isregislnkisdirissymr   r4   r5   r6   r7   r  r   normpathdirnamer   )member	dest_pathfor_data	new_attrsr   target_pathr   
normalizeds           rE   _get_filtered_attrsr    s   I;;D  2773H3H II RVV}%%#);;#5#5cBFFl#CC 	ww}}T  ''''""277<<	#@*,''*?*? # AK	ww;23y@%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 + IKww!!;":;yH1&FFrG   c                     U $ r   r   )r  r  s     rE   r   r   F  s    MrG   c                 X    [        XS5      nU(       a  U R                  " S0 UDSS0D6$ U $ )NFdeepr   r  r   r  r  r  s      rE   r   r   I  s-    #Fu=I~~6	666MrG   c                 X    [        XS5      nU(       a  U R                  " S0 UDSS0D6$ U $ )NTr  Fr   r  r  s      rE   r   r   O  s-    #Ft<I~~6	666MrG   )fully_trustedr   rR  s   ([0-9]{1,20}) c                      \ rS rSrSr\" SX0 SS_SS_SS_S	S
_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S&_S(S&_6rSYS) jr\S* 5       r	\	R                  S+ 5       r	\S, 5       r\R                  S- 5       r\S. 5       r\R                  S/ 5       rS0 r\\\\\\\\S1\S2.
S3 jrS4 r\\S54S6 jrS7 rS8 rS9 r\S: 5       rS; r\S< 5       r\S= 5       r\S> 5       r\S? 5       r\S@ 5       r\SA 5       r SB r!SC r"SD r#SE r$SF r%SG r&SH r'SI r(SJ r)SK r*SL r+SM r,SN r-SO r.SP r/SQ r0SR r1SS r2ST r3SU r4SV r5SWr6g&)Zr   ie  zInformational 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.
r   zName of the archive member.r   zPermission bits.r4   z6User ID of the user who originally stored this member.r5   z7Group ID of the user who originally stored this member.r2   zSize in bytes.r3   zTime of last modification.chksumzHeader checksum.typezFile type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.r  zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.r6   z
User name.r7   zGroup name.devmajorzDevice major number.devminorzDevice minor number.r-  zThe tar header starts here.r_  zThe file's data starts here.pax_headerszMA dictionary containing key-value pairs of an associated pax extended header.r`  zSparse member information._tarfileN_sparse_structs_link_targetc                     Xl         SU l        SU l        SU l        SU l        SU l        SU l        [        U l        SU l	        SU l
        SU l        SU l        SU l        SU l        SU l        SU l        0 U l        g)zEConstruct a TarInfo object. name is the optional name
of the member.
i  r   r   N)r   r   r4   r5   r2   r3   r  REGTYPEr  r  r6   r7   r  r  r-  r_  r`  r  r   r   s     rE   r   TarInfo.__init__  s{     			
	

rG   c                 L    SS K nUR                  S[        SS9  U R                  $ Nr   zhThe undocumented "tarfile" attribute of TarInfo objects is deprecated and will be removed in Python 3.16r/   
stacklevelwarningswarnDeprecationWarningr  )r   r  s     rE   rb  TarInfo.tarfile  s-    A1 	 	. }}rG   c                 B    SS K nUR                  S[        SS9  Xl        g r  r  )r   rb  r  s      rE   rb  r    s(    A1 	 	.  rG   c                     U R                   $ )z(In pax headers, "name" is called "path".r   r   s    rE   r0   TarInfo.path  s     yyrG   c                     Xl         g r   r  r  s     rE   r0   r    s    	rG   c                     U R                   $ )z0In pax headers, "linkname" is called "linkpath".r  r   s    rE   r1   TarInfo.linkpath  rG  rG   c                     Xl         g r   r  )r   r  s     rE   r1   r    s     rG   c                 `    SU R                   R                  U R                  [        U 5      4-  $ )Nz<%s %r at %#x>)rd  r   r   idr   s    rE   __repr__TarInfo.__repr__  s&    4>>#:#:499RX"NNNrG   T)
r   r3   r   r  r4   r5   r6   r7   r  _KEEPc       
            U	(       a  [         R                  " U 5      nO[         R                   " U 5      nXLa  Xl        X*La  X+l        X:La  X;l        XJLa  XKl        XZLa  X[l        XjLa  Xkl        XzLa  X{l        XLa  Xl	        U$ )zGReturn a deep copy of self with the given attributes replaced.
        )
copydeepcopyr   r3   r   r  r4   r5   r6   r7   )r   r   r3   r   r  r4   r5   r6   r7   r  r  results               rE   r   TarInfo.replace  s     ]]4(FYYt_FK LK &OJJ L LrG   c                    U R                   c  SnOU R                   S-  nU R                  UU R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  S.nUS   [        :X  a&  US   R                  S5      (       d  US==   S-  ss'   U$ )z9Return the TarInfo's attributes as a dictionary.
        N  )r   r   r4   r5   r2   r3   r  r  r  r6   r7   r  r  r  r   r  )r   r   r4   r5   r2   r3   r  r  r  r6   r7   r  r  DIRTYPEr   )r   r   infos      rE   get_infoTarInfo.get_info  s     99D99v%D				

		




  <7"4<+@+@+E+ELCLrG   surrogateescapec                 2   U R                  5       nUR                  5        H  u  pVUb  M
  [        SU-  5      e   U[        :X  a  U R	                  XBU5      $ U[
        :X  a  U R                  XBU5      $ U[        :X  a  U R                  XB5      $ [        S5      e)z<Return a tar header as a string of 512 byte blocks.
        z%s may not be Nonezinvalid format)	r  itemsr=   r   create_ustar_headerr   create_gnu_headerr   create_pax_header)r   rc   rC   rD   r  r   values          rE   tobufTarInfo.tobuf  s     }}::<KD} !5!<== ( \!++DFCCz!))$&AAz!))$99-..rG   c                 (   [         US'   [        US   R                  X#5      5      [        :  a  [	        S5      e[        US   R                  X#5      5      [
        :  a  U R                  US   X#5      u  US'   US'   U R                  U[        X#5      $ )z3Return the object as a ustar header block.
        magicr  zlinkname is too longr   prefix)	POSIX_MAGICr?   r>   LENGTH_LINKr=   LENGTH_NAME_posix_split_name_create_headerr   )r   r  rC   rD   s       rE   r  TarInfo.create_ustar_header  s     $WtJ&&x89KG344tF|""845C+/+A+A$v,PX+a(DNDL""4xHHrG   c                 N   [         US'   Sn[        US   R                  X#5      5      [        :  a  X@R	                  US   [
        X#5      -  n[        US   R                  X#5      5      [        :  a  X@R	                  US   [        X#5      -  nX@R                  U[        X#5      -   $ )z:Return the object as a GNU header block sequence.
        r  rG   r  r   )
	GNU_MAGICr?   r>   r  _create_gnu_long_headerGNUTYPE_LONGLINKr  GNUTYPE_LONGNAMEr  r   )r   r  rC   rD   rl   s        rE   r  TarInfo.create_gnu_header  s     "WtJ&&x89KG//Z0@BRT\eeCtF|""845C//V>NPXaaC((z8LLLrG   c                    [         US'   U R                  R                  5       nSS[        4SS[        4SS4 H;  u  pEnXS;   a  M   X   R                  SS	5        [        X   5      U:  d  M5  X   X5'   M=     S
 Hu  u  pGSnX   n	[        U	[        5      n
U
(       a  [        U	5      OU	nSUs=::  a  SUS-
  -  :  d	  O  SX'   SnOU
(       a  XU'   SnU(       d  Ma  XC;  d  Mh  [        U	5      X4'   Mw     U(       a  U R                  U[        U5      nOSnXR                  U[        SS5      -   $ ! [         a    X   X5'    GM	  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.
r  r   r0   r  r1   )r6   r6       )r7   r7   r  rS   rT   ))r4   rQ   )r5   rQ   )r2      )r3   r  Fr   rQ   r.   TrG   r   )r  r  r  r  r  r>   UnicodeEncodeErrorr?   
isinstancefloatroundstr_create_pax_generic_headerXHDTYPEr  r   )r   r  rC   r  r   hnamerB   rb   	needs_paxvalval_is_floatval_intrl   s                rE   r  TarInfo.create_pax_header+  sb   
 $W&&++-
 -
J/T&(>$@D #
!!'84
 4:'%)Z"!$@( RLDI*C%c51L$0eCjcG3!
"33
 	 %T
 	 yT4$'H!% R* 11+wQCC((|WiPPPG & %)Z"s   D--EEc                 0    U R                  U[        S5      $ )zAReturn the object as a pax global header block sequence.
        r;   )r  XGLTYPE)clsr  s     rE   create_pax_global_header TarInfo.create_pax_global_headere  s     --k7GLLrG   c                 T   UR                  S5      n[        S[        U5      5       Ht  nSR                  USU 5      nSR                  XES 5      n[        UR	                  X#5      5      [
        ::  d  MN  [        UR	                  X#5      5      [        ::  d  Mr    Xa4$    [        S5      e)zBSplit a name longer than 100 chars into a prefix
and a name part.
r  r.   Nzname is too long)splitrW   r?   r  r>   LENGTH_PREFIXr  r=   )r   r   rC   rD   
componentsr\   r  s          rE   r  TarInfo._posix_split_namek  s     ZZ_
q#j/*AXXj!n-F88JrN+D6==23}DH56+E | + /00rG   c                 j   U R                  S5      [        [        4;   nU(       a;  [        U R                  SS5      SU5      n[        U R                  SS5      SU5      nO[	        SSX#5      n[	        SSX#5      nU R                  S[
        5      nUc  [        S5      e[	        U R                  S	S5      S
X#5      [        U R                  SS5      S-  SU5      [        U R                  SS5      SU5      [        U R                  SS5      SU5      [        U R                  SS5      SU5      [        U R                  SS5      SU5      SU[	        U R                  SS5      S
X#5      U R                  S[        5      [	        U R                  SS5      SX#5      [	        U R                  SS5      SX#5      UU[	        U R                  SS5      SX#5      /n[        R                  " S[        -  SR                  U5      5      n	[        U	[        * S 5      S   n
U	SS [        SU
-  S5      -   U	SS -   n	U	$ ) zqReturn a header block. info is a dictionary with file
information, format must be one of the *_FORMAT constants.
r  r  r   rQ   r  r   NzTarInfo.type must not be Noner   r   r   r  r4   r5   r2   r  r3   s           r  r  r6   r  r7   r  r   z%dsrG   iz%06o rS   i)getCHRTYPEBLKTYPEre   rF   r  r=   r  rj   r   r  r  ro   r_   )r  rc   rC   rD   has_device_fieldsr  r  filetypepartsrl   r  s              rE   r  TarInfo._create_header{  s   
 !HHV,'0BB488J2Av>H488J2Av>H2q(3H2q(3H 88FG,<== $c8<#f,a8"Av."Av.#R0!$b&1R(#x@HHWk*"%r8<"%r8<2&X>
$ kk%)+SXXe_=c9*+./2%4j5F!2G<<s45zI
rG   c                 n    [        [        U 5      [        5      u  pUS:  a  U [        U-
  [        -  -  n U $ )zQReturn the string payload filled with zero bytes
up to the next 512 byte border.
r   )rt   r?   r  r@   )payloadr{   r|   s      rE   _create_payloadTarInfo._create_payload  s7    
 #3w<;q=	I-44GrG   c                     UR                  X45      [        -   n0 nSUS'   X%S'   [        U5      US'   [        US'   U R	                  U[
        X45      U R                  U5      -   $ )zAReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
for name.
z././@LongLinkr   r  r2   r  )r>   r@   r?   r  r  r   r  )r  r   r  rC   rD   r  s         rE   r  TarInfo._create_gnu_long_header  sn    
 {{8,s2&VV4yV!W !!$hG##D)* 	*rG   c                    SnUR                  5        H  u  pV UR                  SS5        M     SnU(       a  US-  nUR                  5        H  u  pVUR                  S5      nU(       a  UR                  US5      nOUR                  S5      n[        U5      [        U5      -   S-   nS	=p U[        [	        U
5      5      -   n	X:X  a  OU	n
M!  U[        [	        U
5      S
5      S-   U-   S-   U-   S-   -  nM     0 nSUS'   X+S'   [        U5      US'   [        US'   U R                  U[        S
S5      U R                  U5      -   $ ! [         a    Sn   GM&  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;   rT   TrG   s   21 hdrcharset=BINARY
r  r$  r   rS          =   
z././@PaxHeaderr   r  r2   r  r   )
r  r>   r  r?   r  r_   r  r  r   r  )r  r  r  rC   binarykeywordr  recordslr[   rL   r  s               rE   r  "TarInfo._create_pax_generic_header  sw    )//1NGWh/ 2 00G)//1NGnnW-G X/@AW-Gs5z)A-AIACFO6	 
 uSVW-4w>EMPUUUG! 2( 'VV7|V#W !!$gyI##G,- 	-I & s   EEEc                    [        U5      S:X  a  [        S5      e[        U5      [        :w  a  [        S5      eUR	                  [
        5      [        :X  a  [        S5      e[        USS 5      nU[        U5      ;  a  [        S5      eU " 5       n[        USS X#5      Ul        [        USS	 5      Ul        [        US	S
 5      Ul        [        US
S 5      Ul        [        USS 5      Ul        [        USS 5      Ul        XEl        USS Ul        [        USS X#5      Ul        [        USS X#5      Ul        [        USS X#5      Ul        [        USS 5      Ul        [        USS 5      Ul        [        USS X#5      nUR$                  [0        :X  a+  UR                  R3                  S5      (       a  [4        Ul        UR$                  [6        :X  av  Sn/ n[9        S5       H>  n	 [        XUS-    5      n
[        XS-   US-    5      nUR=                  X45        US-  nM@     [?        US   5      n[        USS 5      nXU4Ul         URC                  5       (       a   UR                  RE                  S5      Ul        U(       a+  UR$                  [F        ;  a  US-   UR                  -   Ul        U$ ! [:         a       M  f = f)zAConstruct a TarInfo object from a 512 byte bytes object.
        r   zempty headerztruncated headerzend of file header      zbad checksumr   l   t   |         i  i	  i)  iI  iQ  iY  i  r  i  r  r     i  i  i  )$r?   r   r  r   countr@   r   r]   ro   rZ   rM   r   r   r4   r5   r2   r3   r  r  r  r6   r7   r  r  AREGTYPEr   r  GNUTYPE_SPARSErW   r=   r  boolr  r  rstrip	GNU_TYPES)r  rl   rC   rD   r  objr  r   structsr\   r-  numbytes
isextendedorigsizes                 rE   frombufTarInfo.frombuf  s    s8q=">22s8y &'9::99S>Y& !566SS\"c**$^44es1Sz84s3s|$c#cl#c#cl#s3s|$C%	
s3<3s3<:Ch7	Ch7	3s3<(3s3<(SS\84 88xCHH$5$5c$:$:CH
 88~%CG1X r!23F"3Rxb#9:H 12r	  c#hJ3s3<(H#*"AC 99;;xxs+CH chhi/|chh.CH
 " s   *#J66
KKc                     UR                   R                  [        5      nU R                  X!R                  UR
                  5      nUR                   R                  5       [        -
  Ul        UR                  U5      $ )z<Return the next TarInfo object from TarFile object
tarfile.
)	r   ru   r  r1  rC   rD   r
  r-  _proc_member)r  rb  rl   r,  s       rE   fromtarfileTarInfo.fromtarfile2  s\    
 oo""9-kk#//@__))+i7
((rG   c                 $   U R                   [        [        4;   a  U R                  U5      $ U R                   [        :X  a  U R                  U5      $ U R                   [        [        [        4;   a  U R                  U5      $ U R                  U5      $ )zFChoose the right processing method depending on
the type and call it.
)r  r  r  _proc_gnulongr(  _proc_sparser  r  SOLARIS_XHDTYPE	_proc_pax_proc_builtin)r   rb  s     rE   r4  TarInfo._proc_memberG  sx     99)+;<<%%g..YY.($$W--YY7G_==>>'**%%g..rG   c                    UR                   R                  5       U l        U R                  nU R                  5       (       d  U R                  [
        ;  a  X R                  U R                  5      -  nX!l        U R                  UR                  UR                  UR                  5        U R                  5       (       a   U R                  R                  S5      U l        U $ )zSProcess a builtin type or an unknown type which
will be treated as a regular file.
r  )r   r
  r_  r  r  SUPPORTED_TYPES_blockr2   r-  _apply_pax_infor  rC   rD   r  r   r*  )r   rb  r-  s      rE   r<  TarInfo._proc_builtinT  s     #??//1!!::<<499O;kk$)),,F 	W00'2B2BGNNS ::<<		((-DIrG   c                 R   UR                   R                  U R                  U R                  5      5      n U R	                  U5      nU R                  Ul        U R                  [        :X  a&  [        X!R                  UR                  5      Ul        O9U R                  [        :X  a%  [        X!R                  UR                  5      Ul        UR#                  5       (       a   UR                  R%                  S5      Ul        U$ ! [
         a  n[        [        U5      5      SeSnAff = f)z@Process the blocks that hold a GNU longname
or longlink member.
Nr  )r   ru   r@  r2   r5  r   r   r  r-  r  r  rM   rC   rD   r   r  r  r  removesuffix)r   rb  rl   nextr  s        rE   r8  TarInfo._proc_gnulongj  s     oo""4;;tyy#9:	:##G,D kk99((C!1!17>>BDIYY**%5%5w~~FDM ::<<		..s3DI!  	:'A/T9	:s   D 
D&D!!D&c                 0   U R                   u  p#nU ? U(       a  UR                  R                  [        5      nSn[	        S5       HL  n [        XVUS-    5      n[        XVS-   US-    5      n	U(       a  U	(       a  UR                  X45        US-  nMN     [        US   5      nU(       a  M  X l	        UR                  R                  5       U l        U R                  U R                  U R                  5      -   Ul        X@l        U $ ! [         a       M  f = f)z8Process a GNU sparse header plus extra headers.
        r      r  r%  i  )r  r   ru   r  rW   r]   r=   r  r)  r`  r
  r_  r@  r2   r-  )
r   rb  r-  r/  r0  rl   r   r\   r-  r.  s
             rE   r9  TarInfo._proc_sparse  s    )-(<(<%X  //&&y1CC2Y r!23F"3Rxb#9:H hNNF#56r	  c#hJ j "??//1))DKK		,BB	 " s   	#D
DDc                 H   UR                   R                  U R                  U R                  5      5      nU R                  [
        :X  a  UR                  nOUR                  R                  5       nSnSn/ n[        U5      U:  Ga(  X$   S:w  Ga  [        R                  X$5      =n(       d  [        S5      e [        UR                  S5      5      nUS:  a  [        S5      eXH-   [        U5      :  a  [        S5      eUR                  S5      U-   S-
  n	X'R!                  S5      S-   U	 n
U
R#                  S5      u  pnU(       a  US:w  d  X)   S:w  a  [        S5      eUR%                  XU45        US:X  a  Uc  US	:X  a  UR&                  nOS
nXH-  n[        U5      U:  a  X$   S:w  a  GM  Uc  S
nU Hx  u  pnU R)                  US
S
UR*                  5      nU[,        ;   a(  U R)                  XUR&                  UR*                  5      nOU R)                  US
S
UR*                  5      nXU'   Mz      U R/                  U5      nSU;   a  U R7                  UU5        OUSU;   a  U R9                  UU5        O<UR;                  S5      S:X  a'  UR;                  S5      S:X  a  U R=                  UX15        U R                  [>        [@        4;   a  URC                  X1R&                  UR*                  5        U RD                  Ul"        SU;   aZ  URF                  nURI                  5       (       d  UR                  [J        ;  a  UUR                  UR                  5      -  nUUl"        U$ ! [         a    [        S5      ef = f! [0         a  n[3        [5        U5      5      SeSnAff = f)zCProcess an extended or global header as described in
POSIX.1-2008.
r   NrV   r.      r  r%  s
   hdrcharsets   BINARYr;   GNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrU   r2   )&r   ru   r@  r2   r  r  r  r  r?   _header_length_prefix_rematchrZ   rX   groupr=   rS  r   	partitionr  rC   _decode_pax_fieldrD   PAX_NAME_FIELDSr5  r   r   r  _proc_gnusparse_01_proc_gnusparse_00r  _proc_gnusparse_10r  r:  rA  r-  r_  r  r?  )r   rb  rl   r  r   rC   raw_headersrP  rB   header_value_end_offsetkeyword_and_valueraw_keywordequals	raw_valuer  r  rE  r  r-  s                      rE   r;  TarInfo._proc_pax  so   
 oo""4;;tyy#9:
 99!--K!--224K #hnT!15;;CEEEE()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 #hnT!1R H /:*F ,,['7NN$G/)..yGDTDT( ..y'7( $) # /:(	:##G,D
 {*##D+6+-##D+6__/0C7KOOL^<_cf<f##D+?99/22  .>.>O++DK$ ))::<<499O#Cdkk$))44F!'y  ;()9::;|  	:'A/T9	:s$   7M$ 2M= $M:=
N!NN!c                 ~   / n/ nU Hh  u  pVnUS:X  a+   UR                  [        UR                  5       5      5        M7  US:X  d  M?   UR                  [        UR                  5       5      5        Mj     [        [        X45      5      Ul        g! [         a    [	        S5      ef = f! [         a    [	        S5      ef = f)z?Process a GNU tar extended sparse header, version 0.0.
        s   GNU.sparse.offsetrV   s   GNU.sparse.numbytesN)r  rX   rK   r=   rZ   listzipr`  )r   rE  rX  offsetsr.  _r  r  s           rE   rV  TarInfo._proc_gnusparse_00  s     !,A..?NN3u||~#67 22?OOC$78 "- 3w12 " ?,-=>>? " ?,-=>>?s   (B(B&B#&B<c           	          US   R                  S5       Vs/ s H  n[        U5      PM     nn[        [        USSS2   USSS2   5      5      Ul        gs  snf )z?Process a GNU tar extended sparse header, version 0.1.
        rL  ,Nr/   r.   )r  rX   r`  ra  r`  )r   rE  r  xr`  s        rE   rU  TarInfo._proc_gnusparse_01.  sZ     #..>"?"E"Ec"JK"JQ#a&"JK3vcc{F14a4L9: Ls   Ac           	         Sn/ nUR                   R                  [        5      nUR                  SS5      u  pF[	        U5      n[        U5      US-  :  ai  SU;  a!  XcR                   R                  [        5      -  nUR                  SS5      u  pvUR                  [	        U5      5        [        U5      US-  :  a  Mi  UR                   R                  5       Ul        [        [        USSS2   USSS2   5      5      Ul        g)z?Process a GNU tar extended sparse header, version 1.0.
        Nr  r.   r/   )r   ru   r  r  rX   r?   r  r
  r_  r`  ra  r`  )r   rE  r  rb  fieldsr`  rl   numbers           rE   rW  TarInfo._proc_gnusparse_104  s     oo""9-iiq)V&kFQJ&C++I66))E1-KFMM#f+&	 &kFQJ&
 #??//13vcc{F14a4L9:rG   c                    UR                  5        H  u  pEUS:X  a  [        U SU5        M  US:X  a  [        U S[        U5      5        M8  US:X  a  [        U S[        U5      5        MV  U[        ;   d  Mb  U[        ;   a   [        U   " U5      nUS:X  a  UR                  S5      n[        XU5        M     UR                  5       U l        g! [
         a    Sn NKf = f)	z\Replace fields with supplemental information from a previous
pax extended or global header.
zGNU.sparse.namer0   rM  r2   zGNU.sparse.realsizer   r  N)	r  setattrrX   
PAX_FIELDSPAX_NUMBER_FIELDSr=   r*  r  r  )r   r  rC   rD   r  r  s         rE   rA  TarInfo._apply_pax_infoD  s     *//1NG++fe,--fc%j111fc%j1J&//" 1' :5 A f$!LL-Eu- 2" '++- & " !"s   >C

CCc                 j     UR                  US5      $ ! [         a    UR                  X45      s $ f = f)z1Decode a single field from a pax record.
        rT   )rK   UnicodeDecodeError)r   r  rC   fallback_encodingfallback_errorss        rE   rS  TarInfo._decode_pax_field[  s:    	D<<(33! 	D<< 1CC	Ds    22c                 P    [        U[        5      u  p#U(       a  US-  nU[        -  $ )zLRound up a byte count by BLOCKSIZE and return it,
e.g. _block(834) => 1024.
r.   )rt   r  )r   r&  r{   r|   s       rE   r@  TarInfo._blockc  s*     #5)4aKF	!!rG   c                 (    U R                   [        ;   $ z4Return True if the Tarinfo object is a regular file.)r  REGULAR_TYPESr   s    rE   r  TarInfo.isregl  s    yyM))rG   c                 "    U R                  5       $ rz  )r  r   s    rE   isfileTarInfo.isfilep  s    zz|rG   c                 (    U R                   [        :H  $ )z!Return True if it is a directory.)r  r  r   s    rE   r  TarInfo.isdirt      yyG##rG   c                 (    U R                   [        :H  $ )z%Return True if it is a symbolic link.)r  SYMTYPEr   s    rE   r  TarInfo.issymx  r  rG   c                 (    U R                   [        :H  $ )z!Return True if it is a hard link.)r  LNKTYPEr   s    rE   r  TarInfo.islnk|  r  rG   c                 (    U R                   [        :H  $ )z(Return True if it is a character device.)r  r  r   s    rE   ischrTarInfo.ischr  r  rG   c                 (    U R                   [        :H  $ )z$Return True if it is a block device.)r  r	  r   s    rE   isblkTarInfo.isblk  r  rG   c                 (    U R                   [        :H  $ )zReturn True if it is a FIFO.)r  FIFOTYPEr   s    rE   isfifoTarInfo.isfifo  s    yyH$$rG   c                     U R                   S L$ r   )r`  r   s    rE   issparseTarInfo.issparse  s    {{$&&rG   c                 >    U R                   [        [        [        4;   $ )zCReturn True if it is one of character device, block device or FIFO.)r  r  r	  r  r   s    rE   isdevTarInfo.isdev  s    yyWgx888rG   )r  r  r  r  r5   r7   r  r   r3   r   r-  r_  r  r2   r`  r  r4   r6   r   )r   )7r   r   r   r   r   dict	__slots__r   r[  rb  setterr0   r1   r  r  r   r  r   r   r  r  r  r  classmethodr  r  staticmethodr  r  r  r  r1  r5  r4  r<  r8  r9  r;  rV  rU  rW  rA  rS  r@  r  r~  r  r  r  r  r  r  r  r  r   r   rG   rE   r   r   e  s     
,
!
 G
 H	

  
 -
 $
>
F
 
 
 *
  *!
" /#
$ 5%
&9'
* .+
, -
. /
0 1
I60   ^^      
[[    __! !O %eeuE88 *HEV /"IM8Qt M M
  ' 'R   * *  0- 0-d < <| ) )(/,68wr3(;; ..D"*$$$$$%'9rG   r   c                      \ rS rSrSrSrSrSrSr\	r
\rSr\r\rSr    S=S jr\SSS\4S	 j5       r\S>S
 j5       r\S?S j5       r\S?S j5       r\S@S j5       rSSSSS.rS rS rS rS rSAS jr SBSS.S jjr!SCSS.S jjr"SDS jr#S r$SESSS.S jjr%S  r&SFSSS.S! jjr'S" r( SDS# jr)S$ r*S% r+S& r,  SGSSS'.S( jjr-S) r.S* r/S+ r0S, r1S- r2S. r3S/ r4S0 r5S1 r6S2 r7S3 r8SHS4 jr9S5 r:SDS6 jr;S7 r<S8 r=S9 r>S: r?S; r@S<rAg)Ir   i  z=The TarFile Class provides an interface to tar archives.
    r   Fr.   Nr   c                 D   SSSSS.nX/;  a  [        S5      eX l        X   U l        U(       d_  U R                  S:X  a2  [        R                  R                  U5      (       d  SU l        SU l        [        XR                  5      nS	U l        OnUcB  [        US5      (       a1  [        UR                  [        [        45      (       a  UR                  n[        US5      (       a  UR                  U l        SU l        U(       a  [        R                  R                  U5      OS
U l
        X0l        Xl        Ub  X@l        Ub  XPl        Ub  X`l        Ub  Xpl        Ub  Xl        Xl        U
b  U R                   [,        :X  a  Xl        O0 U l        Ub  Xl        Ub  Xl        Xl        S	U l        / U l        S	U l        U R                  R=                  5       U l        0 U l          U R                  S:X  a  S
U l!        U RE                  5       U l!        U R                  S:X  a_   U R                  RG                  U R>                  5         U R"                  RI                  U 5      nU R8                  RK                  U5        M^  U R                  S;   a  SU l        U R.                  (       am  U R"                  RS                  U R.                  RU                  5       5      nU R                  RW                  U5        U =R>                  [Y        U5      -  sl        g
g
g
! [L         a)    U R                  RG                  U R>                  5         M  [N         a  n[Q        [        U5      5      S
eS
nAff = f!   U R                  (       d  U R                  R[                  5         SU l        e = f)a  Open 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.
r8  zr+bwbxbr   ar   rg  !mode must be 'r', 'a', 'w' or 'x'r  r   FNr   r   Tr   r  r   rg  ).r=   r   _moder   r0   exists	bltn_openr   r   r  r   r  r_   abspathr   streamrc   rc  dereferenceignore_zerosrC   rD   r   r  debug
errorlevelcopybufsizer   members_loadedr
  r-  inodesfirstmemberrE  r  r5  r  r   r   r   r  r  rv   r?   r   )r   r   r   r   rc   rc  r  r  rC   rD   r  r  r  r  r  modesr  rl   s                     rE   r   TarFile.__init__  s    T=@AA	[
yyCt(<(<	!
jj1G$D&!9!97<<#u66||w''$\\
#D-1BGGOOD)t	  K"L"*# ,$M"t{{j'@*!DJ!(O 'll'')	yyC#' #'99; yyC LL%%dkk2:"&,,":":4"@++G4	  yyO+###,,??@P@P@U@U@WXCLL&&s+KK3s8+K $ , * ))$++6& :'A/T9:	##""$DKs>    A"M* 6L 9BM* /M'M* 	M'M""M''M* *5Nc                   ^  U(       d  U(       d  [        S5      eUS;   az  U 4S jn/ n[        T R                  US9 H;  n[        T T R                  U   5      n	Ub  UR	                  5       n
 U	" USU40 UD6s  $    S	R                  U5      n[        S
U 35      eSU;   al  UR                  SS5      u  pU=(       d    SnU=(       d    SnUT R                  ;   a  [        T T R                  U   5      n	O[        SU-  5      eU	" XU40 UD6$ SU;   ao  UR                  SS5      u  pU=(       d    SnU=(       d    SnUS;  a  [        S5      eUR                  SS5      n[        XXUU5      n T " XU40 UD6nSUl        U$ US;   a  T R                  " XU40 UD6$ [        S5      e! [
        [        4 a8  nUR                  SU SU< 35        Ub  UR                  W
5         SnAGM  SnAff = f!   UR                  5         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
znothing to open)r   r:*c                 (   > TR                   U    S:H  $ )Ntaropen)	OPEN_METH)r   r  s    rE   not_compressed$TarFile.open.<locals>.not_compressedK  s    }}X.);;rG   )keyNr   z	- method z: 
z'file could not be opened successfully:
:r.   r   r   |r   zmode must be 'r' or 'w'r   	   Fr  zundiscernible mode)r=   sortedr  r   r
  r   r	   r  r  r  r  popr   r   r   r  )r  r   r   r   rz   kwargsr  
error_msgsr   func	saved_posr  error_msgs_summaryfilemoder   r  r  s   `                rE   r   TarFile.open!  s%   J G.//<<J"3==nEsCMM($;<& 'Ic7=f== F "&:!6FGYFZ[\\D[!%C!3H3H(5H 3==(sCMM($;<&'Dx'OPP:6::D[!%C!3H3H(5Hz) !:;;"JJ:MTX*,F9&9 "AMH_$;;t7=f==-..W "#34 %%	(2aU&CD*Y/	Ds$   -
F'/
G2 'G/7,G**G/2Hc                 8    US;  a  [        S5      eU " XU40 UD6$ )zCOpen uncompressed tar archive name for reading or writing.
        r  r  )r=   )r  r   r   r   r  s        rE   r  TarFile.taropen  s+     ++@AA4w1&11rG   c                    US;  a  [        S5      e SSKJn   U" XS-   XC5      n U R                  " XU40 UD6nS
Ul	        U$ ! [         a    [	        S5      Sef = f! [
         a  nUb  US:X  a  [        S	5      Uee SnAff = f! [
         a(  nUR                  5         US:X  a  [        S	5      Uee SnAf  UR                  5         e = f)zXOpen gzip compressed tar archive name for reading or writing.
Appending is not allowed.
r   r   rg  mode must be 'r', 'w' or 'x'r   )GzipFilezgzip module is not availableNr}   r   r   F)
r=   gzipr  r   r	   r   r   r  r   r   )	r  r   r   r   r   r  r  r  r  s	            rE   gzopenTarFile.gzopen  s    
 &;<<	M%	tCZHG		D:6:A +  	M"#ABL	M
  	"ts{ 129	  	MMOs{ 129	MMOs9   A A B A
B(A>>B
C	#B33C	c                 Z   US;  a  [        S5      e SSKJn  U" U=(       d    UX$S9n U R
                  " XU40 UD6nS
Ul
        U$ ! [         a    [	        S5      Sef = f! [        [        4 a(  nUR                  5         US:X  a  [        S	5      Uee SnAf  UR                  5         e = f)zYOpen bzip2 compressed tar archive name for reading or writing.
Appending is not allowed.
r  r  r   )BZ2Filer   N)r   r   znot a bzip2 fileF)r=   r   r  r   r	   r  r   EOFErrorr   r   r   )	r  r   r   r   r   r  r  r  r  s	            rE   bz2openTarFile.bz2open  s    
 &;<<	L# '/T4M		D:6:A !  	L"#@AtK	L " 	MMOs{ 23:	MMOs"   A A! A!B*1#BB*c                 V   US;  a  [        S5      e SSKJnJn  U" U=(       d    UX$S9n U R                  " XU40 UD6nS
Ul
        U$ ! [         a    [        S5      Sef = f! U[        4 a(  n	UR                  5         US:X  a  [        S	5      U	ee Sn	A	f  UR                  5         e = f)zXOpen lzma compressed tar archive name for reading or writing.
Appending is not allowed.
r  r  r   )LZMAFiler   r   N)presetr   znot an lzma fileF)r=   r   r  r   r   r	   r  r  r   r   r   )
r  r   r   r   r  r  r  r   r  r  s
             rE   xzopenTarFile.xzopen  s    
 &;<<	M0 7?dD@		D:6:A !  	M"#ABL	M 8$ 	MMOs{ 23:	MMOs"   A	 A# 	A #B(/#BB(r  r  r  r  )r   r   r   r   c                 2   U R                   (       a  gSU l          U R                  S;   a  U R                  R                  [        [
        S-  -  5        U =R                  [
        S-  -  sl        [        U R                  [        5      u  pUS:  a)  U R                  R                  [        [        U-
  -  5        U R                  (       d  U R                  R                  5         gg! U R                  (       d  U R                  R                  5         f f = f)zYClose the TarFile. In write-mode, two finishing zero blocks are
appended to the archive.
NTr  r/   r   )r   r   r   rv   r@   r  r-  rt   
RECORDSIZEr   r   )r   r{   r|   s      rE   r   TarFile.close  s     ;;	%yyO+""3)a-#89	A. %+4;;
$C!q=LL&&sj9.D'EF##""$ $4##""$ $s   B C( (.Dc                 h    U R                  UR                  S5      5      nUc  [        SU-  5      eU$ )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.
r  zfilename %r not found)
_getmemberr*  KeyError)r   r   rc  s      rE   	getmemberTarFile.getmember  s6     //$++c"23?2T9::rG   c                 |    U R                  5         U R                  (       d  U R                  5         U R                  $ )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  _loadr  r   s    rE   
getmembersTarFile.getmembers  s'     	||JJL||rG   c                 `    U R                  5        Vs/ s H  oR                  PM     sn$ s  snf )zxReturn the members of the archive as a list of their names. It has
the same order as the list returned by getmembers().
)r  r   )r   rc  s     rE   getnamesTarFile.getnames  s'     -1OO,=>,=,=>>>s   +c                    U R                  S5        Ub  UR                  nUc  Un[        R                  R	                  U5      u  pBUR                  [        R                  S5      nUR                  S5      nU R                  5       nXl	        Uc?  U R                  (       d  [        R                  " U5      nO;[        R                  " U5      nO$[        R                  " UR                  5       5      nSnUR                  n[        R                   " U5      (       a  UR"                  UR$                  4n	U R                  (       dG  UR&                  S:  a7  XR(                  ;   a(  X R(                  U	   :w  a  [*        n
U R(                  U	   nO[,        n
U	S   (       a  X R(                  U	'   O[        R.                  " U5      (       a  [0        n
O[        R2                  " U5      (       a  [4        n
O}[        R6                  " U5      (       a  [8        n
[        R:                  " U5      nOE[        R<                  " U5      (       a  [>        n
O#[        R@                  " U5      (       a  [B        n
OgX%l        Xl"        URF                  Ul$        URJ                  Ul&        U
[,        :X  a  URN                  Ul(        OSUl(        URR                  Ul*        Xl+        Xul,        [Z        (       a)   [Z        R\                  " URH                  5      S   Ul/        [b        (       a)   [b        Rd                  " URL                  5      S   Ul3        U
[>        [B        4;   at  [i        [        S5      (       a_  [i        [        S5      (       aJ  [        Rj                  " URl                  5      Ul7        [        Rp                  " URl                  5      Ul9        U$ ! [`         a     Nf = f! [`         a     Nf = f)	a  Create 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.
awxNr  r   r.   r   majorminor):r  r   r   r0   
splitdriver   r  r  rc  r  r  lstatstatfstatfilenost_modeS_ISREGst_inost_devst_nlinkr  r  r  S_ISDIRr  S_ISFIFOr  S_ISLNKr  readlinkS_ISCHRr  S_ISBLKr	  r   st_uidr4   st_gidr5   st_sizer2   st_mtimer3   r  r  pwdgetpwuidr6   r  grpgetgrgidr7   r   r  st_rdevr  r  r  )r   r   arcnamer   drvrc  statresr  stmdinoder  s              rE   
gettarinfoTarFile.gettarinfo  s    	E <<D
 ?Gww))'2//"&&#...% ,,. ?##((4.''$-hhw~~/0G<<^^W^^4E##(8(81(<[[(WE8J-J ;;u- 8)0KK&\\$D]]4  D\\$D{{4(H\\$D\\$D nnnn7?"??GLGL((#3 #W[[ 9! < 3 #W[[ 9! < GW%%r7##G(<(<#%88GOO#< #%88GOO#<   
  s$   '(O	 (O 	
OO
O&%O&)r  c                8   [         [        R                  [        [        R                  [
        [        R                  [        [        R                  [        [        R                  [        [        R                  0nU R                  5         Uc  U nU GH  nU(       Ga^  UR                  c  [        S5        OGUR!                  UR"                  S5      n[        [        R$                  " XTR                  -  5      5        [        UR&                  =(       d    UR(                  < SUR*                  =(       d    UR,                  < 35        UR/                  5       (       d  UR1                  5       (       a(  [        SSUR2                  UR4                  4-  -  5        O[        SUR6                  -  5        UR8                  c  [        S5        O/[        S	[:        R<                  " UR8                  5      SS
 -  5        [        UR>                  URA                  5       (       a  SOS-   5        U(       aZ  URC                  5       (       a  [        SURD                  -   5        URG                  5       (       a  [        SURD                  -   5        [I        5         GM     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
??????????r   r  z%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr   r   z-> zlink to )%r  r  S_IFREGr  S_IFLNKr  S_IFIFOr  S_IFCHRr  S_IFDIRr	  S_IFBLKr  r   r   r  r  r  r6   r4   r7   r5   r  r  r  r  r2   r3   r   	localtimer   r  r  r  r  r   )r   verboser  	type2moderc  modetypes         rE   r`  TarFile.list  s    dllGT\\t||WdlldllGT\\C	 	?GG<<'-(}}W\\1=Hh.E FGw}}'C'C'.}}'C'CE F==??gmmoo$(8(8':J:J'KK!M N   56==( 56 ="&.."?"C!D E w}}BGH==??(8(8 89==??
W-=-= =>G7 rG   filterc                   U R                  S5        Uc  UnU R                  bC  [        R                  R	                  U5      U R                  :X  a  U R                  SSU-  5        gU R                  SU5        U R                  X5      nUc  U R                  SSU-  5        gUb!  U" U5      nUc  U R                  SSU-  5        gUR                  5       (       a'  [        US5       nU R                  XV5        SSS5        gUR                  5       (       a  U R                  U5        U(       ar  [        [        R                  " U5      5       HN  nU R                  [        R                  R                  X5      [        R                  R                  X&5      X4S	9  MP     ggU R                  U5        g! , (       d  f       g= f)
a  Add 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.
r  Nr/   ztarfile: Skipped %rr.   ztarfile: Unsupported type %rtarfile: Excluded %rr8  r  )r  r   r   r0   r  _dbgr  r  r  addfiler  r  listdiraddr  )r   r   r  	recursiver  rc  fs          rE   r%  TarFile.add  sk    	E?G 99 RWW__T%:dii%GIIa.56		!T //$0?IIa7$>? WoG		!3d:; ==??4&!W( '& ]]__LL!

4 01AHHRWW\\$2BGGLL4L%  6 2  LL! '&s   (F55
Gc                    U R                  S5        Uc0  UR                  5       (       a  UR                  S:w  a  [        S5      e[        R                  " U5      nUR                  U R                  U R                  U R                  5      nU R                  R                  U5        U =R                  [        U5      -  sl        U R                  nUb  [        X R                  UR                  US9  [        UR                  [         5      u  pVUS:  a.  U R                  R                  ["        [         U-
  -  5        US-  nU =R                  U[         -  -  sl        U R$                  R'                  U5        g)a  Add 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().
r  Nr   z3fileobj not provided for non zero-size regular file)rz   r.   )r  r  r2   r=   r  r  rc   rC   rD   r   rv   r-  r?   r  rs   rt   r  r@   r  r  )r   rc  r   rl   rz   r{   r|   s          rE   r#  TarFile.addfile  s    	E?w}}7<<13DRSS))G$mmDKKD3s3x  w||WM &w||Y ?F1}""3)i*?#@A!KK6I--KG$rG   c                    UcP  U R                   nUc  SS KnUR                  S[        SS9  [        $ [        U[        5      (       a  [        S5      eU$ [        U5      (       a  U$  [        U   $ ! [         a    [        SU< S35      S ef = f)Nr   zPython 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$  r  zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.zfilter z
 not found)extraction_filterr  r  r  r   r  r  	TypeErrorcallable_NAMED_FILTERSr  r=   )r   r  r  s      rE   _get_filter_functionTarFile._get_filter_function  s    >++F~J '1	  6
 ,+&#&&67 7 MFM	G!&)) 	Gwvj
;<$F	Gs   'A0 0B)numeric_ownerr  c          	         / nU R                  U5      nUc  U nU Hg  nU R                  XvU5      u  pUc  M  UR                  5       (       a  UR                  U	5        U R	                  XUR                  5       (       + UUS9  Mi     UR                  S SS9  U H  n	  U" X5      nUc  U R                  U	S5        M$  [        R                  R                  XR                  5      n [        R                  " U5      n[        R                   " UR"                  5      (       d  U R                  US5        M  U R%                  XUS	9  U R'                  X5        U R)                  X5        M     g! [         a&  n
U R                  U	[        U
5      5         Sn
A
M  Sn
A
ff = f! [         a    U R                  US5         GM'  f = f! [*         a  nU R-                  U5         SnAGMM  SnAff = 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_attrsr2  filter_functionc                     U R                   $ r   r  )r  s    rE   <lambda>$TarFile.extractall.<locals>.<lambda>5	  s    qvvrG   T)r  reversezexcluded by filtermissingznot a directory)r2  )r0  _get_extract_tarinfor  r  _extract_onesort_FILTER_ERRORS_log_no_directory_fixupreprr   r0   r  r   r  FileNotFoundErrorr  r  r  chownutimechmodr   _handle_nonfatal_error)r   r0   r  r2  r  directoriesr5  r  rc  
unfilteredexcdirpathr  r  s                 rE   
extractallTarFile.extractall	  s    33F;?GF"&";";#/G}} "":.g7==?7J,9.=  ?  	-t< &J/-j?G ?001EG'',,t\\:HHW-E ||EMM22 00:KL

7=
I

7,

7,5 & & 00T#YG ) 00)D   /++A../sl   E-&G=)G'F =7G62G-
F7FGFG G<G GG
G+G&&G+c                 N    U R                  SSUR                  < SU< S35        g )Nr/   z!tarfile: Not fixing up directory z ())r"  r   )r   r  reasons      rE   r?  TarFile._log_no_directory_fixupW	  s    		!;;( 	)rG   c                z    U R                  U5      nU R                  XU5      u  pxUb  U R                  XrX45        gg)aD  Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a 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)r0  r;  r<  )	r   r  r0   r4  r2  r  r5  rc  rG  s	            rE   extractTarFile.extract[	  sG     33F;"77T+gYF rG   c                    [        U[        5      (       a  U R                  U5      nOUnSn U" XC5      nUc   U R                  SSUR                  -  5        gUR                  5       (       aD  [        R                  " U5      n[        R                  R                  X5R                   5      Ul        XT4$ ! [        [        [
        4 a  nU R                  U5         SnANSnAf[         a  nU R                  U5         SnANSnAff = f)zrGet (filtered, unfiltered) TarInfos from *member*

*member* might be a string.

Return (None, None) if not found.
Nr/   r!  )NN)r  r  r  r   r  r   _handle_fatal_errorr   rE  r"  r   r  r  r   r0   r  r  r  )r   r  r5  r0   rG  filteredr  s          rE   r;  TarFile._get_extract_tarinfoo	  s     fc""/JJ	+&z8H
 IIa/*//AB >>yy*H$&GGLL7H7H$IH!## +[9 	($$Q'' 	+''**	+s#   B4 4D	CD,DDc           	      @   U R                  S5         U R                  U[        R                  R	                  X!R
                  5      UUUUS9  g! [        [        4 a  nU R                  U5         SnAgSnAf[         a  nU R                  U5         SnAgSnAff = 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   )r4  r2  r5  extraction_rootN)r  _extract_memberr   r0   r  r   r   r  rT  r   rE  )r   rc  r0   r4  r2  r5  r  s          rE   r<  TarFile._extract_one	  s     	C		+  "'',,t\\*J+4/<1@15	 ! 7
 +, 	($$Q'' 	+''**	+s#   ;A BA55BBBc                 P    U R                   S:  a  e U R                  SSU-  5        g)z=Handle non-fatal error (ExtractError) according to errorlevelr.   tarfile: %sN)r  r"  r   r  s     rE   rE  TarFile._handle_nonfatal_error	  s$    ??QIIa*+rG   c                 b   U R                   S:  a  e [        U[        5      (       a\  UR                  c   U R	                  SSUR
                  -  5        gU R	                  SSUR
                  < SUR                  < 35        gU R	                  SS[        U5      R                  < SU< 35        g)z1Handle "fatal" error according to self.errorlevelr   Nr.   r\  z	tarfile: r   )r  r  r   filenamer"  strerrorr  r   r]  s     rE   rT  TarFile._handle_fatal_error	  sw    ??Q7##zz!		!]QZZ78		!QZZHIIIaT!W-=-=qABrG   c                    U R                  S5        [        U[        5      (       a  U R                  U5      nOUnUR	                  5       (       d  UR
                  [        ;  a  U R                  X5      $ UR                  5       (       d  UR                  5       (       aJ  [        U R                  [        5      (       a  [        S5      eU R                  U R                  U5      5      $ 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.
r   z'cannot extract (sym)link as file objectN)r  r  r  r  r  r  r?  
fileobjectr  r  r   r   r
   extractfile_find_link_target)r   r  rc  s      rE   re  TarFile.extractfile	  s     	Cfc""nnV,GG==??gll/A??411]]__$,,00 ""KLL ''(>(>w(GHH rG   r5  rX  c                   UR                  S5      nUR                  S[        R                  5      n[        R                  R                  U5      nU(       a9  [        R                  R                  U5      (       d  [        R                  " USS9  UR                  5       (       d  UR                  5       (       a.  U R                  SUR                  < SUR                  < 35        OU R                  SUR                  5        UR                  5       (       a  U R                  X5        OUR                  5       (       a  U R!                  X5        OUR#                  5       (       a  U R%                  X5        OUR'                  5       (       d  UR)                  5       (       a  U R+                  X5        OsUR                  5       (       d  UR                  5       (       a  U R-                  XUUS9  O7UR.                  [0        ;  a  U R3                  X5        OU R                  X5        U(       aK  U R5                  XU5        UR                  5       (       d#  U R7                  X5        U R9                  X5        ggg)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)
r  T)exist_okr.   z -> rh  N)r*  r   r   r  r0   r  r  makedirsr  r  r"  r   r  r  makefiler  makedirr  makefifor  r  makedevmakelink_with_filterr  r?  makeunknownrB  rD  rC  )r   rc  
targetpathr4  r2  r5  rX  	upperdirss           rE   rY  TarFile._extract_member	  s     &&s+
''RVV4
 GGOOJ/	RWW^^I66 KK	D1==??gmmooIIaw||W5E5EFGIIa&==??MM'.]]__LL-^^MM'.]]__LL-]]__%% / / & 1 \\0W1MM'.JJwM:==??

7/

7/ # rG   c                      UR                   c  [        R                  " U5        g[        R                  " US5        g! [         a(    [        R                  R                  U5      (       d  e  gf = f)z,Make a directory called targetpath.
        Ni  )r   r   mkdirFileExistsErrorr0   r  r   rc  rr  s      rE   rm  TarFile.makedir
  sW    
	||#$ U+ 	77==,, -	s   #> > /A0/A0c           	         U R                   nUR                  UR                  5        U R                  n[	        US5       nUR
                  bd  UR
                   H(  u  pgUR                  U5        [        X5U[        U5        M*     UR                  UR                  5        UR                  5         O[        X5UR                  [        U5        SSS5        g! , (       d  f       g= f)z'Make a file called targetpath.
        r  N)
r   r  r_  r  r  r`  rs   r   r2   truncate)r   rc  rr  sourcerz   targetr-  r2   s           rE   rl  TarFile.makefile
  s     G''(""z4(F~~)$+NNLFKK'iI %3 GLL)!FGLL)WM )((s    BC
C%c                 d    U R                  X5        U R                  SSUR                  -  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)rl  r"  r  rx  s      rE   rq  TarFile.makeunknown+
  s1     	g*		! 24;LLA 	BrG   c                 p    [        [        S5      (       a  [        R                  " U5        g[        S5      e)z'Make a fifo called targetpath.
        mkfifozfifo not supported by systemN)r   r   r  r   rx  s      rE   rn  TarFile.makefifo3
  s)     2x  IIj!=>>rG   c                    [        [        S5      (       a  [        [        S5      (       d  [        S5      eUR                  nUc  SnUR	                  5       (       a  U[
        R                  -  nOU[
        R                  -  n[        R                  " X#[        R                  " UR                  UR                  5      5        g)z<Make a character or block device called targetpath.
        mknodro  z'special devices not supported by systemNr  )r   r   r   r   r  r  r  r  r  ro  r  r  )r   rc  rr  r   s       rE   ro  TarFile.makedev;
  s     r7##72y+A+AHII||<D==??DLL DDLL D
G,,g.>.>?	ArG   c                 (    U R                  XS S 5      $ r   )rp  rx  s      rE   makelinkTarFile.makelinkM
  s    ((dDIIrG   c                    Sn UR                  5       (       a\  [        R                  R                  U5      (       a  [        R                  " U5        [        R
                  " UR                  U5        g[        R                  R                  UR                  5      (       a"  [        R                  " UR                  U5        g  U R                  U5      nUc  UnOUc  [        S5      e U" Xd5      nUb  U R#                  XrUUS9  gg! [         a    Sn NSf = f! [         a    U(       a  [        S5      See f = f! [         a  n[        XR                   5      UeSnAff = f)a  Make 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  )r  r   r0   lexistsunlinksymlinkr  r  r  linksymlink_exceptionrf  r  r   r>  r   r   rY  )	r   rc  rr  r5  rX  keyerror_to_extracterrorrG  rU  causes	            rE   rp  TarFile.makelink_with_filterP
  s_    $) 	,}}77??:..IIj)

7++Z877>>'"6"677GGG00*= 8	//8J "!H&">? ?M*:G   1@1@ ! B  / ! 	,'+$	,
  	'";=BFG 	  " M'AuLMs=   A0D 5AD D -D? DDD<?
E$	EE$c                    [        [        S5      (       Ga  [        R                  " 5       S:X  Ga  UR                  nUR                  nU(       d   [
        (       a4  UR                  (       a#  [
        R                  " UR                  5      S   n [        (       a4  UR                  (       a#  [        R                  " UR                  5      S   nUc  SnUc  Sn UR                  5       (       a-  [        [        S5      (       a  [        R                  " X%U5        g[        R                  " X%U5        ggg! [         a     Nf = f! [         a     Nf = f! [        [         4 a  n[#        S5      UeSnAff = 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.
geteuidr   r/   NrI   lchownzcould not change owner)r   r   r  r5   r4   r  r7   getgrnamr  r  r6   getpwnamr  r  rB  r   OverflowErrorr   )r   rc  rr  r2  gur  s          rE   rB  TarFile.chown
  s%    2y!!bjjla&7AA sw}}LL7:sw}}LL7: yyD==??wr8'<'<IIjQ/HHZA./ '8!   
    ]+ D"#;<!CDsC   ?D7 ?E AE E 7
EE
EEE8'E33E8c                     UR                   c  g [        R                  " X!R                   5        g! [         a  n[	        S5      UeSnAff = f)zASet file permissions of targetpath according to tarinfo.
        Nzcould not change mode)r   r   rD  r   r   )r   rc  rr  r  s       rE   rD  TarFile.chmod
  sD     <<	?HHZ. 	?67Q>	?s    1 
AAAc                     UR                   nUc  g[        [        S5      (       d  g [        R                  " X#U45        g! [         a  n[        S5      UeSnAff = f)zBSet modification time of targetpath according to tarinfo.
        NrC  z"could not change modification time)r3   r   r   rC  r   r   )r   rc  rr  r3   r  s        rE   rC  TarFile.utime
  s[     =r7##	LHHZ0 	LCD!K	Ls   A 
AAAc                    U R                  S5        U R                  b  U R                  nSU l        U$ U R                  U R                  R	                  5       :w  ad  U R                  S:X  a  gU R                  R                  U R                  S-
  5        U R                  R                  S5      (       d  [        S5      eSn  U R                  R                  U 5      n Ub.  U R0                  (       d  U R2                  R5                  U5        U$ SU l        U$ ! [         a[  nU R                  (       a@  U R                  SSU R                  U4-  5        U =R                  [        -  sl         SnAM   SnANSnAf[         a  nU R                  (       aA  U R                  SSU R                  U4-  5        U =R                  [        -  sl         SnAGM  U R                  S:X  a  [        [        U5      5      Se SnAGN%SnAf[          a     U R                  S:X  a  [        S	5      Se GNQ["         a0  nU R                  S:X  a  [        [        U5      5      Se SnAGNSnAf[$         a  n[        [        U5      5      SeSnAf[&         aE  n SSKn[+        X4R,                  5      (       a  [        S
U 35      SeUe! [.         a    Uef = fSnAff = 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.
raNr   r.   rq   Tr/   z0x%X: %sz
empty filezzlib error: )r  r  r-  r   r
  r  ru   r   rc  r5  r   r  r"  r  rZ   r  r   r   r   	Exceptionr   r  r   r   r  r  r  r  )r   mrc  r  r   s        rE   rE  TarFile.next
  s]   
 	D'  A#DH ;;$,,++--{{aLLdkkAo.<<$$Q'' 899 ,,2248< ;;##G,   DLM " $$IIat{{A.>!>?KK9,K % & 6$$IIat{{A.>!>?KK9,K[[A%#CF+5 &# <;;!##L1t; $' 6;;!##CF+5 $( 2A'T1 !!ZZ00',qc(:;E" Gsb   D 
K$AE::KAH%H)K0	K9%I$$K1JK/KKKKc                    U R                  5       nSnUb   UR                  U5      nUSU nU(       a  [        R                  R                  U5      n[        U5       Hn  nU(       a  UR                  UR                  :X  a  SnM(  U(       a*  [        R                  R                  UR                  5      nOUR                  nX:X  d  Ml  Us  $    U(       a  [        U5      eg! [         a    Sn Nf = f)zjFind an archive member by name from bottom to top.
If tarinfo is given, it is used as the starting point.
FNT)	r  indexr=   r   r0   r  reversedr-  r   )	r   r   rc  	normalizer  skippingr  r  member_names	            rE   r  TarFile._getmember
  s    
 //# *g. "&5/77##D)Dw'F>>V]]2$H gg..v{{;$kk" ( W%% 1      s   C# #C21C2c                     U R                   (       d-  U R                  5       b   U R                  5       b  M  SU l        gg)zvRead through the entire archive file and look for readable
members. This should not run if the file is set to stream.
NT)r  rE  r  r   s    rE   r  TarFile._load'  s4     {{))+) ))+)DL rG   c                     U R                   (       a"  [        SU R                  R                  -  5      eUb)  U R                  U;  a  [        SU R                  -  5      egg)z[Check if TarFile is still open, and if the operation's mode
corresponds to TarFile's mode.
z%s is closedNzbad operation for mode %r)r   r   rd  r   r   )r   r   s     rE   r  TarFile._check0  sS     ;;.4>>+B+BBCC		 55		ABB !6rG   c                 0   UR                  5       (       aQ  SR                  [        S[        R                  R                  UR                  5      UR                  45      5      nSnOUR                  nUnU R                  X#SS9nUc  [        SU-  5      eU$ )zGFind the target member of a symlink or hardlink member in the
archive.
r  NT)rc  r  zlinkname %r not found)
r  r  r  r   r0   r  r   r  r  r  )r   rc  r  limitr  s        rE   rf  TarFile._find_link_target9  s     ==??xxtbggoogll.KWM]M]-^ _`HE ''HEDI>2X=>>rG   c              #   x  #    U R                   (       a  U R                   Sh  vN   gSnU R                  b  U R                  5       nUS-  nUv    U[	        U R                  5      :  a  U R                  U   nO2U R                   (       d   U R                  5       nU(       d  SU l         gOgUS-  nUv   Mf   N7f)z$Provide an iterator object.
        Nr   r.   T)r  r  r  rE  r?   )r   r  rc  s      rE   __iter__TarFile.__iter__L  s      <<||##  'iikGQJEMs4<<((,,u-\\))+#'DL  QJEM  $s   !B:B8BB:c                 T    XR                   ::  a  [        U[        R                  S9  gg)z.Write debugging output to sys.stderr.
        fileN)r  r   r   stderr)r   levelmsgs      rE   r"  TarFile._dbgk  s!     JJ#CJJ' rG   c                 &    U R                  5         U $ r   )r  r   s    rE   	__enter__TarFile.__enter__q  s    rG   c                     Uc  U R                  5         g U R                  (       d  U R                  R                  5         SU l        g r;  )r   r   r   r   )r   r  r  	tracebacks       rE   __exit__TarFile.__exit__u  s2    <JJL ##""$DKrG   )r   r  r  r   r  r  r  rC   r  rD   r   r  rc   r  r  r  r   r   r-  r  r  rc  )Nr   NNNNNNr  NNNNF)r   N)r   Nr  )r   NN)NNNTr;  r   ).N)r   T)TFr?  )Br   r   r   r   r   r  r  r  r  r   rc   r   rC   rD   r   rc  r]  rd  r,  r   r  r  r   r  r  r  r  r  r   r  r  r  r  r`  r%  r#  r0  rJ  r?  rQ  r;  r<  rE  rT  re  rY  rm  rl  rq  rn  ro  r  rp  rB  rD  rC  rE  r  r  r  rf  r  r"  r  r  r   r   rG   rE   r   r     s    EK L J FHFGJAEHL>B6;db #tZ ]/ ]/~ 2 2  @  6  : 	I%*	?aF)D )V1" 1"f%8G0C/%C/J)GG($> &*+(,
C@ >B&+10@D(,10pN B?A$J0Bd DD?L>F&&P C&>(rG   r   c                      [        U S5      (       a+  U R                  5       n[        U S9nU R                  U5        O[        U 5      nUR	                  5         g! [
         a     gf = 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   )r   TF)r   r
  r   r  r   r   )r   r   r  s      rE   r   r     s[    
4  ))+CT"AIIcNT
A		 s   AA 
A'&A'c            	         SS K n SnU R                  US9nUR                  SSSSSS	9  UR                  S
S[        SS9  UR	                  SS9nUR                  SSSSS9  UR                  SSSSSS9  UR                  SSSSSS9  UR                  SS SS!S9  UR                  5       nUR                  (       a  UR                  c  UR                  S"S#5        UR                  b  UR                  n[        U5      (       ax  [        US$5       nUR                  5         [        UR                  5       [        R                  S%9  S S S 5        UR                   (       a  [        S&R#                  U5      5        g g UR                  S"S'R#                  U5      5        g UR$                  bw  UR$                  n[        U5      (       a9  [&        R                  US(5       nUR%                  UR                   S)9  S S S 5        g UR                  S"S'R#                  U5      5        g UR                  Gb3  [)        UR                  5      S":X  a   UR                  S   n[*        R,                  nOH[)        UR                  5      S*:X  a  UR                  u  pXO UR                  S"UR/                  5       5        [        W5      (       a  [&        R                  US(5       nUR1                  WUR                  S+9  S S S 5        UR                   (       a5  WS,:X  a  S-R#                  U5      n	OS.R#                  XX5      n	[        U	5        g g UR                  S"S'R#                  U5      5        g UR2                  b  UR2                  R5                  S5      n
[*        R6                  R9                  U
5      u  pS/S/S0S0S1S1S1S1S2.nX;   a  S3X   -   OS4nUR2                  n[&        R                  X5       nU H  nUR;                  U5        M     S S S 5        UR                   (       a  [        S5R#                  U
5      5        g g g ! , (       d  f       GN= f! , (       d  f       g = f! , (       d  f       GNo= f! , (       d  f       Nq= f)6Nr   z3A simple command-line interface for tarfile module.)descriptionz-vz	--verbose
store_trueFzVerbose output)actiondefaulthelpz--filterz<filtername>zFilter for extraction)metavarchoicesr  T)requiredz-lz--list	<tarfile>zShow listing of a tarfile)r  r  z-ez	--extract+)r  z<output_dir>zExtract tarfile into target dir)nargsr  r  z-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr.   z&--filter is only valid for extraction
r   r  z{!r} is a tar archive.z{!r} is not a tar archive.
r  )r  r/   )r0   r  r  z{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r   r   r   )r   z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:r   z{!r} file created.)argparseArgumentParseradd_argumentr/  add_mutually_exclusive_group
parse_argsr  rQ  exittestr   r   r  r   r   r  r  rc   r`  r   r?   r   curdirformat_helprJ  creater  r0   splitextr%  )r  r  parserrQ  argsrw   r   tfr  r  tar_namerc  extcompressionstar_mode	tar_files	file_names                    rE   mainr    s   GK$$$=F
k,-  /

N .4  6 ///>E	tX{7  9	t[<=  ? 
tZs39  ; 
tX{8  : D{{t||+A@Ayyiic??c33 cnn&SZZ8   ||.55c:;  KK9@@EF		iic??c5)R- *) KK9@@EF		!t||!,,q/CYYF!#,,KCKK6--/0c??c5)R6$++> *||S=3::3?C2396#3F c
  KK9@@EF		 ;;??1%!!(+ 
 03/B4,++KK	\\(-&	y! ' . <<&--h78 / 
!M   *) *)> .-s0   7P4QQ#Q)4
Q
Q
Q&)
Q7__main__r  )mr   version
__author____credits__builtinsr   r  r   r   rI  rr   r  r   rj   r  rer  r   r  AttributeErrorNotImplementedErrorr   r  __all__r@   r  r  r  r  r  r  r  r  r'  r  r  r  r	  r  r  CONTTYPEr  r  r(  r  r  r:  r   r   r   r   r?  r{  r+  ro  rT  r  rX   rp  r   r   getfilesystemencodingrF   rM   r]   re   ro   rs   r   r  r   r   r   r	   r
   r   r   r   r   rZ   r   r   r   objectr   r+  BufferedReaderr]  r   r   r   r   r   r   r   r>  r  r   r   r   r/  r  compilerO  r   r   r   r  r   r   rG   rE   <module>r     s  : 6
H
 ' 
 	 	      	 $%8'B ? 	^
	





  



 HgGXWg#%5!	# (>+ /	.
 9
   77d?H((*H0&( N <* "&$ 2	y 		8 		 		x 		( 		( 		{ 		; 		[ 		 		K 	 0r rj6 <i& iX"2$$ "	( 	J J
?k ?@{ @
L L
?+ ?D D w5BH * 	 ::&89 l9f l9^if i^'$ ||]9~ zF G^  
C  
Cs"   I I& I#"I#&I21I2