3

Z'íc ã@s~ddlmZddlmZGdd„deƒZGdd„deƒZGdd	„d	eƒZ	Gd
d„de	ƒZ
Gdd
„d
eƒZGdd„deƒZGdd„deƒZ
Gdd„deƒZeZGdd„de
ƒZGdd„de
ƒZGdd„deƒZGdd„deƒZGdd„dee
ƒZGdd„deƒZGd d!„d!ee	ƒZGd"d#„d#e	ƒZGd$d%„d%e	ƒZGd&d'„d'eeƒZGd(d)„d)eƒZGd*d+„d+eƒZGd,d-„d-eƒZGd.d/„d/eƒZGd0d1„d1eƒZGd2d3„d3eƒZ Gd4d5„d5eƒZ!Gd6d7„d7eƒZ"Gd8d9„d9eƒZ#Gd:d;„d;eƒZ$Gd<d=„d=eeƒZ%Gd>d?„d?eƒZ&Gd@dA„dAeeƒZGdBdC„dCeeƒZ'GdDdE„dEeƒZ(GdFdG„dGe)eƒZ*GdHdI„dIeƒZ+GdJdK„dKeƒZ,GdLdM„dMeƒZ-dNS)Oé)Úabsolute_importé)ÚIncompleteReadc@seZdZdZdS)Ú	HTTPErrorz#Base exception used by this module.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__©r
r
ú5/tmp/pip-build-gk9425m9/urllib3/urllib3/exceptions.pyrsrc@seZdZdZdS)ÚHTTPWarningz!Base warning used by this module.N)rrrr	r
r
r
rrsrc@s eZdZdZdd„Zdd„ZdS)Ú	PoolErrorz/Base exception for errors caused within a pool.cCs||_tj|d||fƒdS)Nz%s: %s)ÚpoolrÚ__init__)ÚselfrÚmessager
r
rrszPoolError.__init__cCs
|jdfS)N)NN)Ú	__class__)rr
r
rÚ
__reduce__szPoolError.__reduce__N)rrrr	rrr
r
r
rr
sr
c@s eZdZdZdd„Zdd„ZdS)ÚRequestErrorz8Base exception for PoolErrors that have associated URLs.cCs||_tj|||ƒdS)N)Úurlr
r)rrrrr
r
rr#szRequestError.__init__cCs|jd|jdffS)N)rr)rr
r
rr'szRequestError.__reduce__N)rrrr	rrr
r
r
rr src@seZdZdZdS)ÚSSLErrorz9Raised when SSL certificate fails in an HTTPS connection.N)rrrr	r
r
r
rr,srcs eZdZdZ‡fdd„Z‡ZS)Ú
ProxyErrorz,Raised when the connection to a proxy fails.cs"tt|ƒj||f|žŽ||_dS)N)ÚsuperrrÚoriginal_error)rrÚerrorÚargs)rr
rr5szProxyError.__init__)rrrr	rÚ
__classcell__r
r
)rrr2src@seZdZdZdS)ÚDecodeErrorz;Raised when automatic decoding based on Content-Type fails.N)rrrr	r
r
r
rr:src@seZdZdZdS)Ú
ProtocolErrorz>Raised when something unexpected happens mid-request/response.N)rrrr	r
r
r
rr@src@seZdZdZddd„ZdS)Ú
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

    NcCs&||_d||f}tj||||ƒdS)Nz0Max retries exceeded with url: %s (Caused by %r))Úreasonrr)rrrr rr
r
rrWszMaxRetryError.__init__)N)rrrr	rr
r
r
rrMsrc@seZdZdZddd„ZdS)ÚHostChangedErrorz?Raised when an existing pool gets a request for a foreign host.écCs"d|}tj||||ƒ||_dS)Nz)Tried to open a foreign host with url: %s)rrÚretries)rrrr#rr
r
rrbszHostChangedError.__init__N)r")rrrr	rr
r
r
rr!_sr!c@seZdZdZdS)ÚTimeoutStateErrorz1Raised when passing an invalid state to a timeoutN)rrrr	r
r
r
rr$hsr$c@seZdZdZdS)ÚTimeoutErrorz¿Raised when a socket timeout error occurs.

    Catching this error will catch both :exc:`ReadTimeoutErrors
    <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`.
    N)rrrr	r
