̇7%.ObdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddl mZddlmZmZmZmZddlmZejeZeezZ ddlZeez Zn #e$red YnwxYw ddlZeez Zn #e$red YnwxYwd/d Zd0dZd1dZ d2dZ!d/dZ"d3dZ#d4dZ$d5d6d#Z%d7d$Z&d8d)Z'd9d+Z( d:d;d.Z)dS) >F ] ""rc,dtzdzS)NiI)rrr!_get_default_mode_plus_executabler5Zs MOO# #e ++rNonecHtj|tdS)zx Make file present at path have execute for user/group/world (chmod +x) is no-op on windows per python docs N)rchmodr5r s r2set_extracted_file_to_default_mode_plus_executabler9^s# HT46677777rinforcf|jdz }t|otj|o|dzS)Nr3) external_attrr$statS_ISREG)r:modes rzip_item_is_executablerAfs7   #D <d++<u = ==rTfilenamelocationflattencRt|t|d} tj|d}t |o|}|D]}|j}|}|rt|d}tj ||}tj |} t||s&d} t| ||||drt|t| ||} t|d5} t#j| | dddn #1swxYwY| t)|rt+|S#| t)|rt+|wwxYw |dS#|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)namelistinfolistrBr!rrjoindirnamer1rformatendswithshutil copyfileobjcloserAr9) rBrCrDzipfpzipleadingr:namefndirmessagefpdestfps r unzip_filer^msDx 4 E oe555!#,,..11=gLLNN O OD=DB 0&t,,Q/h++B'//"%%C&x44 P4(xX(N(NOOO{{;'' O23XXd^^Ob$76*2v666777777777777777HHJJJ-d33OJ2NNNHHJJJ-d33OJ2NNNNO5 O:   sHD.HG F6 GF G F G 4H5G66HH&c tds'drd}ntrd}nvtrd}nGdrd}nt dd }tj|d } td | D} tj t |rm| D]X}t|j\}}||_|r$t|j\}} ||kr| |_Yd fd } || n"#t$$rt'||YnwxYw|dS#|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)encodingcg|] }|j Sr4)rX).0members r zuntar_file..s"N"N"N66;"N"N"Nrrdtarfile.TarInforrr c|j} |}nB#tj$r0tjdddvrtj|}nYnwxYwn<#tj$r*}d}t||d}~wwxYw| r |dzr|_nd|_|S)N>rh rh rh z%Invalid member in the tar file {}: {}r3) r@tarfileLinkOutsideDestinationErrorsys version_info tar_filterTarErrorrrPisfile) rdr orig_modeexcr[ data_filterdefault_mode_plus_executablerBrCs r pip_filterzuntar_file..pip_filters "K "!,VX!>!>"> " " "+BQB/4&-%7%I%IFF!#F "'   EG,$ ==??'y5'8'">FKK #'FK s2 A>+;+;+D+DV+L+L     " "> 2 2     " "= 1 1     " "6 * * ;     ,x 8 8 8CC!"N"NS^^=M=M"N"N"NOO : 8!-K,M+N+N ( 7"nn..77F+v-O-O*(#y00.6FO% % % % % % % % % N NN8JN 7 7 7 7q D D D !(Hc7 C C C C C Dv  s1"+H0 G8BH08HH0HH00Irtarfile.TarFiletarinforfcLtjtj|j|j}tj|}|dd} ||dS#t$rYdSwxYw)zGCheck if the file pointed to by the symbolic link is in the tar archiverrTF) rrrNrOrXrnormpathreplace getmemberKeyError)rrrs ris_symlink_target_in_tarrsw||BGOOGL997;KLLHw))Hc**H ht uus>B B#"B#rWc|D]J}|j}|rt|d}tj||}t ||s&d}t||||| rt|| rt||s0d}t|||j|j  |||#t$r-}t d||j|Yd}~:d}~wwxYw ||} nA#t&t(f$r-}t d||j|Yd}~d}~wwxYwttj|| Jt-|d5} t/j| | dddn #1swxYwY| ||||jdzrt9|LdS)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: %sNrHr3)rrXr!rrrNr1rrPisdirr issymrr_extract_member Exceptionrr extractfilerrrOrIrRrSrTutimer@r9) rBrCrrWrdrYrr[rzr\r]s rrr s..""8I8I [  *"2&&q)Bw||Hb))"8T22 N0 $GNN8T8$L$LMM M <<>>- I t     \\^^+ I+C88 4(NN8V[&/JJ ##FD1111   EK    __V,,n-   EK    rwt,, - - ->>>dD!! /V"2v... / / / / / / / / / / / / / / / HHJJJ IIfd # # #{U" IB4HHHq8I8IsBD E'"EEE..F,?"F''F,/HH H content_type str | NonecJtj|}|dks@|t st j|r(t|||d dS|dksPtj |s<|ttztzrt||dStd|||t#d|)Nzapplication/zipz.whl)rDzapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of )rrrealpathrrQr rJ is_zipfiler^rr is_tarfilerrr rrcriticalr)rBrCrs r unpack_filerNs& w))H))) >>   $ $^ 4 4 *  h ' ' * 8X83D3DV3L3L/LMMMMMM,,,  h ' ' - >>   $ $^n%D}%T U U - 8X&&&&&  +        Ph P PQQQr)r r )rrr r)r"r#r r$)r*rr+rr r$)rrr r6)r:rr r$)T)rBrrCrrDr$r r6)rBrrCrr r6)rrrrfr r$) rBrrCrrrrWr$r r6)N)rBrrCrrrr r6)*__doc__ __future__rloggingrrRr>rtrrrJcollections.abcrrpip._internal.exceptionsrpip._internal.utils.filetypesrrr r pip._internal.utils.miscr getLogger__name__rSUPPORTED_EXTENSIONSbz2 ImportErrordebuglzmarr!r)r1r5r9rAr^rrrrr4rrrs!!"""""" $$$$$$666666 0/////  8 $ $&60JJJN*000 LL./////01KKKM)111 LL/000001        ####,,,,8888>>>>+++++\]]]]@    BIBIBIBIP $RRRRRRRs$ A))BB BB10B1