
    Mh&                       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j        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@dS )W    )annotationsN)MessageDefect)IncompleteRead   )HTTPConnection)ConnectionPool)HTTPResponse)Retryc                      e Zd ZdZdS )	HTTPErrorz#Base exception used by this module.N__name__
__module____qualname____doc__     R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/urllib3/exceptions.pyr   r      s        ----r   r   c                      e Zd ZdZdS )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.poolr   messagestrreturnNonec                p    || _         || _        t                                          | d|            d S Nz: )r   _messagesuper__init__)selfr   r   	__class__s      r   r"   zPoolError.__init__    =    	D--G--.....r   _TYPE_REDUCE_RESULTc                "    | j         d | j        ffS Nr$   r    r#   s    r   
__reduce__zPoolError.__reduce__%       ~dm444r   )r   r   r   r   r   r   r   r&   r   r   r   r   r"   r+   __classcell__r$   s   @r   r   r      sW        99/ / / / / /
5 5 5 5 5 5 5 5r   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.r   r   urlr   r   r   r   c                Z    || _         t                                          ||           d S r(   )r3   r!   r"   )r#   r   r3   r   r$   s       r   r"   zRequestError.__init__-   s*    w'''''r   r&   c                .    | j         d | j        | j        ffS r(   )r$   r3   r    r*   s    r   r+   zRequestError.__reduce__1   s    ~dh>>>r   )r   r   r3   r   r   r   r   r   r-   r.   r0   s   @r   r2   r2   *   sW        BB( ( ( ( ( (? ? ? ? ? ? ? ?r   r2   c                      e Zd ZdZdS )SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr   r   r   r   r7   r7   6           CCCCr   r7   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_errorr   r   errorr   r   c                Z    t                                          ||           || _        d S r(   )r!   r"   r<   )r#   r   r=   r$   s      r   r"   zProxyError.__init__@   s+    %(((#r   )r   r   r=   r;   r   r   )r   r   r   r   __annotations__r"   r/   r0   s   @r   r:   r:   :   sS         66 $ $ $ $ $ $ $ $ $ $r   r:   c                      e Zd ZdZdS )DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr   r   r   r   rA   rA   E           EEEEr   rA   c                      e Zd ZdZdS )ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r   r   r   rD   rD   I   s        HHHHr   rD   c                  0     e Zd ZdZ	 dd fdZd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`

    Nr   r   r3   r   reasonException | Noner   r   c                n    || _         d| d|d}t                                          |||           d S )NzMax retries exceeded with url: z (Caused by ))rG   r!   r"   )r#   r   r3   rG   r   r$   s        r   r"   zMaxRetryError.__init___   sF     PCPPVPPPsG,,,,,r   r&   c                .    | j         d | j        | j        ffS r(   )r$   r3   rG   r*   s    r   r+   zMaxRetryError.__reduce__h   s    ~dh<<<r   r(   )r   r   r3   r   rG   rH   r   r   r-   r.   r0   s   @r   rF   rF   T   sg          JN- - - - - - -= = = = = = = =r   rF   c                  (     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.   r   r   r3   r   retriesRetry | intr   r   c                f    d| }t                                          |||           || _        d S )Nz'Tried to open a foreign host with url: )r!   r"   rO   )r#   r   r3   rO   r   r$   s        r   r"   zHostChangedError.__init__p   s:     BCAAsG,,,r   )rN   )r   r   r3   r   rO   rP   r   r   r   r   r   r   r"   r/   r0   s   @r   rM   rM   m   sO        II FG          r   rM   c                      e Zd ZdZdS )TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr   r   r   r   rT   rT   x   s        ;;;;r   rT   c                      e Zd ZdZdS )TimeoutErrorzRaised when a socket timeout error occurs.

    Catching this error will catch both :exc:`ReadTimeoutErrors
    <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`.
    Nr   r   r   r   rV   rV   |   s           r   rV   c                      e Zd ZdZdS )ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr   r   r   r   rX   rX      s        PPPPr   rX   c                      e Zd ZdZdS )ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr   r   r   r   rZ   rZ      s        JJJJr   rZ   c                  D     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.connr   r   r   r   r   c                p    || _         || _        t                                          | d|            d S r   )r]   r    r!   r"   )r#   r]   r   r$   s      r   r"   zNewConnectionError.__init__   r%   r   r&   c                "    | j         d | j        ffS r(   r)   r*   s    r   r+   zNewConnectionError.__reduce__   r,   r   c                H    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DeprecationWarningr]   r*   s    r   r   zNewConnectionError.pool   s0    5		
 	
 	
 	
 yr   )r]   r   r   r   r   r   r-   )r   r   )	r   r   r   r   r"   r+   propertyr   r/   r0   s   @r   r\   r\      sw        RR/ / / / / /
5 5 5 5    X    r   r\   c                  ,     e Zd ZdZd fdZddZ xZS )NameResolutionErrorz'Raised when host name resolution fails.hostr   r]   r   rG   socket.gaierrorc                z    d| d| d}|| _         || _        t                                          ||           d S )NzFailed to resolve 'z' (rJ   )_host_reasonr!   r"   )r#   ri   r]   rG   r   r$   s        r   r"   zNameResolutionError.__init__   sI    ::::::
w'''''r   r   r&   c                .    | j         | j        d | j        ffS r(   )r$   rl   rm   r*   s    r   r+   zNameResolutionError.__reduce__   s    ~
D$,???r   )ri   r   r]   r   rG   rj   r-   r.   r0   s   @r   rh   rh      s_        11( ( ( ( ( (@ @ @ @ @ @ @ @r   rh   c                      e Zd ZdZdS )EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nr   r   r   r   rp   rp              MMMMr   rp   c                      e Zd ZdZdS )FullPoolErrorzGRaised when we try to add a connection to a full pool in blocking mode.Nr   r   r   r   rs   rs      s        QQQQr   rs   c                      e Zd ZdZdS )ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nr   r   r   r   ru   ru      rq   r   ru   c                      e Zd ZdZdS )LocationValueErrorz<Raised when there is something wrong with a given URL input.Nr   r   r   r   rw   rw      s        FFFFr   rw   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.locationr   r   r   c                b    d| }t                                          |           || _        d S )NzFailed to parse: )r!   r"   rz   )r#   rz   r   r$   s      r   r"   zLocationParseError.__init__   s3    0h00!!! r   )rz   r   r   r   rR   r0   s   @r   ry   ry      sC        GG! ! ! ! ! ! ! ! ! !r   ry   c                  $     e Zd ZdZd fdZ xZS )URLSchemeUnknownz2Raised when a URL input has an unsupported scheme.schemer   c                b    d| }t                                          |           || _        d S )NzNot supported URL scheme )r!   r"   r~   r#   r~   r   r$   s      r   r"   zURLSchemeUnknown.__init__   s3    6f66!!!r   )r~   r   rR   r0   s   @r   r}   r}      sC        <<         r   r}   c                      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        NN.M=NNNr   r   c                      e Zd ZdZdS )SecurityWarningz0Warned when performing security reducing actionsNr   r   r   r   r   r              ::::r   r   c                      e Zd ZdZdS )InsecureRequestWarningz/Warned when making an unverified HTTPS request.Nr   r   r   r   r   r      s        9999r   r   c                      e Zd ZdZdS )NotOpenSSLWarningz)Warned when using unsupported SSL libraryNr   r   r   r   r   r      s        3333r   r   c                      e Zd ZdZdS )SystemTimeWarningz0Warned when system time is suspected to be wrongNr   r   r   r   r   r      r   r   r   c                      e Zd ZdZdS )InsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.Nr   r   r   r   r   r      s        SSSSr   r   c                      e Zd ZdZdS )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dS )ResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.Nr   r   r   r   r   r      rB   r   r   c                      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().
    Nr   r   r   r   r   r      r   r   r   c                  8    e Zd ZU dZded<   ded<   ddZdd	Zd
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.
    intpartialexpectedr   r   c                "    || _         || _        d S r(   r   r   )r#   r   r   s      r   r"   zIncompleteRead.__init__  s     r   r   c                $    d| j         | j        fz  S )Nz/IncompleteRead(%i bytes read, %i more expected)r   r*   s    r   __repr__zIncompleteRead.__repr__  s    @LMD
 
 	
