zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
U
 ý°dI$ã@súddlmZddlZddlZddlZddlmZddlmZ    ej
rrddl m Z ddl mZddlmZdd    lmZGd
d „d eƒZGd d „d eƒZejejdefejedffZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZ e Z!Gdd„deƒZ"Gdd„deƒZ#Gdd „d eƒZ$Gd!d"„d"eƒZ%Gd#d$„d$e%eƒZ&Gd%d&„d&e%ƒZ'Gd'd(„d(e'eƒZ(Gd)d*„d*e(ƒZ)Gd+d,„d,eƒZ*Gd-d.„d.eƒZ+Gd/d0„d0eƒZ,Gd1d2„d2e-eƒZ.Gd3d4„d4e.ƒZ/Gd5d6„d6e.ƒZ0Gd7d8„d8eƒZ1Gd9d:„d:eƒZ2Gd;d<„d<e2ƒZ3Gd=d>„d>e2ƒZ4Gd?d@„d@e2ƒZ5GdAdB„dBeƒZ6GdCdD„dDe e-ƒZ7GdEdF„dFeƒZ8GdGdH„dHee    ƒZGdIdJ„dJee    ƒZ9GdKdL„dLeƒZ:GdMdN„dNe;e0ƒZ<GdOdP„dPe-ƒZ=GdQdR„dReƒZ>GdSdT„dTeƒZ?dS)Ué)Ú annotationsN)Ú MessageDefect)ÚIncompleteReadé)ÚHTTPConnection)ÚConnectionPool)Ú HTTPResponse)ÚRetryc@seZdZdZdS)Ú    HTTPErrorz#Base exception used by this module.N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúId:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\urllib3/exceptions.pyr
sr
c@seZdZdZdS)Ú HTTPWarningz!Base warning used by this module.Nr rrrrrsr.cs8eZdZdZddddœ‡fdd„ Zdd    œd
d „Z‡ZS) Ú    PoolErrorz/Base exception for errors caused within a pool.rÚstrÚNone)ÚpoolÚmessageÚreturncs ||_tƒ |›d|›¡dS©Nz: )rÚsuperÚ__init__)Úselfrr©Ú    __class__rrr"szPoolError.__init__Ú_TYPE_REDUCE_RESULT©rcCs
|jdfS)N)NNr©rrrrÚ
__reduce__&szPoolError.__reduce__©r r rrrr"Ú __classcell__rrrrrsrcs:eZdZdZdddddœ‡fdd„ Zdd    œd
d „Z‡ZS) Ú RequestErrorz8Base exception for PoolErrors that have associated URLs.rrr)rÚurlrrcs||_tƒ ||¡dS©N)r&rr)rrr&rrrrr.szRequestError.__init__rr cCs|jd|jdffSr')rr&r!rrrr"2szRequestError.__reduce__r#rrrrr%+sr%c@seZdZdZdS)ÚSSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr rrrrr(7sr(cs4eZdZUdZded<ddddœ‡fdd„ Z‡ZS)    Ú
ProxyErrorz,Raised when the connection to a proxy fails.Ú    ExceptionÚoriginal_errorrr)rÚerrorrcstƒ ||¡||_dSr')rrr+)rrr,rrrrAszProxyError.__init__)r r rrÚ__annotations__rr$rrrrr);s
r)c@seZdZdZdS)Ú DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr rrrrr.Fsr.c@seZdZdZdS)Ú ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr rrrrr/Jsr/cs.eZdZdZd
dddddœ‡fdd    „ Z‡ZS) Ú 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`
 
    NrrzException | Noner)rr&Úreasonrcs,||_d|›d|›d}tƒ |||¡dS)NzMax retries exceeded with url: z  (Caused by ú))r1rr)rrr&r1rrrrr`szMaxRetryError.__init__)N©r r rrrr$rrrrr0Us ÿr0cs.eZdZdZd
dddddœ‡fdd    „ Z‡ZS) ÚHostChangedErrorz?Raised when an existing pool gets a request for a foreign host.érrz Retry | intr)rr&Úretriesrcs$d|›}tƒ |||¡||_dS)Nz'Tried to open a foreign host with url: )rrr6)rrr&r6rrrrrms
zHostChangedError.__init__)r5r3rrrrr4jsÿr4c@seZdZdZdS)ÚTimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr rrrrr7usr7c@seZdZdZdS)Ú TimeoutErrorz¿Raised when a socket timeout error occurs.
 
    Catching this error will catch both :exc:`ReadTimeoutErrors
    <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`.
    Nr rrrrr8ysr8c@seZdZdZdS)ÚReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr rrrrr9sr9c@seZdZdZdS)ÚConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr rrrrr:‡sr:cs<eZdZdZddddœ‡fdd„ Zeddœd    d
