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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
U
 ý°dѧã@s‚ddlmZddlZddlZddlZddlZddlZddlZddlZddl    m
Z ddl m Z ddlmZddlmZddlmZmZmZmZmZmZmZmZdd    lmZdd
lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+dd l,m-Z-dd l.m/Z/ddl0m1Z1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8m9Z9m:Z:ddl;m<Z<m=Z=ddl;m>Z?ddl;m@Z@ddlAmBZBejCr¤ddlDZDddlEmFZFddlmGZGmHZHe IeJ¡ZKejLe:eMe9dfZNe Od¡ZPGdd„dƒZQejRejShZTGdd„deQeƒZUGdd„deUƒZVdd dd!œd"d#„ZWejXd$d%d$d&œd'd(„ƒZ>ejXdd%dd&œd)d(„ƒZ>d%d%d%d&œd*d(„Z>d3d+d%dd,œd-d.„ZYd/d$d0œd1d2„ZZdS)4é)Ú annotationsN©Útimeout)Ú TracebackTypeé)Ú
_TYPE_BODY)ÚRequestMethods)Ú BaseSSLErrorÚBrokenPipeErrorÚDummyConnectionÚHTTPConnectionÚ HTTPExceptionÚHTTPSConnectionÚ ProxyConfigÚ_wrap_proxy_error)Úport_by_scheme) ÚClosedPoolErrorÚEmptyPoolErrorÚ FullPoolErrorÚHostChangedErrorÚInsecureRequestWarningÚLocationValueErrorÚ MaxRetryErrorÚNewConnectionErrorÚ ProtocolErrorÚ
ProxyErrorÚReadTimeoutErrorÚSSLErrorÚ TimeoutError)ÚBaseHTTPResponse)Úis_connection_dropped)Úconnection_requires_http_tunnel)Ú_TYPE_BODY_POSITIONÚset_file_position)ÚRetry)ÚCertificateError)Ú_DEFAULT_TIMEOUTÚ _TYPE_DEFAULTÚTimeout)ÚUrlÚ_encode_target)Ú_normalize_host)Ú    parse_url)Úto_str)ÚLiteral)ÚBaseHTTPConnectionÚBaseHTTPSConnectionÚ_SelfTc@sxeZdZUdZdZded<ejZdddddœd    d
„Z    dd œd d „Z
dddœdd„Z dddddœdd„Z dd œdd„Z dS)ÚConnectionPoola;
    Base class for all connection pools, such as
    :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.
 
    .. note::
       ConnectionPool.urlopen() does not normalize or percent-encode target URIs
       which is useful if your target server doesn't support percent-encoded
       target URIs.
    Nú
str | NoneÚschemeÚstrú
int | NoneÚNone)ÚhostÚportÚreturncCs:|s tdƒ‚t||jd|_||_t||jd ¡|_dS)NzNo host specified.©r4)rr+r4r8r9Únormalize_hostÚlowerÚ _tunnel_host)Úselfr8r9©r@úMd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\urllib3/connectionpool.pyÚ__init__Rs
zConnectionPool.__init__©r:cCs t|ƒj›d|j›d|j›dS)Nz(host=z, port=ú))ÚtypeÚ__name__r8r9©r?r@r@rAÚ__str___szConnectionPool.__str__r1)r?r:cCs|S©Nr@rGr@r@rAÚ    __enter__bszConnectionPool.__enter__ztype[BaseException] | NonezBaseException | NonezTracebackType | NonezLiteral[False])Úexc_typeÚexc_valÚexc_tbr:cCs | ¡dS)NF)Úclose)r?rKrLrMr@r@rAÚ__exit__eszConnectionPool.__exit__cCsdS©zD
        Close all pooled connections and disable the pool.
        Nr@rGr@r@rArNoszConnectionPool.close)N)rFÚ
