
†Kðh   ã               @   sm  d  d l  m Z d d l m Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d	 „  d	 e ƒ Z	 Gd
 d „  d e	 ƒ Z
 Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z e Z Gd d „  d e
 ƒ Z Gd d „  d e
 ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e e
 ƒ Z Gd d „  d e ƒ Z Gd  d! „  d! e e	 ƒ Z Gd" d# „  d# e	 ƒ Z Gd$ d% „  d% e	 ƒ Z Gd& d' „  d' e e ƒ Z Gd( d) „  d) e ƒ Z Gd* d+ „  d+ e ƒ Z Gd, d- „  d- e ƒ Z Gd. d/ „  d/ e ƒ Z Gd0 d1 „  d1 e ƒ Z Gd2 d3 „  d3 e ƒ Z  Gd4 d5 „  d5 e ƒ Z! Gd6 d7 „  d7 e ƒ Z" Gd8 d9 „  d9 e ƒ Z# Gd: d; „  d; e ƒ Z$ Gd< d= „  d= e e ƒ Z% Gd> d? „  d? e ƒ Z& Gd@ dA „  dA e e ƒ Z GdB dC „  dC e e ƒ Z' GdD dE „  dE e ƒ Z( GdF dG „  dG e) e ƒ Z* GdH dI „  dI e ƒ Z+ GdJ dK „  dK e ƒ Z, GdL dM „  dM e ƒ Z- dN S)Oé    )Úabsolute_importé   )ÚIncompleteReadc               @   s   e  Z d  Z d Z d S)Ú	HTTPErrorz#Base exception used by this module.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   úN/mod/web/acousticsspace/venv/lib/python3.5/site-packages/urllib3/exceptions.pyr      s   r   c               @   s   e  Z d  Z d Z d S)ÚHTTPWarningz!Base warning used by this module.N)r   r   r   r	   r
   r
   r
   r   r      s   r   c               @   s.   e  Z d  Z d Z d d „  Z d d „  Z d S)Ú	PoolErrorz/Base exception for errors caused within a pool.c             C   s'   | |  _  t j |  d | | f ƒ d  S)Nz%s: %s)Úpoolr   Ú__init__)Úselfr   Úmessager
   r
   r   r      s    	zPoolError.__init__c             C   s   |  j  d f S)N)NN)Ú	__class__)r   r
   r
   r   Ú
__reduce__   s    zPoolError.__reduce__N)r   r   r   r	   r   r   r
   r
   r
   r   r      s   r   c               @   s.   e  Z d  Z d Z d d „  Z d d „  Z d S)ÚRequestErrorz8Base exception for PoolErrors that have associated URLs.c             C   s    | |  _  t j |  | | ƒ d  S)N)Úurlr   r   )r   r   r   r   r
   r
   r   r   #   s    	zRequestError.__init__c             C   s   |  j  d  |  j d  f f S)N)r   r   )r   r
   r
   r   r   '   s    zRequestError.__reduce__N)r   r   r   r	   r   r   r
   r
   r
   r   r       s   r   c               @   s   e  Z d  Z d Z d S)ÚSSLErrorz9Raised when SSL certificate fails in an HTTPS connection.N)r   r   r   r	   r
   r
   r
   r   r   ,   s   r   c                   s(   e  Z d  Z d Z ‡  f d d †  Z ‡  S)Ú
