
    <@g%                       d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ	 ej                  rddlmZ ddlmZ ddlmZ dd	lmZ  G d
 de      Z G d de      Zeej0                  def   eedf   f   Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z e Z! G d de      Z" G d de      Z# G d d e      Z$ G d! d"e      Z% G d# d$e%e      Z& G d% d&e%      Z' G d' d(e'e      Z( G d) d*e(      Z) G d+ d,e      Z* G d- d.e      Z+ G d/ d0e      Z, G d1 d2e-e      Z. G d3 d4e.      Z/ G d5 d6e.      Z0 G d7 d8e      Z1 G d9 d:e      Z2 G d; d<e2      Z3 G d= d>e2      Z4 G d? d@e2      Z5 G dA dBe2      Z6 G dC dDe      Z7 G dE dFe e-      Z8 G dG dHe      Z9 G dI dJee	      Z G dK dLee	      Z: G dM dNe      Z; G dO dPe<e0      Z= G dQ dRe-      Z> G dS dTe      Z? G dU dVe      Z@y)W    )annotationsN)MessageDefect)IncompleteRead   )HTTPConnection)ConnectionPool)HTTPResponse)Retryc                      e Zd ZdZy)	HTTPErrorz#Base exception used by this module.N__name__
__module____qualname____doc__     Q/var/www/html/AdoubleTech/venv/lib/python3.12/site-packages/urllib3/exceptions.pyr   r      s    -r   r   c                      e Zd ZdZy)HTTPWarningz!Base warning used by this module.Nr   r   r   r   r   r      s    +r   r   .c                  ,     e Zd ZdZd fdZddZ xZS )	PoolErrorz/Base exception for errors caused within a pool.c                <    || _         t        | 	  | d|        y Nz: )poolsuper__init__)selfr   message	__class__s      r   r   zPoolError.__init__    "    	D6G9-.r   c                    | j                   dfS N)NNr    r   s    r   
__reduce__zPoolError.__reduce__$       ~~|++r   )r   r   r   strreturnNoner)   _TYPE_REDUCE_RESULTr   r   r   r   r   r&   __classcell__r$   s   @r   r   r      s    9/,r   r   c                  ,     e Zd ZdZd fdZddZ xZS )RequestErrorz8Base exception for PoolErrors that have associated URLs.c                4    || _         t        | 	  ||       y N)urlr   r   )r   r   r3   r   r    s       r   r   zRequestError.__init__,   s    w'r   c                8    | j                   d | j                  d ffS r2   )r    r3   r%   s    r   r&   zRequestError.__reduce__0   s    ~~dhh555r   )r   r   r3   r(   r   r(   r)   r*   r+   r-   r$   s   @r   r0   r0   )   s    B(6r   r0   c                      e Zd ZdZy)SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr   r   r   r   r6   r6   5       Cr   r6   c                  0     e Zd ZU dZded<   d fdZ xZS )
ProxyErrorz,Raised when the connection to a proxy fails.	Exceptionoriginal_errorc                4    t         |   ||       || _        y r2   )r   r   r;   )r   r   errorr    s      r   r   zProxyError.__init__?   s    %(#r   )r   r(   r=   r:   r)   r*   )r   r   r   r   __annotations__r   r.   r$   s   @r   r9   r9   9   s    6 $ $r   r9   c                      e Zd ZdZy)DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr   r   r   r   r@   r@   D       Er   r@   c                      e Zd ZdZy)ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r   r   r   rC   rC   H   s    Hr   rC   c                  6     e Zd ZdZ	 d	 	 	 	 	 	 	 d fdZ xZS )MaxRetryErrora  Raised when the maximum number of retries is exceeded.

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

    c                H    || _         d| d|d}t        | 	  |||       y )NzMax retries exceeded with url: z (Caused by ))reasonr   r   )r   r   r3   rH   r   r    s        r   r   zMaxRetryError.__init__^   s1     3C5VJaPsG,r   r2   )r   r   r3   r(   rH   zException | Noner)   r*   r   r   r   r   r   r.   r$   s   @r   rE   rE   S   s9     JN-"-),-6F-	- -r   rE   c                  6     e Zd ZdZ	 d	 	 	 	 	 	 	 d fdZ xZS )HostChangedErrorz?Raised when an existing pool gets a request for a foreign host.c                @    d| }t         |   |||       || _        y )Nz'Tried to open a foreign host with url: )r   r   retries)r   r   r3   rM   r   r    s        r   r   zHostChangedError.__init__k   s)     <C5AsG,r   )   )r   r   r3   r(   rM   zRetry | intr)   r*   rI   r$   s   @r   rK   rK   h   s7    I FG"),7B	 r   rK   c                      e Zd ZdZy)TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr   r   r   r   rP   rP   s   s    ;r   rP   c                      e Zd ZdZy)TimeoutErrorzRaised when a socket timeout error occurs.

    Catching this error will catch both :exc:`ReadTimeoutErrors
    <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`.
    Nr   r   r   r   rR   rR   w   s    r   rR   c                      e Zd ZdZy)ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr   r   r   r   rT   rT      s    Pr   rT   c                      e Zd ZdZy)ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr   r   r   r   rV   rV      s    Jr   rV   c                  >     e Zd ZdZd fdZddZedd       Z xZS )NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.c                <    || _         t        | 	  | d|        y r   )connr   r   )r   rZ   r   r    s      r   r   zNewConnectionError.__init__   r!   r   c                    | j                   dfS r#   r$   r%   s    r   r&   zNewConnectionError.__reduce__   r'   r   c                R    t        j                  dt        d       | j                  S )Nz\The 'pool' property is deprecated and will be removed in urllib3 v2.1.0. Use 'conn' instead.   )