r
r
rr%nsr%c@seZdZdZdS)ÚReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverN)rrrr	r
r
r
rr&xsr&c@seZdZdZdS)ÚConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverN)rrrr	r
r
r
rr'€sr'c@seZdZdZdS)ÚNewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.N)rrrr	r
r
r
rr(†sr(c@seZdZdZdS)ÚEmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.N)rrrr	r
r
r
rr)Œsr)c@seZdZdZdS)ÚClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.N)rrrr	r
r
r
rr*’sr*c@seZdZdZdS)ÚLocationValueErrorz<Raised when there is something wrong with a given URL input.N)rrrr	r
r
r
rr+˜sr+c@seZdZdZdd„ZdS)ÚLocationParseErrorz=Raised when get_host or similar fails to parse the URL input.cCsd|}tj||ƒ||_dS)NzFailed to parse: %s)rrÚlocation)rr-rr
r
rr¡szLocationParseError.__init__N)rrrr	rr
r
r
rr,žsr,cs eZdZdZ‡fdd„Z‡ZS)ÚURLSchemeUnknownz2Raised when a URL input has an unsupported scheme.cs"d|}tt|ƒj|ƒ||_dS)NzNot supported URL scheme %s)rr.rÚscheme)rr/r)rr
rr«szURLSchemeUnknown.__init__)rrrr	rrr
r
)rrr.¨sr.c@seZdZdZdZdZdS)Ú
ResponseErrorzDUsed as a container for an error reason supplied in a MaxRetryError.ztoo many error responsesz&too many {status_code} error responsesN)rrrr	Ú
GENERIC_ERRORÚSPECIFIC_ERRORr
r
r
rr0²sr0c@seZdZdZdS)ÚSecurityWarningz0Warned when performing security reducing actionsN)rrrr	r
r
r
rr3¹sr3c@seZdZdZdS)ÚSubjectAltNameWarningzBWarned when connecting to a host with a certificate missing a SAN.N)rrrr	r
r
r
rr4¿sr4c@seZdZdZdS)ÚInsecureRequestWarningz/Warned when making an unverified HTTPS request.N)rrrr	r
r
r
rr5Åsr5c@seZdZdZdS)ÚSystemTimeWarningz0Warned when system time is suspected to be wrongN)rrrr	r
r
r
rr6Ësr6c@seZdZdZdS)ÚInsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.N)rrrr	r
r
r
rr7Ñsr7c@seZdZdZdS)ÚSNIMissingWarningz9Warned when making a HTTPS request without SNI available.N)rrrr	r
r
r
rr8×sr8c@seZdZdZdS)ÚDependencyWarningzc
    Warned when an attempt is made to import a module with missing optional
    dependencies.
    N)rrrr	r
r
r
rr9Ýsr9c@seZdZdZdS)ÚResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.N)rrrr	r
r
r
rr:æsr:c@seZdZdZdS)ÚBodyNotHttplibCompatiblez‡
    Body should be :class:`http.client.HTTPResponse` like
    (have an fp attribute which returns raw chunks) for read_chunked().
    N)rrrr	r
r
r
rr;ìsr;cs(eZdZdZ‡fdd„Zdd„Z‡ZS)rzÎ
    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.
    cstt|ƒj||ƒdS)N)rrr)rÚpartialÚexpected)rr
rrýszIncompleteRead.__init__cCsd|j|jfS)Nz/IncompleteRead(%i bytes read, %i more expected))r<r=)rr
r
rÚ__repr__szIncompleteRead.__repr__)rrrr	rr>rr
r
)rrrõsrcs(eZdZdZ‡fdd„Zdd„Z‡ZS)ÚInvalidChunkLengthz+Invalid chunk length in a chunked response.cs(tt|ƒj|jƒ|jƒ||_||_dS)N)rr?rÚtellÚlength_remainingÚresponseÚlength)rrBrC)rr
rr
s
zInvalidChunkLength.__init__cCsd|j|jfS)Nz0InvalidChunkLength(got length %r, %i bytes read))rCr<)rr
r
rr>szInvalidChunkLength.__repr__)rrrr	rr>rr
r
)rrr?sr?c@seZdZdZdS)Ú
InvalidHeaderz(The header provided was somehow invalid.N)rrrr	r
r
r
rrDsrDcs eZdZdZ‡fdd„Z‡ZS)ÚProxySchemeUnknownz1ProxyManager does not support the supplied schemecs6|dkrd}|dkrd}nd|}tt|ƒj|ƒdS)NÚ	localhostz>Proxy URL had no scheme, should start with http:// or https://zCProxy URL had unsupported scheme %s, should use http:// or https://)rrEr)rr/r)rr
rr#szProxySchemeUnknown.__init__)rrrr	rrr
r
)rrrEsrEc@seZdZdZdS)ÚProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedN)rrrr	r
r
r
rrG2srGcs eZdZdZ‡fdd„Z‡ZS)ÚHeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.cs$d|pd|f}tt|ƒj|ƒdS)Nz%s, unparsed data: %rÚUnknown)rrHr)rÚdefectsÚ
unparsed_datar)rr
rr;szHeaderParsingError.__init__)rrrr	rrr
r
)rrrH8srHc@seZdZdZdS)ÚUnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyN)rrrr	r
r
r
rrL@srLN).Ú
__future__rZpackages.six.moves.http_clientrÚhttplib_IncompleteReadÚ	ExceptionrÚWarningrr
rrrrrÚConnectionErrorrr!r$r%r&r'r(r)r*Ú
ValueErrorr+r,r.r0r3r4r5r6r7r8r9r:r;r?rDÚAssertionErrorrErGrHrLr
r
r
rÚ<module>sN