ProxyErrorz,Raised when the connection to a proxy fails.c                s)   t  t |  ƒ j | | | Œ | |  _ d  S)N)Úsuperr   r   Úoriginal_error)r   r   ÚerrorÚargs)r   r
   r   r   5   s    zProxyError.__init__)r   r   r   r	   r   r
   r
   )r   r   r   2   s   r   c               @   s   e  Z d  Z d Z d S)ÚDecodeErrorz;Raised when automatic decoding based on Content-Type fails.N)r   r   r   r	   r
   r
   r
   r   r   :   s   r   c               @   s   e  Z d  Z d Z d S)ÚProtocolErrorz>Raised when something unexpected happens mid-request/response.N)r   r   r   r	   r
   r
   r
   r   r   @   s   r   c               @   s%   e  Z d  Z d Z d d d „ Z d S)ÚMaxRetryErrora  Raised when the maximum number of retries is exceeded.

    :param pool: The connection pool
    :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool`
    :param string url: The requested Url
    :param exceptions.Exception reason: The underlying error

    Nc             C   s3   | |  _  d | | f } t j |  | | | ƒ d  S)Nz0Max retries exceeded with url: %s (Caused by %r))Úreasonr   r   )r   r   r   r   r   r
   r
   r   r   W   s    	zMaxRetryError.__init__)r   r   r   r	   r   r
   r
   r
   r   r   M   s   r   c               @   s%   e  Z d  Z d Z d d d „ Z d S)ÚHostChangedErrorz?Raised when an existing pool gets a request for a foreign host.é   c             C   s-   d | } t  j |  | | | ƒ | |  _ d  S)Nz)Tried to open a foreign host with url: %s)r   r   Úretries)r   r   r   r"   r   r
   r
   r   r   b   s    
zHostChangedError.__init__N)r   r   r   r	   r   r
   r
   r
   r   r    _   s   r    c               @   s   e  Z d  Z d Z d S)ÚTimeoutStateErrorz1Raised when passing an invalid state to a timeoutN)r   r   r   r	   r
   r
   r
   r   r#   h   s   r#   c               @   s   e  Z d  Z d Z d S)ÚTimeoutErrorz¿Raised when a socket timeout error occurs.

    Catching this error will catch both :exc:`ReadTimeoutErrors
    <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`.
    N)r   r   r   r	   r
   r
   r
   r   r$   n   s   r$   c               @   s   e  Z d  Z d Z d S)ÚReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverN)r   r   r   r	   r
   r
   r
   r   r%   x   s   r%   c               @   s   e  Z d  Z d Z d S)ÚConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverN)r   r   r   r	   r
   r
   r
   r   r&   €   s   r&   c               @   s   e  Z d  Z d Z d S)ÚNewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.N)r   r   r   r	   r
   r
   r
   r   r'   †   s   r'   c               @   s   e  Z d  Z d Z d S)ÚEmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.N)r   r   r   r	   r
   r
   r
   r   r(   Œ   s   r(   c               @   s   e  Z d  Z d Z d S)ÚClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.N)r   r   r   r	   r
   r
   r
   r   r)   ’   s   r)   c               @   s   e  Z d  Z d Z d S)ÚLocationValueErrorz<Raised when there is something wrong with a given URL input.N)r   r   r   r	   r
   r
   r
   r   r*   ˜   s   r*   c               @   s"   e  Z d  Z d Z d d „  Z d S)ÚLocationParseErrorz=Raised when get_host or similar fails to parse the URL input.c             C   s'   d | } t  j |  | ƒ | |  _ d  S)NzFailed to parse: %s)r   r   Úlocation)r   r,   r   r
   r
   r   r   ¡   s    
zLocationParseError.__init__N)r   r   r   r	   r   r
   r
   r
   r   r+   ž   s   r+   c                   s(   e  Z d  Z d Z ‡  f d d †  Z ‡  S)ÚURLSchemeUnknownz2Raised when a URL input has an unsupported scheme.c                s-   d | } t  t |  ƒ j | ƒ | |  _ d  S)NzNot supported URL scheme %s)r   r-   r   Úscheme)r   r.   r   )r   r
   r   r   «   s    
zURLSchemeUnknown.__init__)r   r   r   r	   r   r
   r
   )r   r   r-   ¨   s   r-   c               @   s"   e  Z d  Z d Z d Z d Z d S)ÚResponseErrorzDUsed as a container for an error reason supplied in a MaxRetryError.ztoo many error responsesz&too many {status_code} error responsesN)r   r   r   r	   ÚGENERIC_ERRORÚSPECIFIC_ERRORr
   r
   r
   r   r/   ²   s   r/   c               @   s   e  Z d  Z d Z d S)ÚSecurityWarningz0Warned when performing security reducing actionsN)r   r   r   r	   r
   r
   r
   r   r2   ¹   s   r2   c               @   s   e  Z d  Z d Z d S)ÚSubjectAltNameWarningzBWarned when connecting to a host with a certificate missing a SAN.N)r   r   r   r	   r
   r
   r
   r   r3   ¿   s   r3   c               @   s   e  Z d  Z d Z d S)ÚInsecureRequestWarningz/Warned when making an unverified HTTPS request.N)r   r   r   r	   r
   r
   r
   r   r4   Å   s   r4   c               @   s   e  Z d  Z d Z d S)ÚSystemTimeWarningz0Warned when system time is suspected to be wrongN)r   r   r   r	   r
   r
   r
   r   r5   Ë   s   r5   c               @   s   e  Z d  Z d Z d S)ÚInsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.N)r   r   r   r	   r
   r
   r
   r   r6   Ñ   s   r6   c               @   s   e  Z d  Z d Z d S)ÚSNIMissingWarningz9Warned when making a HTTPS request without SNI available.N)r   r   r   r	   r
   r
   r
   r   r7   ×   s   r7   c               @   s   e  Z d  Z d Z d S)ÚDependencyWarningzc
    Warned when an attempt is made to import a module with missing optional
    dependencies.
    N)r   r   r   r	   r
   r
   r
   r   r8   Ý   s   r8   c               @   s   e  Z d  Z d Z d S)ÚResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.N)r   r   r   r	   r
   r
   r
   r   r9   æ   s   r9   c               @   s   e  Z d  Z d Z d S)ÚBodyNotHttplibCompatiblez‡
    Body should be :class:`http.client.HTTPResponse` like
    (have an fp attribute which returns raw chunks) for read_chunked().
    N)r   r   r   r	   r
   r
   r
   r   r:   ì   s   r:   c                   s4   e  Z d  Z d Z ‡  f d d †  Z d d „  Z ‡  S)r   zÎ
    Response length doesn't match expected Content-Length

    Subclass of :class:`http.client.IncompleteRead` to allow int value
    for ``partial`` to avoid creating large objects on streamed reads.
    c                s   t  t |  ƒ j | | ƒ d  S)N)r   r   r   )r   ÚpartialÚexpected)r   r
   r   r   ý   s    zIncompleteRead.__init__c             C   s   d |  j  |  j f S)Nz/IncompleteRead(%i bytes read, %i more expected))r;   r<   )r   r
   r
   r   Ú__repr__   s    zIncompleteRead.__repr__)r   r   r   r	   r   r=   r
   r
   )r   r   r   õ   s   r   c                   s4   e  Z d  Z d Z ‡  f d d †  Z d d „  Z ‡  S)ÚInvalidChunkLengthz+Invalid chunk length in a chunked response.c                s8   t  t |  ƒ j | j ƒ  | j ƒ | |  _ | |  _ d  S)N)r   r>   r   ÚtellÚlength_remainingÚresponseÚlength)r   rA   rB   )r   r
   r   r   
  s    	zInvalidChunkLength.__init__c             C   s   d |  j  |  j f S)Nz0InvalidChunkLength(got length %r, %i bytes read))rB   r;   )r   r
   r
   r   r=     s    zInvalidChunkLength.__repr__)r   r   r   r	   r   r=   r
   r
   )r   r   r>     s   r>   c               @   s   e  Z d  Z d Z d S)ÚInvalidHeaderz(The header provided was somehow invalid.N)r   r   r   r	   r
   r
   r
   r   rC     s   rC   c                   s(   e  Z d  Z d Z ‡  f d d †  Z ‡  S)ÚProxySchemeUnknownz1ProxyManager does not support the supplied schemec                sK   | d k r d  } | d  k r' d } n
 d | } t  t |  ƒ j | ƒ d  S)NÚ	localhostz>Proxy URL had no scheme, should start with http:// or https://zCProxy URL had unsupported scheme %s, should use http:// or https://)r   rD   r   )r   r.   r   )r   r
   r   r   #  s    	zProxySchemeUnknown.__init__)r   r   r   r	   r   r
   r
   )r   r   rD     s   rD   c               @   s   e  Z d  Z d Z d S)ÚProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedN)r   r   r   r	   r
   r
   r
   r   rF   2  s   rF   c                   s(   e  Z d  Z d Z ‡  f d d †  Z ‡  S)ÚHeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.c                s0   d | p d | f } t  t |  ƒ j | ƒ d  S)Nz%s, unparsed data: %rÚUnknown)r   rG   r   )r   ÚdefectsÚunparsed_datar   )r   r
   r   r   ;  s    zHeaderParsingError.__init__)r   r   r   r	   r   r
   r
   )r   r   rG   8  s   rG   c               @   s   e  Z d  Z d Z d S)ÚUnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyN)r   r   r   r	   r
   r
   r
   r   rK   @  s   rK   N).Ú
__future__r   Zpackages.six.moves.http_clientr   Úhttplib_IncompleteReadÚ	Exceptionr   ÚWarningr   r   r   r   r   r   r   ÚConnectionErrorr   r    r#   r$   r%   r&   r'   r(   r)   Ú
ValueErrorr*   r+   r-   r/   r2   r3   r4   r5   r6   r7   r8   r9   r:   r>   rC   ÚAssertionErrorrD   rF   rG   rK   r
   r
   r
   r   Ú<module>   sN   	


		