
    k"g                      \   d dl mZ ddlm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 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e      Z G d( d)e      Z G d* d+e      Z G d, d-e      Z G d. d/e      Z G d0 d1e      Z G d2 d3e      Z  G d4 d5e      Z! G d6 d7e      Z" G d8 d9e      Z# G d: d;e      Z$ G d< d=ee      Z% G d> d?e      Z& G d@ dAee      Z G dB dCee      Z' G dD dEe      Z( G dF dGe)e      Z* G dH dIe      Z+ G dJ dKe      Z, G dL dMe      Z-yN)O    )absolute_import   )IncompleteReadc                       e Zd ZdZy)	HTTPErrorz#Base exception used by this module.N__name__
__module____qualname____doc__     W/var/www/html/djangosite/lib/python3.12/site-packages/pip/_vendor/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 Zd Zy)	PoolErrorz/Base exception for errors caused within a pool.c                 H    || _         t        j                  | |d|       y )Nz: )poolr   __init__)selfr   messages      r   r   zPoolError.__init__   s    	4T7!;<r   c                     | j                   dfS )N)NN	__class__r   s    r   
__reduce__zPoolError.__reduce__   s    ~~|++r   Nr	   r
   r   r   r   r   r   r   r   r   r      s    9=,r   r   c                       e Zd ZdZd Zd Zy)RequestErrorz8Base exception for PoolErrors that have associated URLs.c                 @    || _         t        j                  | ||       y N)urlr   r   )r   r   r#   r   s       r   r   zRequestError.__init__#   s    4w/r   c                 8    | j                   d | j                  d ffS r"   )r   r#   r   s    r   r   zRequestError.__reduce__'   s    ~~dhh555r   Nr   r   r   r   r    r        s    B06r   r    c                       e Zd ZdZy)SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr   r   r   r   r&   r&   ,       Cr   r&   c                   "     e Zd ZdZ fdZ xZS )
