Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
connectionpool.cpython-313.pyc400 linesDownload Raw Back to __pycache__
1�

2��j�����SSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J3r SSKJ
r
 SSKJr SSKJr SSKJr SS	KJrJrJrJrJrJrJrJr SS4KJr SSKJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+ SSK,J-r- SS
K.J/r/ SSK0J1r1 SSK2J3r3J4r4 SSK5J6r6 SSK7J8r8 SSK9J:r:J;r;J<r< SSK=J>r>J?r? SSK=J@rA SSK=JBrB SSKCJDrD \R�(aSSKFrFSSKGJHrH SSKJIrIJJrJ \R�"\L5rM\R�\<\O\;S4rP"SS5rQ\R�\R�1rT"SS\Q\5rU"SS\U5rVS%SjrW\R�S&S j5r@\R�S'S!j5r@S(S"jr@S)S*S#jjrYS+S$jrZg),�)�annotationsN��timeout)�
TracebackType�)�5_TYPE_BODY)�HTTPHeaderDict)�RequestMethods)�BaseSSLError�BrokenPipeError�DummyConnection�HTTPConnection�
HTTPException�HTTPSConnection�ProxyConfig�_wrap_proxy_error)�port_by_scheme)
�ClosedPoolError�EmptyPoolError�
FullPoolError�HostChangedError�InsecureRequestWarning�LocationValueError�
MaxRetryError�NewConnectionError�
ProtocolError�6ProxyError�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)�Self)�BaseHTTPConnection�BaseHTTPSConnectionc��\rSrSr%SrSrS\S'\Rr	SS
Sjjr7SSjrSSjrSS	jr
SS8jrSrg)�ConnectionPool�Ca9Base class for all connection pools, such as10:class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.11 12.. note::13   ConnectionPool.urlopen() does not normalize or percent-encode target URIs14   which is useful if your target server doesn't support percent-encoded15   target URIs.16N�17str | None�schemec��U(d[S5e[XRS9UlX l[XRS9R
5Ulg)NzNo host specified.�r7)rr-r7�host�port�normalize_host�lower�_tunnel_host)�selfr:r;s   �\D:\code\apps\devtools\python\user_packages\Python313\site-packages\urllib3/connectionpool.py�__init__�ConnectionPool.__init__QsB���$�%9�:�:�#�D���=��	��	�+�4���D�J�J�L���c�j�[U5RSUR<SUR<S3$)Nz(host=z, port=�))�type�__name__r:r;�r?s r@�__str__�ConnectionPool.__str__^s.���t�*�%�%�&�f�T�Y�Y�M�����
�Q�O�OrCc��U$�N�rHs r@�	__enter__�ConnectionPool.__enter__as���rCc�$�UR5 g)NF)�close)r?�exc_type�exc_val�exc_tbs    r@�__exit__�ConnectionPool.__exit__ds��	
�18�19��rCc��g�z420Close all pooled connections and disable the pool.21NrMrHs r@rQ�ConnectionPool.closen��rC)r>r:r;rL)r:�strr;�22int | None�return�None)r]r[)r]r0)rRztype[BaseException] | NonerSzBaseException | NonerTzTracebackType | Noner]ztyping.Literal[False]�r]r^)rG�23__module__�__qualname__�__firstlineno__�__doc__r7�__annotations__�queue�	LifoQueue�QueueClsrArIrNrUrQ�__static_attributes__rMrCr@r4r4Cs]����F�J�����H�M�P���,��&��%�	�2425��rCr4c��\rSrSr%SrSr\rS\S'S\	SSSSSSS4	SS	jjr26SS27jrSSSjjrSSjr
SS
jrSSjrSSjrSSjrSSS\	SSSSS4	SSjjrS SjrS!SjrSSSSS\	SSSSSS4S"SjjrSrg)#�HTTPConnectionPool�xaw28Thread-safe connection pool for one host.29 30:param host:31    Host used for this HTTP Connection (e.g. "localhost"), passed into32    :class:`http.client.HTTPConnection`.33 34:param port:35    Port used for this HTTP Connection (None is equivalent to 80), passed36    into :class:`http.client.HTTPConnection`.37 38:param timeout:39    Socket timeout in seconds for each individual connection. This can40    be a float or integer, which sets the timeout for the HTTP request,41    or an instance of :class:`urllib3.util.Timeout` which gives you more42    fine-grained control over request timeouts. After the constructor has43    been parsed, this is always a `urllib3.util.Timeout` object.44 45:param maxsize:46    Number of connections to save that can be reused. More than 1 is useful47    in multithreaded situations. If ``block`` is set to False, more48    connections will be created but they will not be saved once they've49    been used.50 51:param block:52    If set to True, no more than ``maxsize`` connections will be used at53    a time. When no free connections are available, the call will block54    until a connection has been released. This is a useful side effect for55    particular multithreaded situations where one does not want to use more56    than maxsize connections per host to prevent flooding.57 58:param headers:59    Headers to include with all requests, unless other headers are given60    explicitly.61 62:param retries:63    Retry configuration to use by default with requests in this pool.64 65:param _proxy:66    Parsed proxy URL, should not be used directly, instead, see67    :class:`urllib3.ProxyManager`68 69:param _proxy_headers:70    A dictionary with proxy headers, should not be used directly,71    instead, see :class:`urllib3.ProxyManager`72 73:param \**conn_kw:74    Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,75    :class:`urllib3.connection.HTTPSConnection` instances.76�httpz4type[BaseHTTPConnection] | type[BaseHTTPSConnection]�
ConnectionClsNrFc���[RXU5 [R"X5 [U[5(d[R77"U5nUc[RnX0lXpl	URU5UlXPlX�l
U	=(d 0UlX�l[!U5HnURR#S5 M  SUlSUlX�lUR(aNUR(R+S/5 URUR(S'URUR(S'URn
[,R."U[0U
5 g)Nr�socket_options�proxy�proxy_config)r4rAr78�79isinstancer*�80from_floatr&�DEFAULTr�retriesrg�pool�blockrp�
proxy_headersrq�range�put�num_connections�num_requests�conn_kw�81setdefault�weakref�finalize�_close_pool_connections)r?r:r;r�maxsizerw�headersru�_proxy�_proxy_headers�
_proxy_configr}�_rvs              r@rA�HTTPConnectionPool.__init__�s��	����D�1�����.��'�7�+�+��(�(��1�G��?��m�m�G�����8<�
�
�g�8N��	��82��83�+�1�r���)���w��A��I�I�M�M�$�� � !���������:�:�
�L�L�#�#�$4�b�9�$(�J�J�D�L�L��!�+/�+<�+<�D�L�L��(��y�y��	����6��=rCc�>�U=RS-
sl[RSURURUR=(d S5 UR84"SURURURRS.URD6nU$)z)85Return a fresh :class:`HTTPConnection`.86rz(Starting new HTTP connection (%d): %s:%s�80)r:r;rrM)	r{�log�debugr:r;rmr�connect_timeoutr}�r?�conns  r@�	_new_conn�HTTPConnectionPool._new_conn�s���	
����!���	�	�6�� � ��I�I��I�I���		87��!�!�88��������L�L�0�0�89��l�l�	90���rCc���SnURc[US5eURRURUS9nU(a@[U5(a0[RSUR5 UR5 U=(d UR5$![a [US5Se[91Ra! UR(a
[US5SeN�f=f)aY92Get a connection. Will return a pooled connection if one is available.93 94If no connections are available and :prop:`.block` is ``False``, then a95fresh connection is returned.96 97:param timeout:98    Seconds to wait before giving up and raising99    :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and100    :prop:`.block` is ``True``.101NzPool is closed.)rwrzHPool is empty and a new connection can't be opened due to blocking mode.z Resetting dropped connection: %s)rvr�getrw�AttributeErrorre�Emptyrr"r�r�r:rQr�)r?rr�s   r@�	_get_conn�HTTPConnectionPool._get_conns������9�9��!�$�(9�:�:�	��9�9�=�=�t�z�z�7�=�C�D��)�$�/�/��I�I�8�$�)�)�D��J�J�L��'�t�~�~�'�'��!�	E�!�$�(9�:��D��{�{�	��z�z�$��^����
�
	�s�$B!�!AC,�+C,c��URbURRUSS9 gU(aUR5 gg![a N%[Raq U(aUR5 UR(a
[US5Se[RSURURR55 N�f=f)a�102Put a connection back into the pool.103 104:param conn:105    Connection object for the current host and port as returned by106    :meth:`._new_conn` or :meth:`._get_conn`.107 108If the pool is already full, the connection is closed and discarded109because we exceeded maxsize. If connections are discarded frequently,110then maxsize should be increased.111 112If the pool is closed, then the connection will be closed and discarded.113NF�rwz>Pool reached maximum size and no more connections are allowed.zLConnection pool is full, discarding connection: %s. Connection pool size: %s)rvrzr�re�FullrQrwrr��warningr:�qsizer�s  r@�	_put_conn�HTTPConnectionPool._put_conn&s����9�9� �
��	�	�
�
�d�%�
�0��.��J�J�L���-"�
���:�:�
���J�J�L��:�:�'��X�� � �114���b��I�I��I�I�O�O�%��
�s�A�115C�BC�Cc��g)�E116Called right before a request is made, after the socket is created.117NrMr�s  r@�_validate_conn�!HTTPConnectionPool._validate_connQrZrCc��grLrMr�s  r@�_prepare_proxy�!HTTPConnectionPool._prepare_proxyVs��rCc��U[LaURR5$[U[5(aUR5$[R118"U5$)z:Helper that always returns a :class:`urllib3.util.Timeout`)r(r�clonerrr*rs)r?rs  r@�_get_timeout�HTTPConnectionPool._get_timeoutZsJ���&�&��<�<�%�%�'�'��g�w�'�'��=�=�?�"��%�%�g�.�.rCc��[U[5(a[XSUS35Ue[US5(a&UR[119;a[XSUS35Uegg)zAIs the error actually a timeout? Will raise a ReadTimeout or pass�Read timed out. (read timeout=rE�errnoN)rr�
SocketTimeoutr�hasattrr��_blocking_errnos)r?�err�url�
timeout_values    r@�_raise_timeout�!HTTPConnectionPool._raise_timeoutfss���c�=�)�)�"��;�M�?�!�L���
�120�3�� � �S�Y�Y�2B�%B�"��;�M�?�!�L���
�&C� rCTc
��U=RS-
slURU5n
U
R5 [R"U
R1215UlURU5 UR+UUUUUU122UUS9 U
R4nUR6(dUS:Xa[9XSUS35eUUlUR;5nUUlU	UlUUl [BRESUR(URFURHUUURJURLURN5	 U$![[4a nURX�URS9 eSnAff=f![[[[[[4a�nUn[!U[[45(a[U5n[!U[[[[45(aHU(aAUR"(a0UR$(d['X�R"R(5nUeSnAff=f![,a GN�[aHnUR.[.R0:waUR.[.R2:waeSnAGN123SnAff=f![[4anURX�US9 eSnAff=f)	a�124Perform a request on a given urllib connection object taken from our125pool.126 127:param conn:128    a connection from one of our connection pools129 130:param method:131    HTTP request method (such as GET, POST, PUT, etc.)132 133:param url:134    The URL to perform the request on.135 136:param body:137    Data to send in the request body, either :class:`str`, :class:`bytes`,138    an iterable of :class:`str`/:class:`bytes`, or a file-like object.139 140:param headers:141    Dictionary of custom headers to send, such as User-Agent,142    If-None-Match, etc. If None, pool headers are used. If provided,143    these headers completely replace any pool-specific headers.144 145:param retries:146    Configure the number of retries to allow before raising a147    :class:`~urllib3.exceptions.MaxRetryError` exception.148 149    Pass ``None`` to retry until you receive a response. Pass a150    :class:`~urllib3.util.retry.Retry` object for fine-grained control151    over different types of retries.152    Pass an integer number to retry connection errors that many times,153    but no other types of errors. Pass zero to never retry.154 155    If ``False``, then retries are disabled and any exception is raised156    immediately. Also, instead of raising a MaxRetryError on redirects,157    the redirect response will be returned.158 159:type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.160 161:param timeout:162    If specified, overrides the default timeout for this one163    request. It may be a float (in seconds) or an instance of164    :class:`urllib3.util.Timeout`.165 166:param chunked:167    If True, urllib3 will send the body using chunked transfer168    encoding. Otherwise, urllib3 will send the body using the standard169    content-length form. Defaults to False.170 171:param response_conn:172    Set this to ``None`` if you will handle releasing the connection or173    set the connection to have the response release it.174 175:param preload_content:176  If True, the response's body will be preloaded during construction.177 178:param decode_content:179    If True, will attempt to decode the body based on the180    'content-encoding' header.181 182:param enforce_content_length:183    Enforce content length checking. Body returned by server must match184    value of Content-Length header, if present. Otherwise, raise error.185r�r�r�r�N)�bodyr��chunked�preload_content�decode_content�enforce_content_lengthrr�rEz%s://%s:%s "%s %s %s" %s %s)(r|r��
start_connectr*�resolve_default_timeoutr�rr�r�rr��OSErrorrr r'rrrrp�has_connected_to_proxyrr7�requestrr��186EPROTOTYPE�187ECONNRESET�read_timeout�	is_closedr�getresponseru�_connection�_poolr�r�r:r;�version_string�status�length_remaining)r?r��methodr�r�r�rurr��
response_connr�r�r��timeout_obj�e�new_er��responses                  r@�
_make_request� HTTPConnectionPool._make_requestys}��\	
���Q����'�'��0���!�!�#��6�6�{�7R�7R�S���	�
��#�#�D�)�8	��L�L������ /�-�'=�
�	
�2#�/�/���~�~��q� �&��!?��~�Q�O���(�D�L�	��'�'�)�H�#���,�������	�	�)��K�K��I�I��I�I����#�#��O�O��%�%�188	189����w"�<�0�
��#�#��$�,�,�#�O���
��
������
190�	� !�E��!�l�,<�=�>�>� �������!3�\�8�L����D�J�J�t�/J�/J�)�%���1B�1B�C���K��#	��H�	���	�191�w�w�%�*�*�*�q�w�w�%�:J�:J�/J����
	��4�g�&�	����A�l��K���	�sg�E�0H7�J�E1�E,�,E1�1E4�4$H4�BH/�/H4�7192J�	J�
=J�J�J>�(J9�9J>c�\�URcgURSsol[U5 grX)rvr�)r?�old_pools  r@rQ�HTTPConnectionPool.close.s+���9�9���"�i�i����)�	 ��)rCc��URS5(ag[U5tp#pEnU=(d SnUb	[XBS9nUR(aU(d[R193"U5nO-UR(dU[R194"U5:XaSnX$U4URURUR4:H$)zR195Check if the given ``url`` is a member of the same host as this196connection pool.197�/TrlNr9)�198startswithr.r-r;rr�r7r:)r?r�r7r�r:r;s      r@�is_same_host�HTTPConnectionPool.is_same_host:s���199�>�>�#����%.�c�N�!��4���!�6����"�4�7�D��9�9�T�!�%�%�f�-�D����t�~�'9�'9�&�'A�A��D��d�#����T�Y�Y��	�	�'J�J�JrCc��URS5(a[[U55nSnO,[U5nURn[UR2005nUcURn[U[5(d[R"XVURS9nU201cU
n202U(a"URU5(d[XU5eSnU203n[URURU5nU(d+UR!5nUR#UR$5 SnSn['X<5nUR)U5nUR+U	S9nUR,UlURb*U(a#UR0(aUR3U5 U204(dUOSnUR<"UUU4UUUUUUU
US.UD6nSnU(dU(aUR[5 SnSnU(aUR]U5 U(d9[^RaSUUU5 URb"UUUUUUU4UU	U205UUU
US
.UD6$U=(a WRe5nU(GaWRfS:XaSnSn[iU5Rk5nURl(acURU5(dMUR!5nUH5nURo5URl;dM#URqUS5 M7 UnURSXUUS9nURw5 URyU5 [^R{SUU5 URb"UUUU4UUUUU	U206UUU
US.207UD6$[}WRRS55nUR�UURfU5(ajURSXUUS9nURw5 URYU5 [^R{SU5 URb"UUUU4UUUUU	U208UUU
US.209UD6$U$![4[6[84a5nUR;UURR210UR.S9 eSnAff=f![>a SnSne[@[B[6[D[4[F[H[J4Ga211nSnUn[U[4[H45(a[GU5n[U[6[L[@[F[B45(aJU(aCUR(a2URN(d![QUURR5nO'[U[6[B45(a[ES	U5nURSXUU[TRV"5S212S9nURY5 UnSnAGN�SnAff=f!U(dU(aUR[5 SnSnU(aUR]U5 ff=f![ra' URt(aURw5 eUs$f=f![ra' UR�(aURw5 eUs$f=f)a=213Get a connection from the pool and perform an HTTP request. This is the214lowest level call for making a request, so you'll need to specify all215the raw details.216 217.. note::218 219   More commonly, it's appropriate to use a convenience method220   such as :meth:`request`.221 222.. note::223 224   `release_conn` will only behave as expected if225   `preload_content=False` because we want to make226   `preload_content=False` the default behaviour someday soon without227   breaking backwards compatibility.228 229:param method:230    HTTP request method (such as GET, POST, PUT, etc.)231 232:param url:233    The URL to perform the request on.234 235:param body:236    Data to send in the request body, either :class:`str`, :class:`bytes`,237    an iterable of :class:`str`/:class:`bytes`, or a file-like object.238 239:param headers:240    Dictionary of custom headers to send, such as User-Agent,241    If-None-Match, etc. If None, pool headers are used. If provided,242    these headers completely replace any pool-specific headers.243 244:param retries:245    Configure the number of retries to allow before raising a246    :class:`~urllib3.exceptions.MaxRetryError` exception.247 248    If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a249    :class:`~urllib3.util.retry.Retry` object for fine-grained control250    over different types of retries.251    Pass an integer number to retry connection errors that many times,252    but no other types of errors. Pass zero to never retry.253 254    If ``False``, then retries are disabled and any exception is raised255    immediately. Also, instead of raising a MaxRetryError on redirects,256    the redirect response will be returned.257 258:type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.259 260:param redirect:261    If True, automatically handle redirects (status codes 301, 302,262    303, 307, 308). Each redirect counts as a retry. Disabling retries263    will disable redirect, too.264 265:param assert_same_host:266    If ``True``, will make sure that the host of the pool requests is267    consistent else will raise HostChangedError. When ``False``, you can268    use the pool on an HTTP proxy and request foreign hosts.269 270:param timeout:271    If specified, overrides the default timeout for this one272    request. It may be a float (in seconds) or an instance of273    :class:`urllib3.util.Timeout`.274 275:param pool_timeout:276    If set and the pool is set to block=True, then this method will277    block for ``pool_timeout`` seconds and raise EmptyPoolError if no278    connection is available within the time period.279 280:param bool preload_content:281    If True, the response's body will be preloaded into memory.282 283:param bool decode_content:284    If True, will attempt to decode the body based on the285    'content-encoding' header.286 287:param release_conn:288    If False, then the urlopen call will not release the connection289    back into the pool once a response is received (but will release if290    you read the entire contents of the response such as when291    `preload_content=True`). This is useful if you're not preloading292    the response's content immediately. You will need to call293    ``r.release_conn()`` on the response ``r`` to return the connection294    back into the pool. If None, it takes the value of ``preload_content``295    which defaults to ``True``.296 297:param bool chunked:298    If True, urllib3 will send the body using chunked transfer299    encoding. Otherwise, urllib3 will send the body using the standard300    content-length form. Defaults to False.301 302:param int body_pos:303    Position to seek to in file-like body in the event of a retry or304    redirect. Typically this won't need to be set because urllib3 will305    auto-populate the value when needed.306r�N)�redirect�defaultFrr�)rr�r�r�rur�r�r�TzConnection aborted.�)�errorr��_stacktracez1Retrying (%r) after connection broken by '%r': %s)r�pool_timeout�release_connr��body_posr�r�i/�GET)r�r�zRedirecting %s -> %s)307rur��assert_same_hostrr�r�r�r�r�r�zRetry-Afterz	Retry: %s)Br�r/r,r.r7r�r�rrr&�from_intrur�rr#rprq�copy�updaterxr%r�r�r�rr�r�rr�r�r�r�rr rrrr'rrr�r�	increment�sys�exc_info�sleeprQr�r�r��urlopen�get_redirect_locationr�r	�_prepare_for_method_change�remove_headers_on_redirectr=�popr�raise_on_redirect�308drain_conn�sleep_for_retryr��boolr��is_retry�raise_on_status) r?r�r�r�r�rur�r�rr�r�r�r�r�r��response_kw�destination_scheme�309parsed_urlr��release_this_conn�http_tunnel_requiredr��310clean_exitr�r�r�r�r��redirect_location�new_headers�header�has_retry_afters                                 r@r��HTTPConnectionPool.urlopenPsH��d�>�>�#������,�-�C�!%��"�3��J�!+�!2�!2������(�C��?��l�l�G��'�5�)�)��n�n�W����V�G���*�L��D�$5�$5�c�$:�$:�"�4�g�6�6���)��>��J�J��)�)�+=� 311��$��l�l�n�G��N�N�4�-�-�.����312�%�T�4��e	%��+�+�G�4�K��>�>�,�>�7�D�&�6�6�D�L��z�z�%�*>�4�>�>���'�'��-�)5�D�$�M��)�)����
�$�����+� /�-�
��
�H� �J�^�313��J�J�L��D�$(�!� ����t�$���K�K�C�W�c�SV�
��<�<������� �� �)�)��!� /�-����
�&%�I��)G�)G�)I������#�%�����(��1�L�L�N��314�1�1�$�:K�:K�!�;�;�&�l�l�n��%�F��|�|�~��)K�)K�K�#�����5�&�&��
 �!�+�+�F�(�RV�+�W��
���!��#�#�H�-��I�I�,�c�3D�E��<�<��!���	�315 �!�!1��)�)��!� /�-����
�&�x�/�/�3�3�M�B�C�����F�H�O�O�_�E�E�
 �!�+�+�F�(�RV�+�W��
���!��M�M�(�#��I�I�k�3�'��<�<�����	�316 �!�!1��)�)��!� /�-����
�$���M%�g�}�=���'�'��4�:�:�>�>����(����	��>�	��J� %���
��������	317�$	��J� �E��!�l�,<�=�>�>� �������&� ��!��	�	��D�J�J�t�/J�/J�)�%����1B�1B�C���E�G�]�#;�<�<�%�&;�U�C���'�'��5��#�,�,�.�QR�BS�(��G�
�M�M�O��C��I$	��N�318��J�J�L��D�$(�!� ����t�$�	!��j!�
 ��,�,��'�'�)����	
 ��@!�
 ��*�*��'�'�)����	
 �st�2AQ+�	P�+Q+�W5�3X)�Q(�30Q#�#Q(�(Q+�+=V2�(C?V-�'V5�-V2�2V5�5=W2�5.X&�%X&�).Y�Y)319rwr}r{r|rvrprqrxrur)r:r[r;r\r�_TYPE_TIMEOUT | Noner��intrwr�r��typing.Mapping[str, str] | Noneru�Retry | bool | int | Noner��320Url | Noner�rr�zProxyConfig | Noner}�321typing.Any)r]r1rL)rzfloat | Noner]r1)r��BaseHTTPConnection | Noner]r^�r�r1r]r^)r�
_TYPE_TIMEOUTr]r*)r�z&BaseSSLError | OSError | SocketTimeoutr�r[r�rr]r^)r�r1r�r[r�r[r��_TYPE_BODY | Noner�rruzRetry | Nonerrr�r�r�r	r�r�r�r�r�r�r]r!r_)r�r[r]r�) r�r[r�r[r�rr�rrurr�r�r�r�rrr�r\r�zbool | Noner�r�r�z_TYPE_BODY_POSITION | Noner�r�r�r�r�rr]r!)rGr`rarbrcr7rrmrdr(rAr�r�r�r�r�r�r�r�rQr�r�rhrMrCr@rjrjxs���1�f�F�JX�M�G�X�322 �(8���37�-1�!�:>�,0�;>��;>��;>�&�	;>�323�;>��
;>�1�;>�+�;>��;>�8�;>�*�;>��;>�z�($(�L)�V�324
�325/��
3����,�	�326327��0#'�37� $�!1��37� $�#�'+�s� �s��s��	s�328 �s�1�
s��s��s��s�1�s��s��s�!%�s�329�s�j330*�K�4#'�37�-1��!%�!1�#'�$(��/3� $�#�}��}��}� �	}�3311�}�+�
}��}��}��}�!�}�"�}��}�-�}��}��}� "�!}�"332�#}�}rCrjc��^�\rSrSr%SrSr\rS\S'S\	SSSSSSSSSSSSSSSSS4SU4S	jjjr333SS334jrSSjrSU4Sjjr
S
rU=r$)�HTTPSConnectionPooli�a�335Same as :class:`.HTTPConnectionPool`, but HTTPS.336 337:class:`.HTTPSConnection` uses one of ``assert_fingerprint``,338``assert_hostname`` and ``host`` in this order to verify connections.339If ``assert_hostname`` is False, no verification is done.340 341The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``,342``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl`343is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade344the connection socket into an SSL socket.345�httpsztype[BaseHTTPSConnection]rmNrFc��>�[TU]"UUUUUUUUU	4	0UD6 X�lX�lX�lX�lX�lUUlX�lUUl	UUl346UUlUUlgrL)
�superrA�key_file�	cert_file�	cert_reqs�key_password�ca_certs�ca_cert_dir�ssl_version�ssl_minimum_version�ssl_maximum_version�assert_hostname�assert_fingerprint)r?r:r;rr�rwr�rur�r�rrrrrrrrrrrr}�	__class__s                      �r@rA�HTTPSConnectionPool.__init__�s����0	������������	347��	348�!�
�"��"��(�� �
�&���&��#6�� �#6�� �.���"4��rCc���UR(aURRS:XaSnOSnURUURURUR349S9 UR
5 g)z5Establishes a tunnel connection through HTTP CONNECT.rrl)r7r:r;r�N)rpr7�350set_tunnelr>r;rx�connect)r?r��
tunnel_schemes   r@r��"HTTPSConnectionPool._prepare_proxys\���:�:�$�*�*�+�+�w�6�#�M�"�M���� ��"�"�����&�&�		�	351�	
���rCc�2�U=RS-
sl[RSURURUR=(d S5 UR352(aUR353[La[S5eURnURnURbCURRb,URRnURRnUR354"SUUURRURURURURURUR UR"UR$UR&UR(UR*S.UR,D6$)z<355Return a fresh :class:`urllib3.connection.HTTPConnection`.356rz)Starting new HTTPS connection (%d): %s:%s�443zCCan't connect to HTTPS URL because the SSL module is not available.)r:r;rrrrrrrrrrrrrM)r{r�r�r:r;rmr
�ImportErrorrprr�rrrrrrrrrrrr})r?�actual_host�actual_ports   r@r��HTTPSConnectionPool._new_conn!sA��	
����!���	�	�7�� � ��I�I��I�I���		357��!�!�T�%7�%7�?�%J��U��
� �9�9���i�i���:�:�!�d�j�j�o�o�&A��*�*�/�/�K��*�*�/�/�K��!�!�358����L�L�0�0��n�n��]�]��*�*��n�n��]�]��(�(� �0�0�#�6�6��(�(� $� 8� 8� $� 8� 8�359��l�l�360�	361rCc�>�[TU]U5 UR(aUR5 UR(d<UR362(d*[R"SURS3[5 ggg)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)363rr�r�r!�is_verified�proxy_is_verified�warnings�warnr:r)r?r�rs  �r@r��"HTTPSConnectionPool._validate_connJsf���	���t�$��>�>��L�L�N�����(>�(>��M�M�F�t�y�y�k�R$�$�364'�
�)?�rC)rrrrrrrrrrr),r:r[r;r\rrr�rrwr�r�rrurr�rr�rrr6rr6r�int | str | Nonerr6rr6rr0r�ssl.TLSVersion | Nonerr1rz"str | typing.Literal[False] | Nonerr6rr6r}rr]r^)r�rr]r^)r]r2r365)rGr`rarbrcr7rrmrdr(rAr�r�r�rh�
__classcell__)rs@r@rr�sO�����F�/>�M�,�>�366 �(8���37�-1�!�:>�#� $�&*�#'�#�(,�59�59�>B�)-�"&�+/5��/5��/5�&�	/5�367�/5��
/5�1�/5�+�/5��/5�8�/5��/5��/5�$�/5�!�/5��/5� &�!/5�"3�#/5�$3�%/5�&<�'/5�('�)/5�* �+/5�,�-/5�.368�//5�/5�b
�'369�R�rCrc��[U5tp#pEnU=(d SnU=(d [R"US5nUS:Xa[U4SU0UD6$[	U4SU0UD6$)aL370Given a url, return an :class:`.ConnectionPool` instance of its host.371 372This is a shortcut for not having to parse out the scheme, host, and port373of the url before creating an :class:`.ConnectionPool` instance.374 375:param url:376    Absolute URL string that must include the scheme. Port is optional.377 378:param \**kw:379    Passes additional parameters to the constructor of the appropriate380    :class:`.ConnectionPool`. Useful for specifying things like381    timeout, maxsize, headers, etc.382 383Example::384 385    >>> conn = connection_from_url('http://google.com/')386    >>> r = conn.request('GET', '/')387rl�Prr;)r.rr�rrj)r��kwr7r�r:r;s      r@�connection_from_urlr6asg��(!*�#���F�t�A�
�
�v�F��1�>�%�%�f�b�1�D�
���"�4�9�d�9�b�9�9�!�$�8�T�8�R�8�8rCc��grLrM�r:r7s  r@r-r-~s��=@rCc��grLrMr8s  r@r-r-�s��;>rCc��[X5nU(a1URS5(aURS5(aUSSnU$)z7388Normalize hosts for comparisons and use with sockets.389�[�]r�����)r<r��endswithr8s  r@r-r-�s?��390�$�'�D������$�$����s�);�);��A�b�z���KrCc�j�[URURURUS9R$)zZReturns the URL from a given connection pool. This is mainly used for testing and logging.)r7r:r;�path)r+r7r:r;r�)rvr@s  r@�_url_from_poolrA�s'���d�k�k��	�	��	�	��M�Q�Q�QrCc��URSS9nU(aUR5 M(![Ra gf=f)z2Drains a queue of connections and closes each one.Fr�N)r�rQrer�)rvr�s  r@r�r��sC��
���8�8�%�8�(�D���391�392�����;�;�
��
�s�)+�A�A)r�r[r5rr]rj)r:r^r7r6r]r^)r:r[r7r6r]r[)r:r6r7r6r]r6rL)rvz(HTTPConnectionPool | HTTPSConnectionPoolr@r6r]r[)rvzqueue.LifoQueue[typing.Any]r]r^)[�393__future__rr��loggingrer��typingr-r�socketrr��typesr�_base_connectionr�_collectionsr	�_request_methodsr394�395connectionrrr
rrrrrr�396exceptionsrrrrrrrrrrrrr r�r!�util.connectionr"�397util.proxyr#�util.requestr$r%�398util.retryr&�util.ssl_match_hostnamer'�util.timeoutr(r)r*�util.urlr+r,r-r<r.�	util.utilr/�
TYPE_CHECKING�ssl�typing_extensionsr0r1r2�	getLoggerrGr��Union�floatrr4�EAGAIN�EWOULDBLOCKr�rjrr6�overloadrAr�rMrCr@�<module>r^sU��"����399�
���+��(�(�,�	�	�	�9�����'�2�7�@��5�B�B�)�7���	����&�I�
����!�����W�e�]�D�@�A�
�.�.�d�L�L�%�"3�"3�4��U
���U
�pN�,�N�b9�:���@��@����>��>��&HL�R�4002�R�:D�R��R�
rC
codekingpro/portable-devtools · Team Ai