/usr/lib/python3.9/site-packages/urllib3/util/__pycache__
NameSizeModeActions
connection.cpython-39.opt-1.pyc34010644editdlrm
connection.cpython-39.pyc34010644editdlrm
proxy.cpython-39.opt-1.pyc12970644editdlrm
proxy.cpython-39.pyc12970644editdlrm
queue.cpython-39.opt-1.pyc10160644editdlrm
queue.cpython-39.pyc10160644editdlrm
request.cpython-39.opt-1.pyc34040644editdlrm
request.cpython-39.pyc34040644editdlrm
response.cpython-39.opt-1.pyc23010644editdlrm
response.cpython-39.pyc23010644editdlrm
retry.cpython-39.opt-1.pyc159500644editdlrm
retry.cpython-39.pyc159500644editdlrm
ssltransport.cpython-39.opt-1.pyc74180644editdlrm
ssltransport.cpython-39.pyc74420644editdlrm
ssl_.cpython-39.opt-1.pyc112730644editdlrm
ssl_.cpython-39.pyc112730644editdlrm
timeout.cpython-39.opt-1.pyc88990644editdlrm
timeout.cpython-39.pyc88990644editdlrm
url.cpython-39.opt-1.pyc106000644editdlrm
url.cpython-39.pyc106000644editdlrm
wait.cpython-39.opt-1.pyc30840644editdlrm
wait.cpython-39.pyc30840644editdlrm
__init__.cpython-39.opt-1.pyc10610644editdlrm
__init__.cpython-39.pyc10610644editdlrm
Edit: /usr/lib/python3.9/site-packages/urllib3/util/__pycache__/retry.cpython-39.pyc (15950B)
a sz"Retry.__init__..)_Default ValueErrorrrrrr#totalconnectreadrotherredirectsetstatus_forcelistallowed_methodsbackoff_factorraise_on_redirectraise_on_statustuplehistoryrespect_retry_after_header frozensetremove_headers_on_redirect)selfr6r7r8r:rr9r=r<r>r?r@rBrCrEmethod_whitelistrrr__init__sD   zRetry.__init__cKst|j|j|j|j|j|j|j|j|j |j |j |j |j d }d|vrxd|vrxd|jvrntdt|j|d<n |j|d<||t|fi|S)N) r6r7r8r:rr9r<r>r?r@rBrErCrGr=r-)dictr6r7r8r:rr9r<r>r?r@rBrErC__dict__rrrr=updatetype)rFkwparamsrrrnew s2    z Retry.newcCsR|dur|dur|n|j}t|tr(|St|o2d}|||d}td|||S)z3Backwards-compatibility for the old retries format.N)r:z!Converted retries value: %r -> %r)DEFAULT isinstancer*boollogdebug)rZretriesr:defaultZ new_retriesrrrfrom_intDs   zRetry.from_intcCsFtttddt|j}|dkr(dS|jd|d}t|j|S)zIFormula for computing the current backoff :rtype: float cSs |jduS)N)r)xrrrZr3z(Retry.get_backoff_time..rr)lenlistrreversedrBr>min BACKOFF_MAX)rFZconsecutive_errors_lenZ backoff_valuerrrget_backoff_timeRszRetry.get_backoff_timecCstd|rt|}n`tj|}|dur6td||ddur^|ddd|dd}tj|}|t}|dkrd}|S)Nz^\s*[0-9]+\s*$zInvalid Retry-After header: %s )rr,r) rematchintemailZutilsZ parsedate_tzrZ mktime_tztime)rF retry_afterZsecondsZretry_date_tupleZ retry_daterrrparse_retry_aftercs       zRetry.parse_retry_aftercCs |d}|durdS||S)z(Get the value of Retry-After in seconds.z Retry-AfterN)Z getheaderrgrFresponserfrrrget_retry_afterzs zRetry.get_retry_aftercCs ||}|rt|dSdS)NTF)rjresleeprhrrrsleep_for_retrys   zRetry.sleep_for_retrycCs"|}|dkrdSt|dS)Nr)r_rerk)rFZbackoffrrr_sleep_backoffszRetry._sleep_backoffcCs(|jr|r||}|rdS|dS)aBSleep between retry attempts. This method will respect a server's ``Retry-After`` response header and sleep the duration of the time requested. If that is not present, it will use an exponential backoff. By default, the backoff factor is 0 and this method will return immediately. N)rCrlrm)rFriZsleptrrrrks  z Retry.sleepcCst|tr|j}t|tS)zzErrors when we're fairly sure that the server did not receive the request, so it should be safe to retry. )rQr Zoriginal_errorrrFerrrrr_is_connection_errors zRetry._is_connection_errorcCst|ttfS)zErrors that occur after the request has been started, so we should assume that the server began processing it. )rQr r rnrrr_is_read_errorszRetry._is_read_errorcCs<d|jvrtdt|j}n|j}|r8||vr8dSdS)zyChecks if a given HTTP method should be retried upon, depending if it is included in the allowed_methods rGr-FT)rJrrrrGr=upper)rFrr=rrr_is_method_retryables zRetry._is_method_retryableFcCs<||sdS|jr"||jvr"dS|jo:|jo:|o:||jvS)awIs this method/status code retryable? (Based on allowlists and control variables such as the number of total retries to allow, whether to respect the Retry-After header, whether this header is present, and whether the returned status code is on the list of status codes to be retried upon on the presence of the aforementioned header) FT)rsr<r6rCRETRY_AFTER_STATUS_CODES)rFr status_codeZhas_retry_afterrrris_retrys zRetry.is_retrycCs>|j|j|j|j|j|jf}ttd|}|s2dSt|dkS)zAre we out of retries?NFr) r6r7r8r:rr9r[filterr])rFZ retry_countsrrr is_exhaustedszRetry.is_exhaustedc Cs|jdur |r tt||||j}|dur6|d8}|j}|j} |j} |j} |j} d} d}d}|r| |r|durtt|||n|dur|d8}n|r| |r| dus| |stt|||n| dur| d8} n|r| dur| d8} nr|r.| r.| dur| d8} d} | }|j}ns,   $  &