K i&ddlmZddlZddlZddlZddlmZddlmZ ejrddl m Z ddl mZddlmZdd lmZGd d eZGd d eZeej0defeedffZGddeZGddeZGddeZGddeZGddeZGddeZ e Z!GddeZ"GddeZ#Gdd eZ$Gd!d"eZ%Gd#d$e%eZ&Gd%d&e%Z'Gd'd(e'eZ(Gd)d*e(Z)Gd+d,eZ*Gd-d.eZ+Gd/d0eZ,Gd1d2e-eZ.Gd3d4e.Z/Gd5d6e.Z0Gd7d8eZ1Gd9d:eZ2Gd;de2Z4Gd?d@e2Z5GdAdBe2Z6GdCdDeZ7GdEdFe e-Z8GdGdHeZ9GdIdJee ZGdKdLee Z:GdMdNeZ;GdOdPeGdSdTeZ?GdUdVeZ@y)W) annotationsN) MessageDefect)IncompleteRead)HTTPConnection)ConnectionPool) HTTPResponse)RetryceZdZdZy) HTTPErrorz#Base exception used by this module.N__name__ __module__ __qualname____doc__X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/urllib3/exceptions.pyr r s-rr ceZdZdZy) HTTPWarningz!Base warning used by this module.Nr rrrrrs+rr.c,eZdZdZdfd ZddZxZS) PoolErrorz/Base exception for errors caused within a pool.cJ||_||_t| |d|yNz: )pool_messagesuper__init__)selfrmessage __class__s rrzPoolError.__init__ )   D6G9-.rc6|jd|jffSNr!rrs r __reduce__zPoolError.__reduce__%~~dmm444r)rrr strreturnNoner*_TYPE_REDUCE_RESULTrrrrrr' __classcell__r!s@rrrs9/ 5rrc,eZdZdZdfd ZddZxZS) RequestErrorz8Base exception for PoolErrors that have associated URLs.c4||_t| ||yr$)urlrr)rrr4r r!s rrzRequestError.__init__-s w'rcL|jd|j|jffSr$)r!r4rr&s rr'zRequestError.__reduce__1s ~~dhh >>>r)rrr4r)r r)r*r+r,r.r0s@rr2r2*sB(?rr2ceZdZdZy)SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr rrrr7r76Crr7c0eZdZUdZded<dfd ZxZS) ProxyErrorz,Raised when the connection to a proxy fails. Exceptionoriginal_errorc4t|||||_yr$)rrr<)rr errorr!s rrzProxyError.__init__@s %(#r)r r)r>r;r*r+)rrrr__annotations__rr/r0s@rr:r::s6$$rr:ceZdZdZy) DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr rrrrArAEErrAceZdZdZy) ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr rrrrDrDIsHrrDc>eZdZdZ d dfd ZddZxZS) MaxRetryErroraRaised 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` cH||_d|d|d}t| |||y)NzMax retries exceeded with url: z (Caused by ))reasonrr)rrr4rIr r!s rrzMaxRetryError.__init___s1 3C5 VJaP sG,rcL|jd|j|jffSr$)r!r4rIr&s rr'zMaxRetryError.__reduce__hs ~~dhh <<` and :exc:`ConnectTimeoutErrors `. Nr rrrrTrT|srrTceZdZdZy)ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr rrrrVrVsPrrVceZdZdZy)ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr rrrrXrXsJrrXc>eZdZdZdfd ZddZeddZxZS)NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.cJ||_||_t| |d|yr)connrrr)rr\r r!s rrzNewConnectionError.__init__r"rc6|jd|jffSr$r%r&s rr'zNewConnectionError.__reduce__r(rcRtjdtd|jS)Nz\The 'pool' property is deprecated and will be removed in urllib3 v2.1.0. Use 'conn' instead.) stacklevel)warningswarnDeprecationWarningr\r&s rrzNewConnectionError.pools%  5   yyr)r\rr r)r*r+r,)r*r) rrrrrr'propertyrr/r0s@rrZrZs$R/ 5rrZc,eZdZdZdfd ZddZxZS)NameResolutionErrorz'Raised when host name resolution fails.cTd|d|d}||_||_t| ||y)NzFailed to resolve 'z' (rH)_host_reasonrr)rhostr\rIr r!s rrzNameResolutionError.__init__s4'vS:   w'rcL|j|jd|jffSr$)r!rhrir&s rr'zNameResolutionError.__reduce__s ~~ D$,,???r)rjr)r\rrIzsocket.gaierrorr,r.r0s@rrfrfs1( @rrfceZdZdZy)EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nr rrrrmrmMrrmceZdZdZy) FullPoolErrorzGRaised when we try to add a connection to a full pool in blocking mode.Nr rrrrprpsQrrpceZdZdZy)ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nr rrrrrrrrnrrrceZdZdZy)LocationValueErrorzProxy URL had no scheme, should start with http:// or https://z!Proxy URL had unsupported scheme z , should use http:// or https://rrr}s rrzProxySchemeUnknown.__init__4s8 [ F >VG9&AabG !r)r|z str | Noner*r+rPr0s@rrr/s; " "rrceZdZdZy)ProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedNr rrrrr@sGrrc0eZdZdZ dfd ZxZS)HeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.c:|xsdd|}t||y)NUnknownz, unparsed data: r)rdefects unparsed_datar r!s rrzHeaderParsingError.__init__Gs*) **;M;LM !r)rzlist[MessageDefect]rzbytes | str | Noner*r+rPr0s@rrrDs(X"*";M" ""rrceZdZdZy)UnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNr rrrrrNr8rr)A __future__rsockettypingra email.errorsr http.clientrhttplib_IncompleteRead TYPE_CHECKING connectionrconnectionpoolrrr util.retryr r;r WarningrtupleCallableobjectr-rr2r7r:rArDConnectionErrorrFrLrRrTrVrXrZrfrmrprr ValueErrorrtrvrzrrrrrrrrrrrAssertionErrorrrrrrrrrsT" &@ *.&! . .,',FOOCK8% :LLM 5 5 ?9 ?DyD$$F)FIII   =L=2|< <9Q|\Q K,K,i0 @, @NYNRIRNiNGYG!+!)>I>;k;:_:44;;ToT F Fy Y 6 ,  $:  3I3")9""HZH""DIDr