stacklevel)warningswarnDeprecationWarningrZ   r%   s    r   r   zNewConnectionError.pool   s%    5		
 yyr   )rZ   r   r   r(   r)   r*   r+   )r)   r   )	r   r   r   r   r   r&   propertyr   r.   r$   s   @r   rX   rX      s$    R/,  r   rX   c                  ,     e Zd ZdZd fdZddZ xZS )NameResolutionErrorz'Raised when host name resolution fails.c                8    d| d| d}t         |   ||       y )NzFailed to resolve 'z' (rG   r   r   )r   hostrZ   rH   r   r    s        r   r   zNameResolutionError.__init__   s&    'vS:w'r   c                    | j                   dfS )N)NNNr$   r%   s    r   r&   zNameResolutionError.__reduce__   s    ~~111r   )rg   r(   rZ   r   rH   zsocket.gaierrorr+   r-   r$   s   @r   rd   rd      s    1(2r   rd   c                      e Zd ZdZy)EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nr   r   r   r   rj   rj          Mr   rj   c                      e Zd ZdZy)FullPoolErrorzGRaised when we try to add a connection to a full pool in blocking mode.Nr   r   r   r   rm   rm      s    Qr   rm   c                      e Zd ZdZy)ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nr   r   r   r   ro   ro      rk   r   ro   c                      e Zd ZdZy)LocationValueErrorz<Raised when there is something wrong with a given URL input.Nr   r   r   r   rq   rq      s    Fr   rq   c                  $     e Zd ZdZd fdZ xZS )LocationParseErrorz=Raised when get_host or similar fails to parse the URL input.c                <    d| }t         |   |       || _        y )NzFailed to parse: )r   r   location)r   ru   r   r    s      r   r   zLocationParseError.__init__   s#    %hZ0! r   )ru   r(   r)   r*   rI   r$   s   @r   rs   rs      s    G! !r   rs   c                  $     e Zd ZdZd fdZ xZS )URLSchemeUnknownz2Raised when a URL input has an unsupported scheme.c                <    d| }t         |   |       || _        y )NzNot supported URL scheme )r   r   schemer   ry   r   r    s      r   r   zURLSchemeUnknown.__init__   s#    -fX6!r   )ry   r(   rI   r$   s   @r   rw   rw      s    < r   rw   c                      e Zd ZdZdZdZy)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    N.M=Nr   r|   c                      e Zd ZdZy)SecurityWarningz0Warned when performing security reducing actionsNr   r   r   r   r   r          :r   r   c                      e Zd ZdZy)InsecureRequestWarningz/Warned when making an unverified HTTPS request.Nr   r   r   r   r   r      s    9r   r   c                      e Zd ZdZy)NotOpenSSLWarningz)Warned when using unsupported SSL libraryNr   r   r   r   r   r      s    3r   r   c                      e Zd ZdZy)SystemTimeWarningz0Warned when system time is suspected to be wrongNr   r   r   r   r   r      r   r   r   c                      e Zd ZdZy)InsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.Nr   r   r   r   r   r      s    Sr   r   c                      e Zd ZdZy)DependencyWarningzc
    Warned when an attempt is made to import a module with missing optional
    dependencies.
    Nr   r   r   r   r   r          r   r   c                      e Zd ZdZy)ResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.Nr   r   r   r   r   r      rA   r   r   c                      e Zd ZdZy)BodyNotHttplibCompatiblez
    Body should be :class:`http.client.HTTPResponse` like
    (have an fp attribute which returns raw chunks) for read_chunked().
    Nr   r   r   r   r   r      r   r   r   c                  6    e Zd ZU dZded<   ded<   ddZd	dZy)
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.
    intpartialexpectedc                     || _         || _        y r2   r   r   )r   r   r   s      r   r   zIncompleteRead.__init__  s     r   c                8    d| j                   | j                  fz  S )Nz/IncompleteRead(%i bytes read, %i more expected)r   r%   s    r   __repr__zIncompleteRead.__repr__  s#    @LLMMD
 
 	
