
    ,h&                       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__     T/var/www/html/Resume-Scraper/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                J    || _         || _        t        |   | d|        y Nz: )pool_messagesuper__init__)selfr   message	__class__s      r   r   zPoolError.__init__    )    	D6G9-.r   c                6    | j                   d | j                  ffS Nr!   r   r   s    r   
__reduce__zPoolError.__reduce__%       ~~dmm444r   )r   r   r    strreturnNoner*   _TYPE_REDUCE_RESULTr   r   r   r   r   r'   __classcell__r!   s   @r   r   r      s    9/
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.c                4    || _         t        | 	  ||       y r$   )urlr   r   )r   r   r4   r    r!   s       r   r   zRequestError.__init__-   s    w'r   c                L    | j                   d | j                  | j                  ffS r$   )r!   r4   r   r&   s    r   r'   zRequestError.__reduce__1   s     ~~dhh>>>r   )r   r   r4   r)   r    r)   r*   r+   r,   r.   r0   s   @r   r2   r2   *   s    B(?r   r2   c                      e Zd ZdZy)SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr   r   r   r   r7   r7   6       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_errorc                4    t         |   ||       || _        y r$   )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/   r0   s   @r   r:   r:   :   s    6 $ $r   r:   c                      e Zd ZdZy)DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr   r   r   r   rA   rA   E       Er   rA   c                      e Zd ZdZy)ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r   r   r   rD   rD   I   s    Hr   rD   c                  >     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`

    c                H    || _         d| d|d}t        | 	  |||       y )NzMax retries exceeded with url: z (Caused by ))reasonr   r   )r   r   r4   rI   r    r!   s        r   r   zMaxRetryError.__init___   s1     3C5VJaPsG,r   c                L    | j                   d | j                  | j                  ffS r$   )r!   r4   rI   r&   s    r   r'   zMaxRetryError.__reduce__h   s     ~~dhh<<<r   r$   )r   r   r4   r)   rI   zException | Noner*   r+   r,   r.   r0   s   @r   rF   rF   T   s9     JN-"-),-6F-	-=r   rF   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   r4   rN   r    r!   s        r   r   zHostChangedError.__init__p   s)     <C5AsG,r   )   )r   r   r4   r)   rN   zRetry | intr*   r+   r   r   r   r   r   r/   r0   s   @r   rL   rL   m   s7    I FG"),7B	 r   rL   c                      e Zd ZdZy)TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr   r   r   r   rR   rR   x   s    ;r   rR   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   rT   rT   |   s    r   rT   c                      e Zd ZdZy)ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr   r   r   r   rV   rV      s    Pr   rV   c                      e Zd ZdZy)ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr   r   r   r   rX   rX      s    Jr   rX   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                J    || _         || _        t        |   | d|        y r   )connr   r   r   )r   r\   r    r!   s      r   r   zNewConnectionError.__init__   r"   r   c                6    | j                   d | j                  f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DeprecationWarningr\   r&   s    r   r   zNewConnectionError.pool   s%    5		
 yyr   )r\   r   r    r)   r*   r+   r,   )r*   r   )	r   r   r   r   r   r'   propertyr   r/   r0   s   @r   rZ   rZ      s$    R/
5  r   rZ   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                T    d| d| d}|| _         || _        t        |   ||       y )NzFailed to resolve 'z' (rH   )_host_reasonr   r   )r   hostr\   rI   r    r!   s        r   r   zNameResolutionError.__init__   s4    'vS:
w'r   c                L    | j                   | j                  d | j                  ffS r$   )r!   rh   ri   r&   s    r   r'   zNameResolutionError.__reduce__   s     ~~

D$,,???r   )rj   r)   r\   r   rI   zsocket.gaierrorr,   r.   r0   s   @r   rf   rf      s    1(@r   rf   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   rm   rm          Mr   rm   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   rp   rp      s    Qr   rp   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   rr   rr      rn   r   rr   c                      e Zd ZdZy)LocationValueErrorz<Raised when there is something wrong with a given URL input.Nr   r   r   r   rt   rt      s    Fr   rt   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   rx   r    r!   s      r   r   zLocationParseError.__init__   s#    %hZ0! r   )rx   r)   r*   r+   rP   r0   s   @r   rv   rv      s    G! !r   rv   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   r|   r    r!   s      r   r   zURLSchemeUnknown.__init__   s#    -fX6!r   )r|   r)   rP   r0   s   @r   rz   rz      s    < r   rz   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      rB   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 r$   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 r$   )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://r   r   r}   s      r   r   zProxySchemeUnknown.__init__4  s8     [ F>VG9&AabG!r   )r|   z
str | Noner*   r+   rP   r0   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   @  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: r   )r   defectsunparsed_datar    r!   s       r   r   zHeaderParsingError.__init__G  s*     )	**;M;LM!r   )r   zlist[MessageDefect]r   zbytes | str | Noner*   r+   rP   r0   s   @r   r   r   D  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   N  r8   r   r   )A
__future__r   sockettypingra   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   rL   rR   rT   rV   rX   rZ   rf   rm   rp   rr   
ValueErrorrt   rv   rz   r   r   r   r   r   r   r   r   r   r   r   AssertionErrorr   r   r   r   r   r   r   <module>r      sT   "    & @	*.&!
.	 .,' , FOOCK8%:LLM 
5	 
5	?9 	?Dy D$ $F) FII I
  =L =2| <	 <9 Q|\ QK, K,i 0@, @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   