F ] ""rc$dtzdzS)NiI)rrr!_get_default_mode_plus_executabler/Zs MO# #e ++rc@tj|ty)zx Make file present at path have execute for user/group/world (chmod +x) is no-op on windows per python docs N)r chmodr/rs r2set_extracted_file_to_default_mode_plus_executabler2^s HHT467rcr|jdz }t|xrtj|xr|dzS)Nr-) external_attrboolstatS_ISREG)infomodes rzip_item_is_executabler;fs6    #D <d+<u ==rct|t|d} tj|d}t |j xr|}|j D]}|j}|}|rt|d}tjj||}tjj|} t||sd} t| j||||j!dr t|t| |j|} t|d5} t#j$| | ddd| j't)|s t+| |j'y#1swYFxYw#| j't)|r t+|wwxYw#|j'wxYw) a Unzip the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are not preserved), except that regular file members with any execute permissions (user, group, or world) have "chmod +x" applied after being written. Note that for windows, any execute changes using os.chmod are no-ops per the python docs. rbT) allowZip64rzQThe zip file ({}) has a file ({}) trying to install outside target directory ({}))rrwbN)r openzipfileZipFiler#namelistinfolistfilenamerr rjoindirnamer+rformatendswithshutil copyfileobjcloser;r2) rElocationflattenzipfpzipleadingr9namefndirmessagefpdestfps r unzip_filerXmsx 4 E ooe5!#,,.1=gLLN OD==DB&t,Q/h+B''//"%C&x44(xX(NOO{{;'23XXd^Ob$76**2v67HHJ-d3J2N7 O:  77HHJ-d3J2N4  sBDG" F.F F G*G F F)F??GGc tjjdsjjdrd}njjtrd}n`jjtrd}n:jjdrd}nt j dd }tj|d } t|jDcgc]}|jc}} tj t |rj|jD]W}t|j\}}||_ |js3t|j \}} ||k(sQ| |_Yd fd } |j#| |j)ycc}w#t$$rt'||Y/wxYw#|j)wxYw)a Untar the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are not preserved), except that regular file members with any execute permissions (user, group, or world) have "chmod +x" applied on top of the default. Note that for windows, any execute changes using os.chmod are no-ops per the python docs. z.gzz.tgzzr:gzzr:bz2zr:xzz.tarrz-Cannot determine compression type for file %szr:*zutf-8)encodingc||j} |}|jr|dzr |_|Sd|_|S#tj$r0tjdddvrtj |}nYiwxYw#tj $r"}d}t|j|d}~wwxYw)N>r] r] r] z%Invalid member in the tar file {}: {}r-) r:tarfileLinkOutsideDestinationErrorsys version_info tar_filterTarErrorrrHisfile) memberr orig_modeexcrU data_filterdefault_mode_plus_executablerErMs r pip_filterzuntar_file..pip_filters"KK "!,VX!>2==?y5'8">FK #'FK A#>> "++BQ/4&-%7%7%IF!# "'' EG,$ s0 AABBBBB;B66B;)filterN)rntarfile.TarInforstrreturnru)r lowerrIrr loggerwarningrgr@r# getmembersrRrqr/rislnklinkname extractallAttributeError_untar_without_filterrL) rErMr:tarrnrQ name_lead name_restlnk_leadlnk_restrsrqrrs `` @@r untar_filersx~~  '8>>+;+D+DV+L   " "> 2   " "= 1   " "6 * ;   ,,x 8CC!S^^=M"N66;;"NO : 8!--K,M+N ("nn.7F+v-O*(#y0.6FO 7% % N NN8JN 7 E#O D !(Hc7 C Dv sO0G7GG7"G2AG7G7%G7G7G41G73G44G77H cJtjjtjj|j|j }tjj |}|jdd} |j|y#t$rYywxYw)zGCheck if the file pointed to by the symbolic link is in the tar archiverrTF) r rrFrGrRr}normpathreplace getmemberKeyError)rtarinfor}s ris_symlink_target_in_tarrsyww||BGGOOGLL97;K;KLHww)Hc*H h sB B"!B"cP|jD]}|j}|rt|d}tjj ||}t ||sd}t|j||||jr t||jrRt||s2d}t|j||j|j |j|| |j%|} ttjj+|| Jt-|d5} t/j0| | ddd| j3|j5|||j6dzst9|y#t$r-}t j#d||j|Yd}~d}~wwxYw#t&t(f$r-}t j#d||j|Yd}~d}~wwxYw#1swYxYw)z/Fallback for Python without tarfile.data_filterrzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNr?r-)r{rRrr rrFr+rrHisdirr issymrr}_extract_member Exceptionryrz extractfilerrrGr@rJrKrLutimer:r2) rErMrrQrnrSrrUrprVrWs rrr s.."8I [[ "2&q)Bww||Hb)"8T20 $GNN8T8$LM M <<> t  \\^+C84(NN8V[[&//J ##FD1 __V, rwwt, -> !>dD! /V""2v. / HHJ IIfd #{{U"B4Hq8I0 EKK   n- EKK    / /s<&F$:GH$ G-"GGH,"HHH% ctjj|}|dk(s8|jj t st j|rt|||j d y|dk(sFtj|s1|jj ttztzr t||ytj!d|||t#d|)Nzapplication/zipz.whl)rNzapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of )r rrealpathrxrIr rA is_zipfilerXrg is_tarfilerrr rrycriticalr)rErM content_types r unpack_filerNs ww)H)) >>  $ $^ 4   h '8X83D3DV3L/LM,,   h ' >>  $ $^n%D}%T U8X&  +      "EhZ PQQr)rwint)rrvrwz list[str])rz Iterable[str]rwr6)r'rvr(rvrwr6)rrvrwNone)r9rrwr6)T)rErvrMrvrNr6rwr)rErvrMrvrwr)rtarfile.TarFilerrurwr6) rErvrMrvrrrQr6rwr)N)rErvrMrvrz str | Nonerwr)*__doc__ __future__rloggingr rJr7rirgrAcollections.abcrrpip._internal.exceptionsrpip._internal.utils.filetypesrrr r pip._internal.utils.miscr getLogger__name__rySUPPORTED_EXTENSIONSbz2 ImportErrordebuglzmarrr#r+r/r2r;rXrrrrr.rrrsa!" $6 0   8 $&60N*1M)   #,8>+\]@ BIBIBI BI BI  BIP $RRRR R[ 0 LL./01 LL/01s$! B9+ C9CCC.-C.