ProxyErrorz,Raised when the connection to a proxy fails.c                 >    t        t        | 
  ||g|  || _        y r"   )superr)   r   original_error)r   r   errorargsr   s       r   r   zProxyError.__init__5   s!    j$(%?$?#r   r	   r
   r   r   r   __classcell__r   s   @r   r)   r)   2   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   r2   r2   :       Er   r2   c                       e Zd ZdZy)ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r   r   r   r5   r5   @   s    Hr   r5   c                       e Zd ZdZddZy)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

    Nc                 T    || _         d|d|d}t        j                  | |||       y )NzMax retries exceeded with url: z (Caused by ))reasonr    r   )r   r   r#   r:   r   s        r   r   zMaxRetryError.__init__W   s'    HKVTdD#w7r   r"   r	   r
   r   r   r   r   r   r   r7   r7   M   s    8r   r7   c                       e Zd ZdZddZy)HostChangedErrorz?Raised when an existing pool gets a request for a foreign host.c                 L    d|z  }t         j                  | |||       || _        y )Nz)Tried to open a foreign host with url: %s)r    r   retries)r   r   r#   r?   r   s        r   r   zHostChangedError.__init__b   s'    =CdD#w7r   N)   r;   r   r   r   r=   r=   _   s
    Ir   r=   c                       e Zd ZdZy)TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr   r   r   r   rB   rB   h   s    ;r   rB   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   rD   rD   n   s     	r   rD   c                       e Zd ZdZy)ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr   r   r   r   rF   rF   x   s    Pr   rF   c                       e Zd ZdZy)ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr   r   r   r   rH   rH      s    Jr   rH   c                       e Zd ZdZy)NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.Nr   r   r   r   rJ   rJ      s    Rr   rJ   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   rL   rL          Mr   rL   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      rM   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    Fr   rQ   c                       e Zd ZdZd Zy)LocationParseErrorz=Raised when get_host or similar fails to parse the URL input.c                 H    d|z  }t         j                  | |       || _        y )NzFailed to parse: %s)r   r   location)r   rU   r   s      r   r   zLocationParseError.__init__   s#    '(24) r   Nr;   r   r   r   rS   rS      s
    G!r   rS   c                   "     e Zd ZdZ fdZ xZS )URLSchemeUnknownz2Raised when a URL input has an unsupported scheme.c                 D    d|z  }t         t        |   |       || _        y )NzNot supported URL scheme %s)r+   rW   r   schemer   rY   r   r   s      r   r   zURLSchemeUnknown.__init__   s$    /&8.w7r   r/   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)SubjectAltNameWarningzBWarned when connecting to a host with a certificate missing a SAN.Nr   r   r   r   rc   rc      s    Lr   rc   c                       e Zd ZdZy)InsecureRequestWarningz/Warned when making an unverified HTTPS request.Nr   r   r   r   re   re      s    9r   re   c                       e Zd ZdZy)SystemTimeWarningz0Warned when system time is suspected to be wrongNr   r   r   r   rg   rg      ra   r   rg   c                       e Zd ZdZy)InsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.Nr   r   r   r   ri   ri      s    Sr   ri   c                       e Zd ZdZy)SNIMissingWarningz9Warned when making a HTTPS request without SNI available.Nr   r   r   r   rk   rk      r'   r   rk   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   rm   rm          
 	r   rm   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   rp   rp      r3   r   rp   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   rr   rr      rn   r   rr   c                   (     e Zd ZdZ fdZd Z xZ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.
    c                 .    t         t        |   ||       y r"   )r+   r   r   )r   partialexpectedr   s      r   r   zIncompleteRead.__init__   s    nd,Wh?r   c                 8    d| j                   | j                  fz  S )Nz/IncompleteRead(%i bytes read, %i more expected))ru   rv   r   s    r   __repr__zIncompleteRead.__repr__   s#    @LLMMD
 
 	
r   r	   r
   r   r   r   rx   r0   r   s   @r   r   r      s    @
r   r   c                   (     e Zd ZdZ fdZd Z xZS )InvalidChunkLengthz+Invalid chunk length in a chunked response.c                 z    t         t        |   |j                         |j                         || _        || _        y r"   )r+   r{   r   telllength_remainingresponselength)r   r   r   r   s      r   r   zInvalidChunkLength.__init__
  s4     $0MMOX66	
 !r   c                 8    d| j                   | j                  fz  S )Nz0InvalidChunkLength(got length %r, %i bytes read))r   ru   r   s    r   rx   zInvalidChunkLength.__repr__  s#    AKKLLE
 
 	
r   ry   r   s   @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    2r   r   c                   "     e Zd ZdZ fdZ xZS )ProxySchemeUnknownz1ProxyManager does not support the supplied schemec                 N    |dk(  rd }|d}nd|z  }t         t        |   |       y )N	localhostz>Proxy URL had no scheme, should start with http:// or https://zCProxy URL had unsupported scheme %s, should use http:// or https://)r+   r   r   rZ   s      r   r   zProxySchemeUnknown.__init__#  sA     [ F>VG V  	 $09r   r/   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   2  s    Gr   r   c                   "     e Zd ZdZ fdZ xZS )HeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.c                 B    |xs dd|}t         t        |   |       y )NUnknownz, unparsed data: )r+   r   r   )r   defectsunparsed_datar   r   s       r   r   zHeaderParsingError.__init__;  s%    -4-A	-A=Q $09r   r/   r   s   @r   r   r   8  s    X: :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   @  r'   r   r   N).
__future__r   packages.six.moves.http_clientr   httplib_IncompleteRead	Exceptionr   Warningr   r   r    r&   r)   r2   r5   ConnectionErrorr7   r=   rB   rD   rF   rH   rJ   rL   rO   
ValueErrorrQ   rS   rW   r\   r`   rc   re   rg   ri   rk   rm   rp   rr   r{   r   AssertionErrorr   r   r   r   r   r   r   <module>r      s   & T
		 		' 		,	 	,	69 	6	y 	$ $	) 		I 	  8L 8$| 		 		9 		|\ 		, 		,i 		Y 		i 		Y 	!+ !) >I >	k 		O 		_ 		 		o 		 		 		
 		y 	
Y 6 
$
$: 
"	I 	:)9 :(	Z 	: :	I 	r   