__module__Ú __qualname__Ú__doc__r4Ú__annotations__ÚqueueÚ    LifoQueueÚQueueClsrBrHrJrOrNr@r@r@rAr2Ds
 
 
r2c@sjeZdZUdZdZeZded<dedddddddf    dd    d
d d d ddd dddœ dd„Z    ddœdd„Z
d?dddœdd„Z dddœd d!„Z dddœd"d#„Z dddœd$d%„Zd&d'dœd(d)„Zd*dd
dd+œd,d-„Zdddeddd.d.d.f    dddd/d d0d&d dd d d d1d2œ d3d4„Zddœd5d6„Zdd d7œd8d9„Zdddd.d.eddddd.d.f ddd/d dd d d&d    d:d d;d d dd1d<œd=d>„ZdS)@ÚHTTPConnectionPoola
    Thread-safe connection pool for one host.
 
    :param host:
        Host used for this HTTP Connection (e.g. "localhost"), passed into
        :class:`http.client.HTTPConnection`.
 
    :param port:
        Port used for this HTTP Connection (None is equivalent to 80), passed
        into :class:`http.client.HTTPConnection`.
 
    :param timeout:
        Socket timeout in seconds for each individual connection. This can
        be a float or integer, which sets the timeout for the HTTP request,
        or an instance of :class:`urllib3.util.Timeout` which gives you more
        fine-grained control over request timeouts. After the constructor has
        been parsed, this is always a `urllib3.util.Timeout` object.
 
    :param maxsize:
        Number of connections to save that can be reused. More than 1 is useful
        in multithreaded situations. If ``block`` is set to False, more
        connections will be created but they will not be saved once they've
        been used.
 
    :param block:
        If set to True, no more than ``maxsize`` connections will be used at
        a time. When no free connections are available, the call will block
        until a connection has been released. This is a useful side effect for
        particular multithreaded situations where one does not want to use more
        than maxsize connections per host to prevent flooding.
 
    :param headers:
        Headers to include with all requests, unless other headers are given
        explicitly.
 
    :param retries:
        Retry configuration to use by default with requests in this pool.
 
    :param _proxy:
        Parsed proxy URL, should not be used directly, instead, see
        :class:`urllib3.ProxyManager`
 
    :param _proxy_headers:
        A dictionary with proxy headers, should not be used directly,
        instead, see :class:`urllib3.ProxyManager`
 
    :param \**conn_kw:
        Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,
        :class:`urllib3.connection.HTTPSConnection` instances.
    Úhttpz4type[BaseHTTPConnection] | type[BaseHTTPSConnection]Ú ConnectionClsNrFr5r6ú_TYPE_TIMEOUT | NoneÚintÚboolútyping.Mapping[str, str] | NoneúRetry | bool | int | Noneú
Url | NonezProxyConfig | Noneú
typing.Any) r8r9rÚmaxsizeÚblockÚheadersÚretriesÚ_proxyÚ_proxy_headersÚ _proxy_configÚconn_kwc Ksàt |||¡t ||¡t|tƒs.t |¡}|dkr<tj}||_||_    | 
|¡|_ ||_ ||_ |    pfi|_|
|_t|ƒD]} |j  d¡qxd|_d|_| |_|j rÈ|j dg¡|j |jd<|j|jd<|j } t |t| ¡dS)NrÚsocket_optionsÚproxyÚ proxy_config)r2rBrÚ
isinstancer(Ú
from_floatr$ÚDEFAULTrrerWÚpoolrcrkÚ proxy_headersrlÚrangeÚputÚnum_connectionsÚ num_requestsriÚ
setdefaultÚweakrefÚfinalizeÚ_close_pool_connections)r?r8r9rrbrcrdrerfrgrhriÚ_rpr@r@rArB²s0 
 
 
   zHTTPConnectionPool.__init__r/rCcCsN|jd7_t d|j|j|jp$d¡|jf|j|j|jjdœ|j—Ž}|S)z9
        Return a fresh :class:`HTTPConnection`.
        rz(Starting new HTTP connection (%d): %s:%sÚ80)r8r9r)    rtÚlogÚdebugr8r9rZrÚconnect_timeoutri©r?Úconnr@r@rAÚ    _new_connïsüýüzHTTPConnectionPool._new_connz float | None)rr:cCs¤d}|jdkrt|dƒ‚z|jj|j|d}WnFtk