r   N)r   r   r   r   r   r   r   r   )r   r   r   r   r?   r"   r   r   r   r   r   r     s\           LLLMMM! ! ! !
 
 
 
 
 
r   r   c                  "    e Zd ZdZddZdd
ZdS )InvalidChunkLengthz+Invalid chunk length in a chunked response.responser	   lengthbytesr   r   c                l    |                                 | _        |j        | _        || _        || _        d S r(   )tellr   length_remainingr   r   r   )r#   r   r   s      r   r"   zInvalidChunkLength.__init__  s-    $MMOO$,$= r   r   c                $    d| j         | j        fz  S )Nz0InvalidChunkLength(got length %r, %i bytes read))r   r   r*   s    r   r   zInvalidChunkLength.__repr__$  s    AKLE
 
 	
r   N)r   r	   r   r   r   r   r   )r   r   r   r   r"   r   r   r   r   r   r     sB        55   
 
 
 
 
 
r   r   c                      e Zd ZdZdS )InvalidHeaderz(The header provided was somehow invalid.Nr   r   r   r   r   r   +  s        2222r   r   c                  $     e Zd ZdZd fdZ xZS )ProxySchemeUnknownz1ProxyManager does not support the supplied schemer~   
str | Noner   r   c                p    |dk    rd }|d}nd| d}t                                          |           d S )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://r!   r"   r   s      r   r"   zProxySchemeUnknown.__init__4  sO     [  F>VGGb&bbbG!!!!!r   )r~   r   r   r   rR   r0   s   @r   r   r   /  sC        ;;	" 	" 	" 	" 	" 	" 	" 	" 	" 	"r   r   c                      e Zd ZdZdS )ProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedNr   r   r   r   r   r   @  s        GGGGr   r   c                  $     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.defectslist[MessageDefect]unparsed_databytes | str | Noner   r   c                \    |pd d|}t                                          |           d S )NUnknownz, unparsed data: r   )r#   r   r   r   r$   s       r   r"   zHeaderParsingError.__init__G  s;     )	MMMMM!!!!!r   )r   r   r   r   r   r   rR   r0   s   @r   r   r   D  sC        XX" " " " " " " " " "r   r   c                      e Zd ZdZdS )UnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNr   r   r   r   r   r   N  r8   r   r   )A
__future__r   sockettypingrc   email.errorsr   http.clientr   httplib_IncompleteReadTYPE_CHECKING
connectionr   connectionpoolr   r   r	   
util.retryr
   r;   r   Warningr   tupleCallableobjectr&   r   r2   r7   r:   rA   rD   ConnectionErrorrF   rM   rT   rV   rX   rZ   r\   rh   rp   rs   ru   