„ƒZ‡ZS) ÚNewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.rrr)Úconnrrcs ||_tƒ |›d|›¡dSr)r<rr)rr<rrrrrŽszNewConnectionError.__init__r cCstjdtdd|jS)Nz\The 'pool' property is deprecated and will be removed in urllib3 v2.1.0. Use 'conn' instead.é)Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningr<r!rrrr’s üzNewConnectionError.pool)r r rrrÚpropertyrr$rrrrr;‹sr;cs*eZdZdZddddœ‡fdd„ Z‡ZS)ÚNameResolutionErrorz'Raised when host name resolution fails.rrzsocket.gaierror)Úhostr<r1cs$d|›d|›d}tƒ ||¡dS)NzFailed to resolve 'z' (r2©rr)rrDr<r1rrrrr¡szNameResolutionError.__init__r3rrrrrCžsrCc@seZdZdZdS)ÚEmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nr rrrrrF¦srFc@seZdZdZdS)Ú FullPoolErrorzGRaised when we try to add a connection to a full pool in blocking mode.Nr rrrrrGªsrGc@seZdZdZdS)ÚClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nr rrrrrH®srHc@seZdZdZdS)ÚLocationValueErrorz<Raised when there is something wrong with a given URL input.Nr rrrrrI²srIcs(eZdZdZdddœ‡fdd„ Z‡ZS)ÚLocationParseErrorz=Raised when get_host or similar fails to parse the URL input.rr)Úlocationrcs d|›}tƒ |¡||_dS)NzFailed to parse: )rrrK)rrKrrrrr¹s
 zLocationParseError.__init__r3rrrrrJ¶srJcs&eZdZdZddœ‡fdd„ Z‡ZS)ÚURLSchemeUnknownz2Raised when a URL input has an unsupported scheme.r)Úschemecs d|›}tƒ |¡||_dS)NzNot supported URL scheme )rrrM©rrMrrrrrÃs
 zURLSchemeUnknown.__init__r3rrrrrLÀsrLc@seZdZdZdZdZdS)Ú ResponseErrorzDUsed as a container for an error reason supplied in a MaxRetryError.ztoo many error responsesz&too many {status_code} error responsesN)r r rrÚ GENERIC_ERRORÚSPECIFIC_ERRORrrrrrOÊsrOc@seZdZdZdS)ÚSecurityWarningz0Warned when performing security reducing actionsNr rrrrrRÑsrRc@seZdZdZdS)ÚInsecureRequestWarningz/Warned when making an unverified HTTPS request.Nr rrrrrSÕsrSc@seZdZdZdS)ÚSystemTimeWarningz0Warned when system time is suspected to be wrongNr rrrrrTÙsrTc@seZdZdZdS)ÚInsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.Nr rrrrrUÝsrUc@seZdZdZdS)ÚDependencyWarningzc
    Warned when an attempt is made to import a module with missing optional
    dependencies.
    Nr rrrrrVásrVc@seZdZdZdS)ÚResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.Nr rrrrrWèsrWc@seZdZdZdS)ÚBodyNotHttplibCompatiblez‡
    Body should be :class:`http.client.HTTPResponse` like
    (have an fp attribute which returns raw chunks) for read_chunked().
    Nr rrrrrXìsrXc@s0eZdZdZddddœdd„Zddœd    d
„Zd S) rzÎ
    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.
    Úintr)ÚpartialÚexpectedrcCs||_||_dSr'©rZr[)rrZr[rrrrûszIncompleteRead.__init__rr cCsd|j|jfS)Nz/IncompleteRead(%i bytes read, %i more expected)r\r!rrrÚ__repr__ÿsþzIncompleteRead.__repr__N©r r rrrr]rrrrrósrc@s0eZdZdZddddœdd„Zdd    œd
d „Zd S) ÚInvalidChunkLengthz+Invalid chunk length in a chunked response.rÚbytesr)ÚresponseÚlengthrcCs"| ¡|_|j|_||_||_dSr')ÚtellrZÚlength_remainingr[rarb)rrarbrrrr    s
zInvalidChunkLength.__init__rr cCsd|j|jfS)Nz0InvalidChunkLength(got length %r, %i bytes read))rbrZr!rrrr]sþzInvalidChunkLength.__repr__Nr^rrrrr_sr_c@seZdZdZdS)Ú InvalidHeaderz(The header provided was somehow invalid.Nr rrrrresrecs(eZdZdZdddœ‡fdd„ Z‡ZS)ÚProxySchemeUnknownz1ProxyManager does not support the supplied schemez
str | Noner)rMrcs6|dkr d}|dkrd}n d|›d}tƒ |¡dS)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://rErNrrrrs  zProxySchemeUnknown.__init__r3rrrrrfsrfc@seZdZdZdS)ÚProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedNr rrrrrh+srhcs*eZdZdZddddœ‡fdd„ Z‡ZS)ÚHeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.zlist[MessageDefect]zbytes | str | Noner)ÚdefectsÚ unparsed_datarcs"|pd›d|›}tƒ |¡dS)NÚUnknownz, unparsed data: rE)rrjrkrrrrr2szHeaderParsingError.__init__r3rrrrri/sric@seZdZdZdS)ÚUnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNr rrrrrm9srm)@Ú
__future__rÚsocketÚtypingr?Z email.errorsrÚ http.clientrÚhttplib_IncompleteReadÚ TYPE_CHECKINGÚ
connectionrÚconnectionpoolrrarZ
util.retryr    r*r
ÚWarningrÚTupleÚCallableÚobjectrrr%r(r)r.r/ÚConnectionErrorr0r4r7r8r9r:r;rCrFrGrHÚ
ValueErrorrIrJrLrOrRrSrTrUrVrWrXr_reÚAssertionErrorrfrhrirmrrrrÚ<module>sf       ÿ