rNt|dƒd‚Yn(tjk
rt|jrpt|dƒd‚YnX|r˜t|ƒr˜t     
d|j ¡|  ¡|p¢|  ¡S)a™
        Get a connection. Will return a pooled connection if one is available.
 
        If no connections are available and :prop:`.block` is ``False``, then a
        fresh connection is returned.
 
        :param timeout:
            Seconds to wait before giving up and raising
            :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and
            :prop:`.block` is ``True``.
        NzPool is closed.)rcrzHPool is empty and a new connection can't be opened due to blocking mode.z Resetting dropped connection: %s)rprÚgetrcÚAttributeErrorrUÚEmptyrr r|r}r8rNr)r?rr€r@r@rAÚ    _get_conns( 
 
þý zHTTPConnectionPool._get_connzBaseHTTPConnection | Noner7©r€r:c    CsŽ|jdk    r~z|jj|ddWdStk
r4YnJtjk
r||rP| ¡|jrbt|dƒd‚t     d|j
|j  ¡¡YnX|rŠ| ¡dS)aä
        Put a connection back into the pool.
 
        :param conn:
            Connection object for the current host and port as returned by
            :meth:`._new_conn` or :meth:`._get_conn`.
 
        If the pool is already full, the connection is closed and discarded
        because we exceeded maxsize. If connections are discarded frequently,
        then maxsize should be increased.
 
        If the pool is closed, then the connection will be closed and discarded.
        NF©rcz>Pool reached maximum size and no more connections are allowed.zLConnection pool is full, discarding connection: %s. Connection pool size: %s) rprsrƒrUÚFullrNrcrr|Úwarningr8Úqsizerr@r@rAÚ    _put_conn)s.
þýý
zHTTPConnectionPool._put_conncCsdS)úU
        Called right before a request is made, after the socket is created.
        Nr@rr@r@rAÚ_validate_connTsz!HTTPConnectionPool._validate_conncCsdSrIr@rr@r@rAÚ_prepare_proxyYsz!HTTPConnectionPool._prepare_proxyÚ _TYPE_TIMEOUTr(cCs2|tkr|j ¡St|tƒr$| ¡St |¡SdS)z:Helper that always returns a :class:`urllib3.util.Timeout`N)r&rÚclonermr(rn)r?rr@r@rAÚ _get_timeout]s
 
 
zHTTPConnectionPool._get_timeoutz&BaseSSLError | OSError | SocketTimeout)ÚerrÚurlÚ timeout_valuer:cCsNt|tƒr t||d|›dƒ|‚t|dƒrJ|jtkrJt||d|›dƒ|‚dS)zAIs the error actually a timeout? Will raise a ReadTimeout or passúRead timed out. (read timeout=rDÚerrnoN)rmÚ SocketTimeoutrÚhasattrr–Ú_blocking_errnos)r?r’r“r”r@r@rAÚ_raise_timeoutis 
 
