zy&~J d Z ddlZddlZddlmZmZ ddlmZ ddl m
Z
ddl mZ ddl
mZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2mZmZm3Z3m4Z4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: n# e;$ r d Z:Y nw xY wdZdZ? G d d e@ ZA G d! d"eA ZBdS )#z
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
N)PoolManagerproxy_from_url)HTTPResponse) parse_url)Timeout)Retry)ClosedPoolError)ConnectTimeoutError) HTTPError)
MaxRetryError)NewConnectionError)
ProxyError)
ProtocolError)ReadTimeoutError)SSLError)
ResponseError)LocationValueError )Response)urlparse
basestring)DEFAULT_CA_BUNDLE_PATHextract_zipped_pathsget_encoding_from_headersprepend_scheme_if_neededget_auth_from_url
urldefragauthselect_proxy)CaseInsensitiveDict)extract_cookies_to_jar) ConnectionErrorConnectTimeoutReadTimeoutr r
RetryError
InvalidSchemaInvalidProxyURL
InvalidURL)_basic_auth_str)SOCKSProxyManagerc t d )Nz'Missing dependencies for SOCKS support.)r% )argskwargss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/requests/adapters.pyr) r) . s EFFF F
c 4 e Zd ZdZ fdZ ddZd Z xZS ) BaseAdapterzThe Base Transport Adapterc V t t | d S N)superr1 __init__)self __class__s r- r5 zBaseAdapter.__init__: s%
k4 ))+++++r. FNTc t )aC Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest ` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) ` tuple.
:type timeout: float or tuple
:param verify: (optional) Either a boolean, in which case it controls whether we verify
the server's TLS certificate, or a string, in which case it must be a path
to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
NotImplementedError)r6 requeststreamtimeoutverifycertproxiess r- sendzBaseAdapter.send= s
"!r. c t )z!Cleans up adapter specific items.r9 r6 s r- closezBaseAdapter.closeO s !!r. FNTNN)__name__
__module____qualname____doc__r5 rA rD
__classcell__r7 s @r- r1 r1 7 sk $$, , , , , @D $" " " "$" " " " " " "r. r1 c e Zd ZdZg dZeeeef fd Zd Z d Z
efdZd Zd Z
d ZddZd Zd
Zd Zd ZddZ xZS )HTTPAdaptera The built-in HTTP Adapter for urllib3.
Provides a general-case interface for Requests sessions to contact HTTP and
HTTPS urls by implementing the Transport Adapter interface. This class will
usually be created by the :class:`Session ` class under the
covers.
:param pool_connections: The number of urllib3 connection pools to cache.
:param pool_maxsize: The maximum number of connections to save in the pool.
:param max_retries: The maximum number of retries each connection
should attempt. Note, this applies only to failed DNS lookups, socket
connections and connection timeouts, never to requests where data has
made it to the server. By default, Requests does not retry failed
connections. If you need granular control over the conditions under
which we retry a request, import urllib3's ``Retry`` class and pass
that instead.
:param pool_block: Whether the connection pool should block for connections.
Usage::
>>> import requests
>>> s = requests.Session()
>>> a = requests.adapters.HTTPAdapter(max_retries=3)
>>> s.mount('http://', a)
)max_retriesconfig_pool_connections
_pool_maxsize_pool_blockc B |t k rt dd | _ nt j | | _ i | _ i | _ t
t | || _ || _
|| _ | ||| d S )Nr F)readblock)
DEFAULT_RETRIESr rN from_intrO
proxy_managerr4 rM r5 rP rQ rR init_poolmanager)r6 pool_connectionspool_maxsizerN
pool_blockr7 s r- r5 zHTTPAdapter.__init__q s /))$QU333D$~k::D
k4 ))+++!1)%.JOOOOOr. c * fd j D S )Nc 4 i | ]}|t |d S r3 )getattr).0attrr6 s r-
z,HTTPAdapter.__getstate__..