
    nbi)                       d dl mZ d dlZd dlZd dlmZ ej        r6ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ 	 d dlZej        Zn# eef$ r dZ G d de          ZY nw xY w 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% 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/          Z0 G d0 d1e#          Z1 G d2 d3e#          Z2 G d4 d5e#          Z3 G d6 d7e4e           Z5 G d8 d9e5          Z6 G d: d;e5          Z7 G d< d=e           Z8 G d> d?e"          Z9 G d@ dAe9          Z: G dB dCe9          Z; G dD dEe9          Z< G dF dGe9          Z= G dH dIe"          Z> G dJ dKe'e4          Z? G dL dMe           Z@ G dN dOe'          ZA G dP dQe'          ZB G dR dSe           ZC G dT dUeDe7          ZE G dV dWe4          ZF G dX dYe           ZG G dZ d[e           ZH G d\ d]e           ZI G d^ d_e           ZJ G d` dae           ZK G db dceK          ZL G dd deeK          ZMdS )f    )annotationsN)MessageDefect   )AsyncHTTPConnection)AsyncConnectionPool)AsyncHTTPResponse)_TYPE_REDUCE_RESULT)ResponsePromise)HTTPConnection)ConnectionPool)HTTPResponse)Retryc                      e Zd ZdS )BaseSSLErrorN)__name__