ÿþ
ÿþz!HTTPConnectionPool._raise_timeoutTz_TYPE_BODY | Nonez Retry | Noner) r€Úmethodr“ÚbodyrdrerÚchunkedÚ response_connÚpreload_contentÚdecode_contentÚenforce_content_lengthr:c  Cs|jd7_| |¡} |  ¡t | j¡|_zNz| |¡Wn:tt    fk
rx}z|j
|||jd‚W5d}~XYnXWn|t t t t    ttfk
rø}zR|}t|t    tfƒr´t|ƒ}t|t t t tfƒrä|rä|jrä|jsät||jjƒ}|‚W5d}~XYnXz|j||||||
| | dWnHtk
r.Yn4t k
r`}z|jtjkrP‚W5d}~XYnX| j}|js”|dkrŽt||d|›dƒ‚||_z | ¡}Wn:t    t fk
rÚ}z|j
|||d‚W5d}~XYnX||_|    |_||_t  !d|j|j"|j#|||j$|j%|j&¡    |S)    a8
 
        Perform a request on a given urllib connection object taken from our
        pool.
 
        :param conn:
            a connection from one of our connection pools
 
        :param method:
            HTTP request method (such as GET, POST, PUT, etc.)
 
        :param url:
            The URL to perform the request on.
 
        :param body:
            Data to send in the request body, either :class:`str`, :class:`bytes`,
            an iterable of :class:`str`/:class:`bytes`, or a file-like object.
 
        :param headers:
            Dictionary of custom headers to send, such as User-Agent,
            If-None-Match, etc. If None, pool headers are used. If provided,
            these headers completely replace any pool-specific headers.
 
        :param retries:
            Configure the number of retries to allow before raising a
            :class:`~urllib3.exceptions.MaxRetryError` exception.
 
            Pass ``None`` to retry until you receive a response. Pass a
            :class:`~urllib3.util.retry.Retry` object for fine-grained control
            over different types of retries.
            Pass an integer number to retry connection errors that many times,
            but no other types of errors. Pass zero to never retry.
 
            If ``False``, then retries are disabled and any exception is raised
            immediately. Also, instead of raising a MaxRetryError on redirects,
            the redirect response will be returned.
 
        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
 
        :param timeout:
            If specified, overrides the default timeout for this one
            request. It may be a float (in seconds) or an instance of
            :class:`urllib3.util.Timeout`.
 
        :param chunked:
            If True, urllib3 will send the body using chunked transfer
            encoding. Otherwise, urllib3 will send the body using the standard
            content-length form. Defaults to False.
 
        :param response_conn:
            Set this to ``None`` if you will handle releasing the connection or
            set the connection to have the response release it.
 
        :param preload_content:
          If True, the response's body will be preloaded during construction.
 
        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
 
        :param enforce_content_length:
            Enforce content length checking. Body returned by server must match
            value of Content-Length header, if present. Otherwise, raise error.
        r©r’r“r”N)rœrdrrŸr r¡rr•rDz%s://%s:%s "%s %s %s" %s %s)'rur‘Ú start_connectr(Zresolve_default_timeoutr~rrr—r    ršÚOSErrorrrr%rrmrkÚhas_connected_to_proxyrr4Úrequestr
r–Z
EPROTOTYPEÚ read_timeoutÚ    is_closedrÚ getresponsereÚ _connectionÚ_poolr|r}r8r9Ú _http_vsn_strÚstatusÚlength_remaining)r?r€r›r“rœrdrerrržrŸr r¡Ú timeout_objÚeÚnew_er§Úresponser@r@rAÚ _make_request|sœN
ú
ÿþþþø
 
 
ÿ ö z HTTPConnectionPool._make_requestcCs(|jdkrdS|jd}|_t|ƒdSrP)rpry)r?Úold_poolr@r@rArN1s
zHTTPConnectionPool.close)r“r:cCs„| d¡rdSt|ƒ^}}}}}|p&d}|dk    r<t||d}|jrR|sRt |¡}n|jsj|t |¡krjd}|||f|j|j|jfkS)zj
        Check if the given ``url`` is a member of the same host as this
        connection pool.
        ú/TrYNr;)Ú
startswithr,r+r9rr‚r4r8)r?r“r4rzr8r9r@r@rAÚ is_same_host=s
 
 zHTTPConnectionPool.is_same_hostz bool | Nonez_TYPE_BODY_POSITION | None)r›r“rœrdreÚredirectÚassert_same_hostrÚ pool_timeoutÚ release_connrÚbody_posrŸr Ú response_kwr:cKsbt|ƒ}|j}|dkr|j}t|tƒs8tj|||jd}|
dkrD| }
|r^| |¡s^t|||ƒ‚|     d¡rvt
t |ƒƒ}n
t
|j ƒ}d}|
}t |j|j|ƒ}|s°| ¡}| |j¡d}d}t|| ƒ} z¾zÈ| |¡}|j|    d}|j|_|jdk    rR|rR|jrRz| |¡WnBtttfk
rP}z|j||jj |jd‚W5d}~XYnX|
s\|nd}|j |||f|||| ||| |dœ|—Ž}d}Wnðt!k
r®d}d}‚YnÒt"t#tt$tt%t&t'fk
r~}z¢d}|}t|tt&fƒrðt%|ƒ}t|tt(t"t%t#fƒr,|r,|jr,|j)s,t*||jjƒ}nt|tt#fƒrFt$d    |ƒ}|j+||||t, -¡d
d }| .¡|}W5d}~XYnXW5|s |rœ| ¡d}d}|r°| |¡X|söt/ 0d |||¡|j1|||||||f||    |
| | | |d œ|—ŽS|o| 2¡}|r¬|j3dkrd}z|j+||||d}Wn,t4k
r\|j5rT| 6¡‚|YSX| 6¡| 7|¡t/ 8d||¡|j1||||f|||||    |
| | | |dœ
|—ŽSt9|j :d¡ƒ}| ;||j3|¡r^z|j+||||d}Wn,t4k
r|j<r| 6¡‚|YSX| 6¡| .|¡t/ 8d|¡|j1||||f|||||    |
| | | |dœ
|—ŽS|S)ay
        Get a connection from the pool and perform an HTTP request. This is the
        lowest level call for making a request, so you'll need to specify all
        the raw details.
 
        .. note::
 
           More commonly, it's appropriate to use a convenience method
           such as :meth:`request`.
 
        .. note::
 
           `release_conn` will only behave as expected if
           `preload_content=False` because we want to make
           `preload_content=False` the default behaviour someday soon without
           breaking backwards compatibility.
 
        :param method:
            HTTP request method (such as GET, POST, PUT, etc.)
 
        :param url:
            The URL to perform the request on.
 
        :param body:
            Data to send in the request body, either :class:`str`, :class:`bytes`,
            an iterable of :class:`str`/:class:`bytes`, or a file-like object.
 
        :param headers:
            Dictionary of custom headers to send, such as User-Agent,
            If-None-Match, etc. If None, pool headers are used. If provided,
            these headers completely replace any pool-specific headers.
 
        :param retries:
            Configure the number of retries to allow before raising a
            :class:`~urllib3.exceptions.MaxRetryError` exception.
 
            Pass ``None`` to retry until you receive a response. Pass a
            :class:`~urllib3.util.retry.Retry` object for fine-grained control
            over different types of retries.
            Pass an integer number to retry connection errors that many times,
            but no other types of errors. Pass zero to never retry.
 
            If ``False``, then retries are disabled and any exception is raised
            immediately. Also, instead of raising a MaxRetryError on redirects,
            the redirect response will be returned.
 
        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
 
        :param redirect:
            If True, automatically handle redirects (status codes 301, 302,
            303, 307, 308). Each redirect counts as a retry. Disabling retries
            will disable redirect, too.
 
        :param assert_same_host:
            If ``True``, will make sure that the host of the pool requests is
            consistent else will raise HostChangedError. When ``False``, you can
            use the pool on an HTTP proxy and request foreign hosts.
 
        :param timeout:
            If specified, overrides the default timeout for this one
            request. It may be a float (in seconds) or an instance of
            :class:`urllib3.util.Timeout`.
 
        :param pool_timeout:
            If set and the pool is set to block=True, then this method will
            block for ``pool_timeout`` seconds and raise EmptyPoolError if no
            connection is available within the time period.
 
        :param bool preload_content:
            If True, the response's body will be preloaded into memory.
 
        :param bool decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
 
        :param release_conn:
            If False, then the urlopen call will not release the connection
            back into the pool once a response is received (but will release if
            you read the entire contents of the response such as when
            `preload_content=True`). This is useful if you're not preloading
            the response's content immediately. You will need to call
            ``r.release_conn()`` on the response ``r`` to return the connection
            back into the pool. If None, it takes the value of ``preload_content``
            which defaults to ``True``.
 
        :param bool chunked:
            If True, urllib3 will send the body using chunked transfer
            encoding. Otherwise, urllib3 will send the body using the standard
            content-length form. Defaults to False.
 
        :param int body_pos:
            Position to seek to in file-like body in the event of a retry or
            redirect. Typically this won't need to be set because urllib3 will
            auto-populate the value when needed.
        N)r¸ÚdefaultrµFTrr¢)rrœrdrreržrŸr zConnection aborted.é)Úerrorr«Ú _stacktracez1Retrying (%r) after connection broken by '%r': %s)rrºr»rr¼rŸr i/ÚGET)r²r«zRedirecting %s -> %s)
rer¸r¹rrºr»rr¼rŸr z Retry-Afterz    Retry: %s)=r,r4rdrmr$Úfrom_intrer·rr¶r-r*r“r!rkrlÚcopyÚupdaterqr#rNr‹r‘r…r~rr¨rŽr    r¤r—ršr³rrr rrr%rrr¥rÚ    incrementÚsysÚexc_infoÚsleepr|r‰ÚurlopenÚget_redirect_locationr­rÚraise_on_redirectÚ
drain_connÚsleep_for_retryr}r]r‚Úis_retryÚraise_on_status)r?r›r“rœrdrer¸r¹rrºr»rr¼rŸr r½Ú
parsed_urlZdestination_schemer€Úrelease_this_connZhttp_tunnel_requiredr’Ú
clean_exitr¯r°ržr²r±Úredirect_locationÚhas_retry_afterr@r@rArÊSs’q
 
 
 ÿ 
 
 ÿýõ ôø ûþ    ÷    ÷    ÷
 
 
ÿ ÿùòñ 
 
üòñ
 
 üòñzHTTPConnectionPool.urlopen)N)rFrQrRrSr4r rZrTr&rBrr…r‹rrŽr‘ršr³rNr·rÊr@r@r@rArXys^
3þ
õ$=&+ ó(6 ñrXcs¼eZdZUdZdZeZded<dedddddddddddddddddfdd    d
d d d ddd ddddddddddddddœ‡fdd„ Z    dddœdd„Z
ddœdd „Z d!ddœ‡fd"d#„ Z ‡Z S)$ÚHTTPSConnectionPoola
    Same as :class:`.HTTPConnectionPool`, but HTTPS.
 
    :class:`.HTTPSConnection` uses one of ``assert_fingerprint``,
    ``assert_hostname`` and ``host`` in this order to verify connections.
    If ``assert_hostname`` is False, no verification is done.
 
    The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``,
    ``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl`
    is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade
    the connection socket into an SSL socket.
    Úhttpsztype[BaseHTTPSConnection]rZNrFr5r6r[r\r]r^r_r`r3zint | str | Nonezssl.TLSVersion | Nonezstr | Literal[False] | Nonerar7)r8r9rrbrcrdrerfrgÚkey_fileÚ    cert_fileÚ    cert_reqsÚ key_passwordÚca_certsÚ ssl_versionÚssl_minimum_versionÚssl_maximum_versionÚassert_hostnameÚassert_fingerprintÚ ca_cert_dirrir:c
sftƒj|||||||||    f    |Ž|
|_| |_| |_| |_||_||_||_||_    ||_
||_ ||_ dSrI) ÚsuperrBrØrÙrÚrÛrÜrârÝrÞrßràrá)r?r8r9rrbrcrdrerfrgrØrÙrÚrÛrÜrÝrÞrßràrárâri©Ú    __class__r@rArBÓs0÷
ö zHTTPSConnectionPool.__init__rr†cCs@|jr|jjdkrd}nd}|j||j|j|jd| ¡dS)z5Establishes a tunnel connection through HTTP CONNECT.r×rY)r4r8r9rdN)rkr4Ú
set_tunnelr>r9rqÚconnect)r?r€Z tunnel_schemer@r@rArŽsüz"HTTPSConnectionPool._prepare_proxyr0rCcCs¼|jd7_t d|j|j|jp$d¡|jr8|jtkr@tdƒ‚|j}|j}|jdk    rr|jjdk    rr|jj}|jj}|jf|||j    j
|j |j |j |j|j|j|j|j|j|j|jdœ|j—ŽS)zL
        Return a fresh :class:`urllib3.connection.HTTPConnection`.
        rz)Starting new HTTPS connection (%d): %s:%sÚ443zCCan't connect to HTTPS URL because the SSL module is not available.N)r8r9rrÙrØrÛrÚrÜrâràrárÝrÞrß)rtr|r}r8r9rZr Ú ImportErrorrkrr~rÙrØrÛrÚrÜrâràrárÝrÞrßri)r?Ú actual_hostÚ actual_portr@r@rArsDüÿòñzHTTPSConnectionPool._new_connr/cs:tƒ |¡|jr| ¡|js6t d|j›dt¡dS)rŒz0Unverified HTTPS request is being made to host 'z†'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warningsN)    rãrr¨rçÚ is_verifiedÚwarningsÚwarnr8rrrär@rAr<s  ùz"HTTPSConnectionPool._validate_conn)rFrQrRrSr4rrZrTr&rBrŽrrÚ __classcell__r@r@rärArÖÂs4
  ë>1)rÖr5ra)r“Úkwr:cKs^t|ƒ^}}}}}|pd}|p(t |d¡}|dkrFt|fd|i|—ŽSt|fd|i|—ŽSdS)a€
    Given a url, return an :class:`.ConnectionPool` instance of its host.
 
    This is a shortcut for not having to parse out the scheme, host, and port
    of the url before creating an :class:`.ConnectionPool` instance.
 
    :param url:
        Absolute URL string that must include the scheme. Port is optional.
 
    :param \**kw:
        Passes additional parameters to the constructor of the appropriate
        :class:`.ConnectionPool`. Useful for specifying things like
        timeout, maxsize, headers, etc.
 
    Example::
 
        >>> conn = connection_from_url('http://google.com/')
        >>> r = conn.request('GET', '/')
    rYéPr×r9N)r,rr‚rÖrX)r“rðr4rzr8r9r@r@rAÚconnection_from_urlRs ròr7r3)r8r4r:cCsdSrIr@©r8r4r@r@rAr+osr+cCsdSrIr@rór@r@rAr+tscCs2t||ƒ}|r.| d¡r.| d¡r.|dd…}|S)z?
    Normalize hosts for comparisons and use with sockets.
    ú[ú]réÿÿÿÿ)r<r¶Úendswithrór@r@rAr+ys
 z(HTTPConnectionPool | HTTPSConnectionPool)rpÚpathr:cCst|j|j|j|djS)zZReturns the URL from a given connection pool. This is mainly used for testing and logging.)r4r8r9rø)r)r4r8r9r“)rprør@r@rAÚ_url_from_pool‹srùzqueue.LifoQueue[typing.Any])rpr:cCs:z|jdd}|r| ¡qWntjk
r4YnXdS)z2Drains a queue of connections and closes each one.Fr‡N)r‚rNrUr„)rpr€r@r@rAry’s  ry)N)[Ú
__future__rr–ÚloggingrUrÇÚtypingrírwÚsocketrr—ÚtypesrZ_base_connectionrZ_request_methodsrÚ
connectionr    r
r r r rrrrÚ
exceptionsrrrrrrrrrrrrrr²rZutil.connectionr Z
util.proxyr!Z util.requestr"r#Z
util.retryr$Zutil.ssl_match_hostnamer%Z util.timeoutr&r'r(Zutil.urlr)r*r+r<r,Z    util.utilr-Ú TYPE_CHECKINGÚsslZtyping_extensionsr.r/r0Ú    getLoggerrFr|ÚUnionÚfloatrÚTypeVarr1r2ÚEAGAINÚ EWOULDBLOCKr™rXrÖròÚoverloadrùryr@r@r@rAÚ<module>sh     (
<         
 
2 Oÿ