ValueErrorrw   ry   r}   r   r   r   r   r   r   r   r   r   r   r   AssertionErrorr   r   r   r   r   r   r   <module>r      s   " " " " " "    & & & & & & @ @ @ @ @ @	 "******......&&&&&&!!!!!!
. . . . .	 . . ., , , , ,' , , , FOCK8%:LLM 
5 
5 
5 
5 
5	 
5 
5 
5	? 	? 	? 	? 	?9 	? 	? 	?D D D D Dy D D D$ $ $ $ $ $ $ $F F F F F) F F FI I I I II I I I
  = = = = =L = = =2    |   < < < < <	 < < <    9   Q Q Q Q Q|\ Q Q QK K K K K, K K K    ,i   0@ @ @ @ @, @ @ @N N N N NY N N NR R R R RI R R RN N N N Ni N N NG G G G GY G G G! ! ! ! !+ ! ! !    )   > > > > >I > > >; ; ; ; ;k ; ; ;: : : : :_ : : :4 4 4 4 4 4 4 4; ; ; ; ; ; ; ;T T T T To T T T       F F F F F
 F F F    y   
 
 
 
 
Y 6 
 
 
,
 
 
 
 
$: 
 
 
 3 3 3 3 3I 3 3 3" " " " ")9 " " ""H H H H HZ H H H" " " " " " " "D D D D DI D D D D Dr   