ξ
)Ϊ Xί  γ               @   s½  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 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 e  Z! Gd: d;   d; e" e  Z# Gd< d=   d= e  Z$ d> S)?ι    )Ϊabsolute_importc               @   s   e  Z d  Z d Z d S)Ϊ	HTTPErrorz#Base exception used by this module.N)Ϊ__name__Ϊ
__module__Ϊ__qualname__Ϊ__doc__© r   r   ϊT/home/ubuntu/projects/ifolica/build/requests/requests/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 d S)Ϊ
ProxyErrorz,Raised when the connection to a proxy fails.N)r   r   r   r   r   r   r   r	   r   *   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   4   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   I   s    	zMaxRetryError.__init__)r   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)Ϊ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   U   s    
zHostChangedError.__init__N)r   r   r   r   r   r   r   r   r	   r   R   s   r   c               @   s   e  Z d  Z d Z d S)ΪTimeoutStateErrorz3 Raised when passing an invalid state to a timeout N)r   r   r   r   r   r   r   r	   r   [   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   `   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   i   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    p   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!   u   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"   z   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 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   ZGENERIC_ERRORZSPECIFIC_ERRORr   r   r   r	   r'      s   r'   c               @   s   e  Z d  Z d Z d S)ΪSecurityWarningz/Warned when perfoming security reducing actionsN)r   r   r   r   r   r   r   r	   r(      s   r(   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	   r)      s   r)   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	   r*   £   s   r*   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	   r+   ¨   s   r+   c               @   s   e  Z d  Z d Z d S)ΪInsecurePlatformWarningzEWarned when certain SSL configuration is not available on a platform.N)r   r   r   r   r   r   r   r	   r,   ­   s   r,   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	   r-   ²   s   r-   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	   r.   ·   s   r.   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	   r/   Ώ   s   r/   c                   s(   e  Z d  Z d Z   f d d   Z   S)ΪProxySchemeUnknownz1ProxyManager does not support the supplied schemec                s$   d | } t  t |   j |  d  S)NzNot supported proxy scheme %s)Ϊsuperr0   r   )r   Ϊschemer   )r   r   r	   r   Θ   s    
zProxySchemeUnknown.__init__)r   r   r   r   r   r   r   )r   r	   r0   Δ   s   r0   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)r1   r3   r   )r   ΪdefectsZunparsed_datar   )r   r   r	   r   Ο   s    zHeaderParsingError.__init__)r   r   r   r   r   r   r   )r   r	   r3   Ν   s   r3   N)%Ϊ
__future__r   Ϊ	Exceptionr   ΪWarningr
   r   r   r   r   r   r   ΪConnectionErrorr   r   r   r   r   r    r!   r"   r#   Ϊ
ValueErrorr$   r%   r'   r(   r)   r*   r+   r,   r-   r.   r/   ΪAssertionErrorr0   r3   r   r   r   r	   Ϊ<module>   s>   		
	