__module____qualname__     i/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/urllib3_future/exceptions.pyr   r      s        r   r   c                      e Zd ZdZdS )	HTTPErrorz#Base exception used by this module.Nr   r   r   __doc__r   r   r   r   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.pool$ConnectionPool | AsyncConnectionPoolmessagestrreturnNonec                b    || _         t                                          | d|            d S Nz: )r   super__init__)selfr   r!   	__class__s      r   r(   zPoolError.__init__)   s8     	D--G--.....r   r	   c                    | j         dfS N)NNr*   r)   s    r   
__reduce__zPoolError.__reduce__/       ~|++r   )r   r    r!   r"   r#   r$   r#   r	   r   r   r   r   r(   r/   __classcell__r-   s   @r   r   r   &   sW        9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.r   r    urlr"   r!   r#   r$   c                Z    || _         t                                          ||           d S N)r6   r'   r(   )r)   r   r6   r!   r*   s       r   r(   zRequestError.__init__7   s,     w'''''r   r	   c                $    | j         d | j        d ffS r8   )r*   r6   r.   s    r   r/   zRequestError.__reduce__=   s    ~dh555r   )r   r    r6   r"   r!   r"   r#   r$   r1   r2   r-   s   @r   r5   r5   4   sW        BB( ( ( ( ( (6 6 6 6 6 6 6 6r   r5   c                      e Zd ZdZdS )SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr   r   r   r   r;   r;   B           CCCCr   r;   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 r8   )r'   r(   r@   )r)   r!   rA   r*   s      r   r(   zProxyError.__init__L   s+    %(((#r   )r!   r"   rA   r?   r#   r$   )r   r   r   r   __annotations__r(   r3   r-   s   @r   r>   r>   F   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   rE   rE   Q           EEEEr   rE   c                      e Zd ZdZdS )ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r   r   r   rH   rH   U   s        HHHHr   rH   c                  (     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`

    Nr   r    r6   r"   reasonException | Noner#   r$   c                n    || _         d| d|d}t                                          |||           d S )NzMax retries exceeded with url: z (Caused by ))rK   r'   r(   )r)   r   r6   rK   r!   r*   s        r   r(   zMaxRetryError.__init__k   sF     PCPPVPPPsG,,,,,r   r8   )r   r    r6   r"   rK   rL   r#   r$   r   r   r   r   r(   r3   r-   s   @r   rJ   rJ   `   sQ          $(	
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-r   rJ   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    r6   r"   retriesRetry | intr#   r$   c                f    d| }t                                          |||           || _        d S )Nz'Tried to open a foreign host with url: )r'   r(   rS   )r)   r   r6   rS   r!   r*   s        r   r(   zHostChangedError.__init__{   s:     BCAAsG,,,r   )rR   )r   r    r6   r"   rS   rT   r#   r$   rO   r-   s   @r   rQ   rQ   x   sM        II  !	          r   rQ   c                      e Zd ZdZdS )TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr   r   r   r   rW   rW      s        ;;;;r   rW   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   rY   rY      s           r   rY   c                      e Zd ZdZdS )ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr   r   r   r   r[   r[      s        PPPPr   r[   c                      e Zd ZdZdS )ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr   r   r   r   r]   r]      s        JJJJr   r]   c                  ,     e Zd ZdZd fdZdd
Z xZS )NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.connKHTTPConnection | AsyncHTTPConnection | ConnectionPool | AsyncConnectionPoolr!   r"   r#   r$   c                b    || _         t                                          | d|            d S r&   )r`   r'   r(   )r)   r`   r!   r*   s      r   r(   zNewConnectionError.__init__   s8     	D--G--.....r   r	   c                    | j         dfS r,   r-   r.   s    r   r/   zNewConnectionError.__reduce__   r0   r   )r`   ra   r!   r"   r#   r$   r1   r2   r-   s   @r   r_   r_      sW        RR	/ 	/ 	/ 	/ 	/ 	/, , , , , , , ,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`   ra   rK   socket.gaierrorc                ^    d| d| d}t                                          ||           d S )NzFailed to resolve 'z' (rN   r'   r(   )r)   rf   r`   rK   r!   r*   s        r   r(   zNameResolutionError.__init__   s=     ;:::::w'''''r   r#   r	   c                    | j         dfS )N)NNNr-   r.   s    r   r/   zNameResolutionError.__reduce__   s    ~111r   )rf   r"   r`   ra   rK   rg   r1   r2   r-   s   @r   re   re      sW        11
( 
( 
( 
( 
( 
(2 2 2 2 2 2 2 2r   re   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   rl   rl              MMMMr   rl   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   ro   ro      s        QQQQr   ro   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   rq   rq      rm   r   rq   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   rs   rs      s        FFFFr   rs   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(   rv   )r)   rv   r!   r*   s      r   r(   zLocationParseError.__init__   s3    0h00!!! r   )rv   r"   r#   r$   rO   r-   s   @r   ru   ru      sC        GG! ! ! ! ! ! ! ! ! !r   ru   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(   rz   r)   rz   r!   r*   s      r   r(   zURLSchemeUnknown.__init__   s3    6f66!!!r   )rz   r"   rO   r-   s   @r   ry   ry      sC        <<         r   ry   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   	  rF   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                  2    e Zd ZdZddd	ZddZej        ZdS )IncompleteReadz
    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.
    Npartialintexpected
int | Noner#   r$   c                "    || _         || _        d S r8   )r   r   )r)   r   r   s      r   r(   zIncompleteRead.__init__  s     r   r"   c                L    | j         d| j         d| j          dS d| j         dS )NzIncompleteRead(z bytes read, z more expected)z bytes read))r   r   r.   s    r   __repr__zIncompleteRead.__repr__   s:    =$^T\^^^^^^;;;;;r   r8   )r   r   r   r   r#   r$   r#   r"   )r   r   r   r   r(   r   object__str__r   r   r   r   r     sN         ! ! ! ! !< < < <
 nGGGr   r   c                  "    e Zd ZdZddZdd
ZdS )InvalidChunkLengthz+Invalid chunk length in a chunked response.response HTTPResponse | AsyncHTTPResponselengthbytesr#   r$   c                l    |                                 | _        |j        | _        || _        || _        d S r8   )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__3  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 schemerz   
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://ri   r|   s      r   r(   zProxySchemeUnknown.__init__C  sO     [  F>VGGb&bbbG!!!!!r   )rz   r   r#   r$   rO   r-   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   O  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: ri   )r)   r   r   r!   r*   s       r   r(   zHeaderParsingError.__init__V  s;     )	MMMMM!!!!!r   )r   r   r   r   r#   r$   rO   r-   s   @r   r   r   S  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   ]  r<   r   r   c                      e Zd ZdZddZdS )	EarlyResponsez;urllib3 received a response prior to sending the whole bodypromiser
   r#   r$   c                    || _         d S r8   )r   )r)   r   s     r   r(   zEarlyResponse.__init__d  s    r   N)r   r
   r#   r$   )r   r   r   r   r(   r   r   r   r   r   a  s.        EE     r   r   c                      e Zd ZdZdS )ResponseNotReadyzKept for BCNr   r   r   r   r   r   h  s        r   r   c                      e Zd ZdZdS )RecoverableErrorzRThis error is never leaked in the upper stack, it serves only an internal purpose.Nr   r   r   r   r   r   l          \\\\r   r   c                      e Zd ZdZdS )MustDowngradeErrorzRAn error occurred with a protocol and can be circumvented using an older protocol.Nr   r   r   r   r   r   p  r   r   r   c                      e Zd ZdZdS )MustRedialErrorz3Unused legacy exception. Remove it in a next major.Nr   r   r   r   r   r   t  s        ====r   r   )N
__future__r   sockettypingemail.errorsr   TYPE_CHECKING_async.connectionr   _async.connectionpoolr   _async.responser   _typingr	   backendr
   
connectionr   connectionpoolr   r   r   
util.retryr   sslr;   r   ImportErrorAttributeErrorBaseExceptionr?   r   Warningr   r   r5   r>   rE   rH   ConnectionErrorrJ   rQ   rW   rY   r[   r]   r_   re   rl   ro   rq   
ValueErrorrs   ru   ry   r~   r   r   r   r   r   r   r   r   r   r   r   AssertionErrorr   r   r   r   r   r   r   r   r   r   r   r   <module>r      s 	   " " " " " "   & & & & & &	 	"666666::::::222222,,,,,,((((((******......&&&&&&!!!!!!JJJ<LL^$   
C    }     . . . . .	 . . ., , , , ,' , , ,, , , , ,	 , , ,6 6 6 6 69 6 6 6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 - - -0    |   < < < < <	 < < <    9   Q Q Q Q Q|\ Q Q QK K K K K, K K K, , , , ,,i , , ,&2 2 2 2 2, 2 2 2(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       ]   (
 
 
 
 
 
 
 
$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    I       y   ] ] ] ] ]y ] ] ]] ] ] ] ]) ] ] ]> > > > >& > > > > >s   A A98A9