r   N)r   r   r   r   r)   r*   r)   r(   )r   r   r   r   r>   r   r   r   r   r   r   r      s     LM!
r   r   c                       e Zd ZdZddZddZy)InvalidChunkLengthz+Invalid chunk length in a chunked response.c                l    |j                         | _        |j                  | _        || _        || _        y r2   )tellr   length_remainingr   responselength)r   r   r   s      r   r   zInvalidChunkLength.__init__  s*    $MMO$,$=$= r   c                8    d| j                   | j                  fz  S )Nz0InvalidChunkLength(got length %r, %i bytes read))r   r   r%   s    r   r   zInvalidChunkLength.__repr__  s#    AKKLLE
 
 	
r   N)r   r	   r   bytesr)   r*   r   )r   r   r   r   r   r   r   r   r   r   r     s    5
r   r   c                      e Zd ZdZy)InvalidHeaderz(The header provided was somehow invalid.Nr   r   r   r   r   r   #  s    2r   r   c                  $     e Zd ZdZd fdZ xZS )ProxySchemeUnknownz1ProxyManager does not support the supplied schemec                H    |dk(  rd }|d}nd| d}t         |   |       y )N	localhostz>Proxy URL had no scheme, should start with http:// or https://z!Proxy URL had unsupported scheme z , should use http:// or https://rf   rz   s      r   r   zProxySchemeUnknown.__init__,  s8     [ F>VG9&AabG!r   )ry   z
str | Noner)   r*   rI   r$   s   @r   r   r   '  s    ;	" 	"r   r   c                      e Zd ZdZy)ProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedNr   r   r   r   r   r   8  s    Gr   r   c                  0     e Zd ZdZ	 	 	 	 	 	 d fdZ xZS )HeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.c                :    |xs d d|}t         |   |       y )NUnknownz, unparsed data: rf   )r   defectsunparsed_datar   r    s       r   r   zHeaderParsingError.__init__?  s*     )	**;M;LM!r   )r   zlist[MessageDefect]r   zbytes | str | Noner)   r*   rI   r$   s   @r   r   r   <  s(    X"*";M"	" "r   r   c                      e Zd ZdZy)UnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNr   r   r   r   r   r   F  r7   r   r   )A
__future__r   sockettypingr_   email.errorsr   http.clientr   httplib_IncompleteReadTYPE_CHECKING
connectionr   connectionpoolr   r   r	   
util.retryr
   r:   r   Warningr   tupleCallableobjectr,   r   r0   r6   r9   r@   rC   ConnectionErrorrE   rK   rP   rR   rT   rV   rX   rd   rj   rm   ro   
ValueErrorrq   rs   rw   r|   r   r   r   r   r   r   r   r   r   r   AssertionErrorr   r   r   r   r   r   r   <module>r      sR   "    & @	*.&!
.	 .,' , FOOCK8%:LLM 	,	 	,	69 	6Dy D$ $F) FII I
  -L -*| <	 <9 Q|\ QK, K,i .	2, 	2NY NRI RNi NGY G!+ !) >I >;k ;:_ :4 4; ;To T F
 Fy 
Y 6 
,
$: 
 3I 3")9 ""HZ H" "DI Dr   