
J\c           @@  s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l Z d  d l m Z m Z m Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z m Z d  d l m Z m Z d  d	 l m Z m  Z  d  d
 l! m" Z" d  d l# m$ Z$ d  d l% m& Z& d  d l' m( Z) d  d l' m* Z+ d  d l, m- Z- d  d l. Z. d  d l/ m0 Z0 m1 Z1 d  d l2 m3 Z3 d  d l4 m5 Z5 d  d l6 m7 Z7 d  d l8 m9 Z9 d  d l: m; Z; d  d l< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE mF ZF mG ZG d  d lH mI ZI d  d lJ mK ZK d  d lL mM ZM d  d lN mO ZO eK rd  d lP mQ ZQ mR ZR mS ZS mT ZT mU ZU mV ZV d  d lW mX ZX d  d lY mZ ZZ d  d lN m[ Z[ n  y d  d l\ Z\ Wn e] k
 rd Z\ n Xe\ d k	 p e- Z_ d d  d! d" d# d$ d% d& d' d( d) g Z` e ja eb  Zc dP Zd d-   Ze d.   Zf d/ e f d0     YZg d1 e f d2     YZh d3 e f d4     YZi d5 e f d6     YZj d7 e jk f d8     YZl d d d9  Zm e jn d: e jo  Zp e jn d; e jo  Zq d<   Zr d=   Zs d>   Zt d?   Zu d@   Zv dA   Zw dB   Zx dC   Zy dD   Zz dE   Z{ dF   Z| dG   Z} d d d dH dI  Z~ d d dJ  Z dK e& j f dL     YZ d e d d dH dM  Z dN   Z dO   Z d S(Q   i    (   t   absolute_importN(   t   requestst   sixt   urllib3(   t   CacheControlAdapter(   t	   FileCache(   t	   LockError(   t   BaseAdaptert   HTTPAdapter(   t   AuthBaset   HTTPBasicAuth(   t   CONTENT_CHUNK_SIZEt   Response(   t   CaseInsensitiveDict(   t   get_netrc_auth(   t   xmlrpc_client(   t   parse(   t   request(   t   IS_PYOPENSSL(   t   HashMismatcht   InstallationError(   t   write_delete_marker_file(   t   PyPI(   t   auto_decode(   t   check_path_owner(   t   libc_ver(   t   ARCHIVE_EXTENSIONSt   ask_path_existst
   backup_dirt   consumet   display_patht   format_sizet   get_installed_versiont   rmtreet   split_auth_from_netloct   splitextt   unpack_file(   t   TempDirectory(   t   MYPY_CHECK_RUNNING(   t   DownloadProgressProvider(   t   vcs(   t   Optionalt   Tuplet   Dictt   IOt   Textt   Union(   t   Link(   t   Hashes(   t   AuthInfot   get_file_contentt   is_urlt   url_to_patht   path_to_urlt   is_archive_filet   unpack_vcs_linkt   unpack_file_urlt
   is_vcs_urlt   is_file_urlt   unpack_http_urlt
   unpack_urlt   BUILD_BUILDIDt   BUILD_IDt   CIc           C@  s   t  d   t D  S(   s?   
    Return whether it looks like pip is running under CI.
    c         s@  s   |  ] } | t  j k Vq d  S(   N(   t   ost   environ(   t   .0t   name(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pys	   <genexpr>b   s    (   t   anyt   CI_ENVIRONMENT_VARIABLES(    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   looks_like_ciZ   s    c       
   C@  s=  i i d d 6t  j d 6d 6t j   d 6i t j   d 6d 6}  |  d d d k rj t j   |  d d <n |  d d d k r t j j d	 k r t j d
  } n	 t j } d j g  | D] } t	 |  ^ q  |  d d <nV |  d d d k rt j   |  d d <n+ |  d d d k r2t j   |  d d <n  t j j
 d  rd d l m } t t d   t d d d g | j      } t t d   t d d g t      } | r| | d <n  | r| |  d <qn  t j j
 d  rt j   d ri d d 6t j   d d 6|  d <n  t j   rIt j   |  j d i   d <n  t j   rtt j   |  j d i   d <n  t j   rt j   |  d <n  t rt j |  d <n  t d  } | d) k	 r| |  d <n  t   rt n d) |  d <t j j  d   } | d) k	 r| |  d! <n  d" j! d# |  d$ t" j# |  d% d* d( t  S(+   s6   
    Return a string representing the user agent.
    t   pipRC   t   versiont	   installert   pythont   implementationt   CPythont   PyPyt   finali   t   .t   Jythont
   IronPythont   linuxi    (   t   distroc         S@  s   |  d S(   Ni   (    (   t   x(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   <lambda>   t    t   idc         S@  s   |  d S(   Ni   (    (   RT   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyRU      RV   t   libt   libcRS   t   darwint   macOSt   systemt   releaset   cput   openssl_versiont
   setuptoolst   setuptools_versiont   cit   PIP_USER_AGENT_USER_DATAt	   user_datas9   {data[installer][name]}/{data[installer][version]} {json}t   datat   jsont
   separatorst   ,t   :t	   sort_keysN(   Rh   Ri   ($   RG   t   __version__t   platformt   python_versiont   python_implementationt   syst   pypy_version_infot   releaselevelt   joint   strt
   startswitht   pip._vendorRS   t   dictt   filtert   zipt   linux_distributionR   t   mac_verR\   t
   setdefaultR]   t   machinet   HAS_TLSt   sslt   OPENSSL_VERSIONR    t   NoneRF   t   TrueR@   RA   t   gett   formatRf   t   dumps(   Re   Rp   RT   RS   t   distro_infosRY   Ra   Rd   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt
   user_agente   sb    	-$"%	t   MultiDomainBasicAuthc           B@  s/   e  Z e d   Z d   Z d   Z d   Z RS(   c         C@  s   | |  _  i  |  _ d  S(   N(   t	   promptingt	   passwords(   t   selfR   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   __init__   s    	c         C@  s  t  j | j  } t | j  \ } } t  j | d  | f | d  | _ |  j j | d  \ } } | d  k r | \ } } n  | d  k r | d  k r t	 | j  } | r | n d \ } } n  | s | r| | f |  j | <t
 | p d | p d  |  } n  | j d |  j  | S(   Ni   i   RV   t   response(   NN(   NN(   t   urllib_parset   urlparset   urlR"   t   netloct
   urlunparseR   R   R   R   R
   t   register_hookt
   handle_401(   R   t   reqt   parsedR   t   url_user_passwordt   usernamet   passwordt
   netrc_auth(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   __call__   s    %$c         K@  s   | j  d k r | S|  j s  | St j | j  } t j j d | j  } t	 j	 d  } | sf | r | | f |  j
 | j <n  | j | j j   t | p d | p d  | j  } | j d |  j  | j j | |  } | j j |  | S(   Ni  s   User for %s: s
   Password: RV   R   (   t   status_codeR   R   R   R   R   t   movest   inputR   t   getpassR   t   contentt   rawt   release_connR
   R   R   t   warn_on_401t
   connectiont   sendt   historyt   append(   R   t   respt   kwargsR   R   R   R   t   new_resp(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR      s     	$c         K@  s,   | j  d k r( t j d | j j  n  d  S(   Ni  s)   401 Error, Credentials not correct for %s(   R   t   loggert   warningR   R   (   R   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR      s    	(   t   __name__t
   __module__R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR      s   	!	#t   LocalFSAdapterc           B@  s)   e  Z d d d d d d   Z d   Z RS(   c         C@  s   t  | j  } t   } d | _ | j | _ y t j |  }	 Wn% t k
 rg }
 d | _ |
 | _ n} Xt j	 j
 |	 j d t } t j |  d p d } t i | d 6|	 j d 6| d 6 | _ t | d	  | _ | j j | _ | S(
   Ni   i  t   usegmti    s
   text/plains   Content-Types   Content-Lengths   Last-Modifiedt   rb(   R4   R   R   R   R@   t   statt   OSErrorR   t   emailt   utilst
   formatdatet   st_mtimeR   t	   mimetypest
   guess_typeR   t   st_sizet   headerst   opent   close(   R   R   t   streamt   timeoutt   verifyt   certt   proxiest   pathnameR   t   statst   exct   modifiedt   content_type(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR     s$    			
c         C@  s   d  S(   N(    (   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   #  s    N(   R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR     s   t   SafeFileCachec           B@  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   sw   
    A file based cache which is safe to use even when the target directory may
    not be accessible or writable.
    c         O@  sK   t  t |   j | |   t |  j  sG t j d |  j  d  |  _ n  d  S(   Ns   The directory '%s' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.(   t   superR   R   R   t	   directoryR   R   R   (   R   t   argsR   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   -  s    
c         O@  sQ   |  j  d  k r d  Sy t t |   j | |   SWn t t t f k
 rL n Xd  S(   N(   R   R   R   R   R   R   R   t   IOError(   R   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   A  s    c         O@  sQ   |  j  d  k r d  Sy t t |   j | |   SWn t t t f k
 rL n Xd  S(   N(   R   R   R   R   t   setR   R   R   (   R   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   N  s    c         O@  sQ   |  j  d  k r d  Sy t t |   j | |   SWn t t t f k
 rL n Xd  S(   N(   R   R   R   R   t   deleteR   R   R   (   R   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   [  s    (   R   R   t   __doc__R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   '  s
   			t   InsecureHTTPAdapterc           B@  s   e  Z d    Z RS(   c         C@  s   d | _  d  | _ d  S(   Nt	   CERT_NONE(   t	   cert_reqsR   t   ca_certs(   R   t   connR   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   cert_verifyk  s    	(   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   i  s   t
   PipSessionc           B@  s    e  Z d Z d    Z d   Z RS(   c   	      O@  s>  | j  d d  } | j  d d   } | j  d g   } t t |   j | |   t   |  j d <t   |  _ t	 j
 d | d d d	 d
 d g d d  } | r t d t | d t d |  } n t d |  } t d |  } |  j d |  |  j d |  |  j d t    x' | D] } |  j d j |  |  qWd  S(   Nt   retriesi    t   cachet   insecure_hostss
   User-Agentt   totalt   status_forcelisti  i  i  i  t   backoff_factorg      ?t   use_dir_lockt   max_retriess   https://s   http://s   file://s   https://{}/(   t   popR   R   R   R   R   R   R   t   authR   t   RetryR   R   R   R   R   t   mountR   R   (	   R   R   R   R   R   R   t   secure_adaptert   insecure_adaptert   host(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   t  s*    		c         O@  s2   | j  d |  j  t t |   j | | | |  S(   NR   (   R{   R   R   R   R   (   R   t   methodR   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR     s    N(   R   R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   p  s   	>c   
      C@  s  | d k r t d   n  t j |   } | r[| j d  j   } | d k r | r | j d  r t d | |  f   n  | d k r/|  j d d  d } | j	 d d  } t
 j |  } | r | j d  d | j d	 d  d } n  t j |  } | j d  r&d | j d  } n  | }  q[| j |   } | j   | j | j f Sn  y. t |  d
   } t | j    } Wd QXWn) t k
 r}	 t d t |	    n X|  | f S(   s*  Gets the content of a file; it may be a filename, file: URL, or
    http: URL.  Returns (location, content).  Content is unicode.

    :param url:         File path or url.
    :param comes_from:  Origin description of requirements.
    :param session:     Instance of pip.download.PipSession.
    sA   get_file_content() missing 1 required keyword argument: 'session'i   t   filet   https6   Requirements file %s references URL %s, which is localRi   s   \t   /t   |R   Ns$   Could not open requirements file: %s(   R   t	   TypeErrort
   _scheme_ret   searcht   groupt   lowerRt   R   t   splitt   replacet   _url_slash_drive_ret   matchR   t   unquotet   lstripR   t   raise_for_statusR   t   textR   R   t   readR   Rs   (
   R   t
   comes_fromt   sessionR   t   schemet   pathR   t   fR   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR2     s>    	*	
s   ^(http|https|file):s   /*([a-z])\|c         C@  sI   d |  k r t  S|  j d d  d j   } | d d d d g t j k S(   s)   Returns true if the name looks like a URLRi   i   i    R   t   httpsR   t   ftp(   t   FalseR   R   R(   t   all_schemes(   RC   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR3     s    c         C@  s   |  j  d  s t d |    t j |   \ } } } } } | sP | d k rY d } n, t j d k ru d | } n t d |    t j | |  } | S(   s(   
    Convert a file: URL to a path.
    s   file:s4   You can only turn file: urls into filenames (not %r)t	   localhostRV   t   win32s   \\s:   non-local file URIs are not supported on this platform: %r(	   Rt   t   AssertionErrorR   t   urlsplitRo   Rl   t
   ValueErrort   urllib_requestt   url2pathname(   R   t   _R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR4     s    	
c         C@  s=   t  j j t  j j |    }  t j d t j |    } | S(   sh   
    Convert a path to a file: URL.  The path will be made absolute and have
    quoted path parts.
    s   file:(   R@   R   t   normpatht   abspathR   t   urljoinR  t   pathname2url(   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR5     s    c         C@  s*   t  |   d j   } | t k r& t St S(   s9   Return True if `name` is a considered as an archive file.i   (   R#   R   R   R   R   (   RC   t   ext(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR6     s    c         C@  s   t  |   } | j |  d  S(   N(   t   _get_used_vcs_backendt   unpack(   t   linkt   locationt   vcs_backend(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR7   $  s    c         C@  s=   x6 t  j D]+ } |  j | j k r
 | |  j  } | Sq
 Wd  S(   N(   R(   t   backendsR   t   schemesR   (   R  t   backendR  (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR  )  s    c         C@  s   t  t |    S(   N(   t   boolR  (   R  (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR9   0  s    c         C@  s   |  j  j   j d  S(   Ns   file:(   R   R   Rt   (   R  (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR:   5  s    c         C@  s   t  |  j  } t j j |  S(   s   Return whether a file:// Link points to a directory.

    ``link`` must not have any other scheme but file://. Call is_file_url()
    first.

    (   R4   t   url_without_fragmentR@   R   t   isdir(   R  t	   link_path(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt
   is_dir_url:  s    c         O@  s   |  S(   N(    (   t   iterableR   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   _progress_indicatorF  s    c         @  s  y t   j d  } Wn  t t t f k
 r9 d } n Xt  d t  } t j   t	 j
 k rj t } n9 | ry t } n* | d k r t } n | s t } n t } | j }  f d   }	   f d   }
 t } | j t j k r | } n	 | j } | rAt | d | } | r.t j d	 | t |   qjt j d
 |  n) | rZt j d |  n t j d
 |  t j d |  |
 | |	 t  t   } | r| j |  n
 t |  d  S(   Ns   content-lengthi    t
   from_cachei(   i  c         3@  sr   y, x%   j  j |  d t D] } | Vq WWn? t k
 rm x/ t ri   j  j |   } | sa Pn  | Vq? Wn Xd  S(   Nt   decode_content(   R   R   R   t   AttributeErrorR   R   (   t
   chunk_sizet   chunk(   R   (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt	   resp_reade  s    	c         3@  s'   x  |  D] }   j  |  | Vq Wd  S(   N(   t   write(   t   chunksR!  (   t   content_file(    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   written_chunks  s    t   maxs   Downloading %s (%s)s   Downloading %ss   Using cached %ss   Downloading from URL %si@  (   t   intR   R  t   KeyErrorR   t   getattrR   R   t   getEffectiveLevelt   loggingt   INFOR   t   show_urlR  R   R   R  R'   t   infoR   t   debugR   t   check_against_chunksR   (   R   R  R%  t   hashest   progress_bart   total_lengtht   cached_respt   show_progressR.  R"  R&  t   progress_indicatorR   t   downloaded_chunks(    (   R%  R   s5   lib/python2.7/site-packages/pip/_internal/download.pyt   _download_urlJ  sL    
					%					c         C@  s,  t  } t j j | | j  } t j j |  r t d t |  d
  } | d k r^ t } q | d k r t	 j
 d t |   t j |  q | d k r t |  } t	 j
 d t |  t |   t j | |  q | d k r t j d  q n  | r(t j |  |  t	 j d	 t |   n  d  S(   Ns8   The file %s exists. (i)gnore, (w)ipe, (b)ackup, (a)abortt   it   wt   bt   as   Deleting %ss   Backing up %s to %sis   Saved %s(   R:  R;  R<  R=  (   R   R@   R   Rr   t   filenamet   existsR   R   R   R   R   t   removeR   t   shutilt   moveRo   t   exitt   copyR/  (   R>  R  R  RD  t   download_locationR   t	   dest_file(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt
   _copy_file  s.    		t   onc   
   
   C@  s   | d  k r t d   n  t d d   } d  } | rN t |  | |  } n  | rp | } t j |  d }	 n! t |  | | j | |  \ } }	 t | | |	 |   | r | r t	 | | |   n  | s t
 j |  n  Wd  QXd  S(   Ns@   unpack_http_url() missing 1 required keyword argument: 'session't   kindR  i    (   R   R   R%   t   _check_download_dirR   R   t   _download_http_urlR   R$   RG  R@   t   unlink(
   R  R  t   download_dirR   R2  R3  t   temp_dirt   already_downloaded_patht	   from_pathR   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR;     s,    	c         C@  s   t  |  j  } t |   rj t j j |  r: t |  n  t j | | d t	 | rf t
 j d  n  d S| r | j |  n  d } | r t |  | |  } n  | r | } n | } t j |  d } t | | | |   | r | r t | | |   n  d S(   s   Unpack link into location.

    If download_dir is provided and link points to a file, make a copy
    of the link file inside download_dir.
    t   symlinkss*   Link is a directory, ignoring download_dirNi    (   R4   R  R  R@   R   R  R!   RA  t   copytreeR   R   R/  t   check_against_pathR   RJ  R   R   R$   RG  (   R  R  RM  R2  R  RO  RP  R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR8     s,    	t   PipXmlrpcTransportc           B@  s&   e  Z d  Z e d  Z e d  Z RS(   sR   Provide a `xmlrpclib.Transport` implementation via a `PipSession`
    object.
    c         C@  s;   t  j j |  |  t j |  } | j |  _ | |  _ d  S(   N(   R   t	   TransportR   R   R   R   t   _schemet   _session(   R   t	   index_urlR   t   use_datetimet   index_parts(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   3  s    c   
      C@  s   |  j  | | d  d  d  f } t j |  } yX i d d 6} |  j j | d | d | d t } | j   | |  _ |  j	 | j
  SWn2 t j k
 r }	 t j d |	 j j |    n Xd  S(   Ns   text/xmls   Content-TypeRe   R   R   s   HTTP error %s while getting %s(   RV  R   R   R   RW  t   postR   R   t   verboset   parse_responseR   R   t	   HTTPErrorR   t   criticalR   R   (
   R   R   t   handlert   request_bodyR\  t   partsR   R   R   R   (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR   9  s    
	(   R   R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyRT  .  s   c      	   C@  s   t  |   r t |  |  n\ t |   rA t |  | | d | n7 | d k rY t   } n  t |  | | | d | d | | r t |  n  d S(   sv  Unpack link.
       If link is a VCS link:
         if only_download, export into download_dir and ignore location
          else unpack into location
       for other types of link:
         - unpack into location
         - if download_dir, copy the file into download_dir
         - if only_download, mark location for deletion

    :param hashes: A Hashes object, one of whose embedded hashes must match,
        or HashMismatch will be raised. If the Hashes is empty, no matches are
        required, and unhashable types of requirements (like VCS ones, which
        would ordinarily raise HashUnsupported) are allowed.
    R2  R3  N(   R9   R7   R:   R8   R   R   R;   R   (   R  R  RM  t   only_downloadR   R2  R3  (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyR<   K  s    c      
   C@  s  |  j  j d d  d } y0 | j | d i d d 6d t } | j   Wn2 t j k
 r} } t j d | j	 j
 |     n X| j j d	 d
  } |  j }	 | j j d  }
 |
 r t j |
  \ } } | j d  p |	 }	 n  t |	  d } | st j |  } | r|	 | 7}	 qn  | rd|  j  | j  k rdt j j | j   d } | rd|	 | 7}	 qdn  t j j | |	  } t | d   } t | |  | | |  Wd QX| | f S(   s6   Download link url into temp_dir using provided sessiont   #i   i    R   t   identitys   Accept-EncodingR   s   HTTP error %s while getting %ss   content-typeRV   s   content-dispositionR>  t   wbN(   R   R   R   R   R   R   R^  R   R_  R   R   R   R>  t   cgit   parse_headerR#   R   t   guess_extensionR@   R   Rr   R   R9  (   R  R   RN  R2  R3  t
   target_urlR   R   R   R>  t   content_dispositiont   typet   paramsR  t	   file_pathR%  (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyRK  |  s<    			c         C@  s   t  j j | |  j  } t  j j |  r t j d |  | r y | j |  Wq t k
 r t j	 d |  t  j
 |  d SXn  | Sd S(   s    Check download_dir for previously downloaded file with correct hash
        If a correct file is found return its path else None
    s   File was already downloaded %ss;   Previously-downloaded file %s has bad hash. Re-downloading.N(   R@   R   Rr   R>  R?  R   R/  RS  R   R   RL  R   (   R  RM  R2  t   download_path(    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyRJ    s    (   R=   R>   R?   (   t
   __future__R    Rg  t   email.utilsR   R   Rf   R,  R   R@   Rl   t   reRA  Ro   Ru   R   R   R   t   pip._vendor.cachecontrolR   t   pip._vendor.cachecontrol.cachesR   t   pip._vendor.lockfileR   t   pip._vendor.requests.adaptersR   R   t   pip._vendor.requests.authR	   R
   t   pip._vendor.requests.modelsR   R   t   pip._vendor.requests.structuresR   t   pip._vendor.requests.utilsR   t   pip._vendor.six.movesR   t   pip._vendor.six.moves.urllibR   R   R   R  t   pip._vendor.urllib3.utilR   RG   t   pip._internal.exceptionsR   R   t   pip._internal.locationsR   t   pip._internal.models.indexR   t   pip._internal.utils.encodingR   t   pip._internal.utils.filesystemR   t   pip._internal.utils.glibcR   t   pip._internal.utils.miscR   R   R   R   R   R   R    R!   R"   R#   R$   t   pip._internal.utils.temp_dirR%   t   pip._internal.utils.typingR&   t   pip._internal.utils.uiR'   t   pip._internal.vcsR(   t   typingR)   R*   R+   R,   R-   R.   t   pip._internal.models.linkR/   t   pip._internal.utils.hashesR0   R1   R~   t   ImportErrorR   R}   t   __all__t	   getLoggerR   R   RE   RF   R   R   R   R   R   t   SessionR   R2   t   compilet   IR   R   R3   R4   R5   R6   R7   R  R9   R:   R  R  R9  RG  R;   R8   RU  RT  R   R<   RK  RJ  (    (    (    s5   lib/python2.7/site-packages/pip/_internal/download.pyt   <module>   s   L.
		  		OR!BJ/													f	*2 *	B