/usr/lib/python3.9/site-packages/urllib3/__pycache__
NameSizeModeActions
connection.cpython-39.opt-1.pyc133270644editdlrm
connection.cpython-39.pyc133270644editdlrm
connectionpool.cpython-39.opt-1.pyc246710644editdlrm
connectionpool.cpython-39.pyc246710644editdlrm
exceptions.cpython-39.opt-1.pyc115980644editdlrm
exceptions.cpython-39.pyc115980644editdlrm
fields.cpython-39.opt-1.pyc81130644editdlrm
fields.cpython-39.pyc81130644editdlrm
filepost.cpython-39.opt-1.pyc27140644editdlrm
filepost.cpython-39.pyc27140644editdlrm
poolmanager.cpython-39.opt-1.pyc152330644editdlrm
poolmanager.cpython-39.pyc152330644editdlrm
request.cpython-39.opt-1.pyc55770644editdlrm
request.cpython-39.pyc55770644editdlrm
response.cpython-39.opt-1.pyc259890644editdlrm
response.cpython-39.pyc259890644editdlrm
_collections.cpython-39.opt-1.pyc112270644editdlrm
_collections.cpython-39.pyc112270644editdlrm
_version.cpython-39.opt-1.pyc1650644editdlrm
_version.cpython-39.pyc1650644editdlrm
__init__.cpython-39.opt-1.pyc21410644editdlrm
__init__.cpython-39.pyc21410644editdlrm
Edit: /usr/lib/python3.9/site-packages/urllib3/__pycache__/connectionpool.cpython-39.pyc (24671B)
a sZ>ddlrAr?r6r6r6r7r.=s  r.c @sºeZdZdZdZeZeZdde j dddddddf dd„Z dd „Z d!d d „Z d d „Zdd„Zdd„Zdd„Zdd„Zedfdd„Zdd„Zdd„Zdd„Zdddddeddddf dd „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 strict: Causes BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line, passed into :class:`http.client.HTTPConnection`. .. note:: Only works in Python 2. This parameter is ignored in Python 3. :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. ÚhttpNFrc KsÒt |||¡t ||¡||_t|tƒs4t |¡}|durBtj}||_ ||_ |  |¡|_ ||_ | |_| pli|_| |_t|ƒD]} |j  d¡q~d|_d|_| |_|jrÎ|j dg¡|j|jd<|j|jd<dS)NrZsocket_optionsÚproxyÚ proxy_config)r.r8r ÚstrictÚ isinstancer(Ú from_floatr'ZDEFAULTrÚretriesrFÚpoolÚblockrIÚ proxy_headersrJÚxrangeÚputÚnum_connectionsÚ num_requestsÚconn_kwÚ setdefault)r5r1r4rKrÚmaxsizerPÚheadersrNÚ_proxyÚ_proxy_headersZ _proxy_configrVÚ_r6r6r7r8©s.       zHTTPConnectionPool.__init__cCsR|jd7_t d|j|j|jp$d¡|jf|j|j|jj|jdœ|j ¤Ž}|S)z9 Return a fresh :class:`HTTPConnection`. rz(Starting new HTTP connection (%d): %s:%sZ80)r1r4rrK) rTÚlogÚdebugr1r4Ú ConnectionClsrÚconnect_timeoutrKrV©r5Úconnr6r6r7Ú _new_connßs üüûzHTTPConnectionPool._new_conncCsœd}z|jj|j|d�}Wn>ty6t|dƒ‚Yn$tjyX|jrTt|dƒ‚Yn0|r�t|ƒr�t   d|j ¡|  ¡t |ddƒdkr�d}|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``. N)rPrzPool is closed.z>Pool reached maximum size and no more connections are allowed.z Resetting dropped connection: %sZ auto_openrr)rOÚgetrPÚAttributeErrorrrÚEmptyrr"r]r^r1r?Úgetattrrc)r5rrbr6r6r7Ú _get_connôs$  þ zHTTPConnectionPool._get_conncCsZz|jj|dd�WdSty(Yn"tjyHt d|j¡Yn0|rV| ¡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. F©rPNz2Connection pool is full, discarding connection: %s) rOrSrerZFullr]Úwarningr1r?rar6r6r7Ú _put_conns zHTTPConnectionPool._put_conncCsdS)úU Called right before a request is made, after the socket is created. Nr6rar6r6r7Ú_validate_conn7sz!HTTPConnectionPool._validate_conncCsdSr=r6rar6r6r7Ú_prepare_proxy=sz!HTTPConnectionPool._prepare_proxycCs2|tur|j ¡St|tƒr$| ¡St |¡SdS)z:Helper that always returns a :class:`urllib3.util.Timeout`N)Ú_DefaultrZclonerLr(rM)r5rr6r6r7Ú _get_timeoutAs   zHTTPConnectionPool._get_timeoutcCsjt|tƒrt||d|ƒ‚t|dƒr>|jtvr>t||d|ƒ‚dt|ƒvsVdt|ƒvrft||d|ƒ‚dS)zAIs the error actually a timeout? Will raise a ReadTimeout or passú!Read timed out. (read timeout=%s)Úerrnoz timed outzdid not complete (read)N)rLÚ SocketTimeoutrÚhasattrrrÚ_blocking_errnosÚstr)r5ÚerrÚurlÚ timeout_valuer6r6r7Ú_raise_timeoutMs  ÿ ÿÿ ÿz!HTTPConnectionPool._raise_timeoutc Ks||jd7_| |¡}| ¡|j|_z| |¡Wn<ttfyr}z |j|||jd�‚WYd}~n d}~00z2|r�|j ||fi|¤Žn|j ||fi|¤ŽWnLt y¸Yn<t yò}z$|j t jt jt jhvrÞ‚WYd}~n d}~00|j} t|ddƒ�rL| dk�r"t||d| ƒ‚| tju�r@|j t ¡¡n |j | ¡zjz|jdd�} WnTt�y²z | ¡} Wn2t�y¬}zt |d¡WYd}~n d}~00Yn0Wn>tttf�yô}z|j||| d�‚WYd}~n d}~00t|d d ƒ} t  !d |j"|j#|j$||| | j%| j&¡ zt'| j(ƒWnBt)tf�yv} z$t j*d | +|¡| dd �WYd} ~ n d} ~ 00| S)a Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param timeout: Socket timeout in seconds for the request. This can be a float or integer, which will set the same timeout value for the socket connect and the socket read, or an instance of :class:`urllib3.util.Timeout`, which gives you more fine-grained control over your timeouts. r)rwrxryNÚsockrrqT)Ú bufferingZ _http_vsn_strzHTTP/?z%s://%s:%s "%s %s %s" %s %sz$Failed to parse headers (url=%s): %s)Úexc_info),rUrpZ start_connectr`rrmrsrrzZrequest_chunkedÚrequestrÚIOErrorrrZEPIPEZ ESHUTDOWNZ EPROTOTYPEÚ read_timeoutrgrr(ÚDEFAULT_TIMEOUTr{Z settimeoutÚsocketZgetdefaulttimeoutZ getresponseÚ TypeErrorÚ BaseExceptionrZ raise_fromÚ SocketErrorr]r^r0r1r4ÚstatusÚlengthr&ÚmsgrrjÚ _absolute_url) r5rbÚmethodrxrÚchunkedZhttplib_request_kwÚ timeout_objÚer€Úhttplib_responseZ http_versionZhper6r6r7Ú _make_requestfs€  ý  ÿ   , ÷ üz HTTPConnectionPool._make_requestcCst|j|j|j|d�jS)N)r0r1r4Úpath)r)r0r1r4rx)r5r�r6r6r7r‰Ýsz HTTPConnectionPool._absolute_urlcCsT|jdurdS|jd}|_z|jdd�}|r| ¡qWntjyNYn0dS)rBNFri)rOrdr?rrf)r5Zold_poolrbr6r6r7r?às  zHTTPConnectionPool.closecCsx| d¡rdSt|ƒ\}}}|dur0t||d�}|jrF|sFt |¡}n|js^|t |¡kr^d}|||f|j|j|jfkS)zj Check if the given ``url`` is a member of the same host as this connection pool. ú/TNr/)Ú startswithr,r+r4rrdr0r1)r5rxr0r1r4r6r6r7Ú is_same_hostòs    zHTTPConnectionPool.is_same_hostTc Ks”t|ƒ}|j}|dur|j}t|tƒs8tj|||jd�}| durL|  dd¡} |rf| |¡sft |||ƒ‚|  d¡r€t   t |ƒ¡}n t   |j¡}d}| }t|j|j|ƒ}|s¼| ¡}| |j¡d}d}t|| ƒ} �z¢z | |¡}|j| d�}|j|_|jdu�o t|ddƒ }|�r"|�r"| |¡|j||||||| d �}| �sD|nd}|| d <|jj|f|||d œ| ¤Ž}d}WnÔt�y�d}d}‚Yn¸t t!t"t#t$t%t&f�yF}z�d}t|t$t&fƒ�rÌt%|ƒ}n>t|t"t'fƒ�rð|j�rðt(d |ƒ}nt|t"t!fƒ�r t#d |ƒ}|j)||||t* +¡dd�}| ,¡|}WYd}~n d}~00W|�sb|�o\| -¡}d}|�rž| .|¡n*|�sŒ|�o†| -¡}d}|�rœ| .|¡0|�sÞt/ 0d|||¡|j1|||||||f|| | | | dœ| ¤ŽS|�oê| 2¡}|�ræ|j3dk�rd}d}t4|ƒ 5¡}|j6�rZ| |¡�sZ| ¡}|D]"}| 7¡|j6v�r2| 8|d¡�q2|}z|j)||||d�}Wn*t9�yš|j:�r’| ;¡‚|YS0| ;¡| <|¡t/ =d||¡|j1||||f||||| | | | dœ| ¤ŽSt>| ?d¡ƒ}| @||j3|¡�r�z|j)||||d�}Wn*t9�yF|jA�r>| ;¡‚|YS0| ;¡| ,|¡t/ =d|¡|j1||||f||||| | | | dœ| ¤ŽS|S)a+ 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 provided by :class:`.RequestMethods`, 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 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 ``response_kw.get('preload_content', True)``. :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 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. :param \**response_kw: Additional parameters are passed to :meth:`urllib3.response.HTTPResponse.from_httplib` N)ÚredirectÚdefaultZpreload_contentTr‘Frr{)rÚbodyrYr‹Zrequest_method)rOÚ connectionrNzCannot connect to proxy.zConnection aborted.é)rÚ_poolZ _stacktracez1Retrying (%r) after connection broken by '%r': %s)rÚ pool_timeoutÚ release_connr‹Úbody_posi/ZGET)Úresponser™zRedirecting %s -> %s)rNr”Úassert_same_hostrršr›r‹rœz Retry-Afterz Retry: %s)Br-r0rYrLr'Zfrom_intrNrdr“rr’rZ ensure_strr*rxr#rIrJÚcopyÚupdaterQr%rprhr`rrgrnr�Ú ResponseClsZ from_httplibrrr r…rrrrrrZ incrementÚsysr}Úsleepr?rkr]rjÚurlopenZget_redirect_locationr†rZ_prepare_for_method_changeZremove_headers_on_redirectr2ÚpoprZraise_on_redirectZ drain_connZsleep_for_retryr^ÚboolZ getheaderZis_retryZraise_on_status)r5rŠrxr–rYrNr”ržrršr›r‹rœZ response_kwZ parsed_urlZdestination_schemerbZrelease_this_connZhttp_tunnel_requiredrwZ clean_exitrŒZis_new_proxy_connrŽZ response_connr�r�Zredirect_locationZ new_headersÚheaderZhas_retry_afterr6r6r7r¤sjm       ÿ    ÿ  ùÿüû ù    ÿ ô ÿùô ó   ÿ  üô ó   üô ózHTTPConnectionPool.urlopen)N)r:rCrDrEr0r r_r!r¡r(r�r8rcrhrkrmrnrprzror�r‰r?r“r¤r6r6r6r7rGisL;ô 6 ' ÿ wórGcspeZdZdZdZeZddejdddddddddddddddfdd„Z dd „Z d d „Z d d „Z ‡fdd„Z ‡ZS)Ú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. ÚhttpsNFrc Ks`tj|||||||||| | f i|¤Ž| |_| |_| |_||_||_||_||_||_ ||_ dSr=) rGr8Úkey_fileÚ cert_fileÚ cert_reqsÚ key_passwordÚca_certsÚ ca_cert_dirÚ ssl_versionÚassert_hostnameÚassert_fingerprint)r5r1r4rKrrXrPrYrNrZr[rªr«r¬r­r®r°r±r²r¯rVr6r6r7r8ƒs0õ ôzHTTPSConnectionPool.__init__c Cs@t|tƒr<|j|j|j|j|j|j|j|j |j d�|j |_ |S)zˆ Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket` and establish the tunnel if proxy is used. )rªr­r«r¬r®r¯r±r²) rLr Zset_certrªr­r«r¬r®r¯r±r²r°rar6r6r7Ú _prepare_conn´s ø z!HTTPSConnectionPool._prepare_conncCs2| |j|j|j¡|jjdkr&d|_| ¡dS)zÏ Establishes a tunnel connection through HTTP CONNECT. Tunnel connection is established early because otherwise httplib would improperly set Host: header to proxy's IP:port. r©TN)Z set_tunnelr3r4rQrIr0Ztls_in_tls_requiredÚconnectrar6r6r7rnÈs z"HTTPSConnectionPool._prepare_proxyc Csž|jd7_t d|j|j|jp$d¡|jr8|jtur@tdƒ‚|j}|j}|jdurf|jj}|jj}|jf|||j j |j |j |j |jdœ|j¤Ž}| |¡S)zF Return a fresh :class:`http.client.HTTPSConnection`. rz)Starting new HTTPS connection (%d): %s:%sZ443zCCan't connect to HTTPS URL because the SSL module is not available.N)r1r4rrKr«rªr­)rTr]r^r1r4r_r rrIrr`rKr«rªr­rVr³)r5Z actual_hostZ actual_portrbr6r6r7rc×s8üÿ ùø zHTTPSConnectionPool._new_conncs@tt|ƒ |¡t|ddƒs$| ¡|js>> conn = connection_from_url('http://google.com/') >>> r = conn.request('GET', '/') éPr©r4N)r,rrdr¨rG)rxÚkwr0r1r4r6r6r7Úconnection_from_urls r½cCs.t||ƒ}| d¡r*| d¡r*|dd…}|S)z? Normalize hosts for comparisons and use with sockets. ú[ú]réÿÿÿÿ)Únormalize_hostr’Úendswith)r1r0r6r6r7r+-s  r+)QZ __future__rrrZloggingr‚r¢r¶rr…rrsr—rrr r r r r rÚ exceptionsrrrrrrrrrrrrrZpackagesrZpackages.six.movesrZpackages.ssl_match_hostnamerÚ _collectionsrr~r r�r!Zutil.connectionr"Z util.proxyr#Z util.queuer$Z util.requestr%Z util.responser&Z util.retryr'Z util.timeoutr(Zutil.urlr)r*r+rÁr,r-ZmovesrRZ getLoggerr:r]Úobjectror.ZEAGAINZ EWOULDBLOCKrurGr¨r½r6r6r6r7ÚsR   ( <               )