2biU8SSKJr SSKrSSKrSSKrSSKrSSKrSSKJr SSK J r SSK J r J r JrJrJrJrJr SSKJr \R*"\5r\"S/S Q5r\"5r"S S \5r\R:"\5"S S \55r\"S5\lg))absolute_importN) namedtuple) takewhile)ConnectTimeoutError InvalidHeader MaxRetryError ProtocolError ProxyErrorReadTimeoutError ResponseError)sixRequestHistory)methodurlerrorstatusredirect_locationc\rSrSr\S5r\R S5r\S5r\R S5r\S5r\R S5rSr g ) _RetryMeta#cP[R"S[5 UR$Nz}Using 'Retry.DEFAULT_METHOD_WHITELIST' is deprecated and will be removed in v2.0. Use 'Retry.DEFAULT_ALLOWED_METHODS' insteadwarningswarnDeprecationWarningDEFAULT_ALLOWED_METHODSclss ڐ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/urllib3/util/retry.pyDEFAULT_METHOD_WHITELIST#_RetryMeta.DEFAULT_METHOD_WHITELIST$s%  S  ***cF[R"S[5 Xlgrrr values r!r"r#-s  S  ',#r$cP[R"S[5 UR$NzUsing 'Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST' is deprecated and will be removed in v2.0. Use 'Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT' insteadrrr"DEFAULT_REMOVE_HEADERS_ON_REDIRECTrs r!"DEFAULT_REDIRECT_HEADERS_BLACKLIST-_RetryMeta.DEFAULT_REDIRECT_HEADERS_BLACKLIST6s%  ^  555r$cF[R"S[5 Xlgr)r*r&s r!r,r-?s  ^  27.r$cP[R"S[5 UR$NzlUsing 'Retry.BACKOFF_MAX' is deprecated and will be removed in v2.0. Use 'Retry.DEFAULT_BACKOFF_MAX' insteadrrrDEFAULT_BACKOFF_MAXrs r! BACKOFF_MAX_RetryMeta.BACKOFF_MAXHs%  O  &&&r$cF[R"S[5 Xlgr0r1r&s r!r3r4Qs  O  #(r$N) __name__ __module__ __qualname____firstlineno__propertyr"setterr,r3__static_attributes__r6r$r!rr#s ++$$,%,66(..7/7''((r$rc^\rSrSrSr\"/SQ5r\"/SQ5r\"SS/5rSr SS S S S S \ S S S S S S \ \ 4S jr S r \ SSj5rSrSrSrSSjrSrSSjrSrSrSrS SjrSrS!SjrSrU4SjrSrU=r$)"Retry[aRetry configuration. Each retry attempt will create a new Retry object with updated values, so they can be safely reused. Retries can be defined as a default for a pool:: retries = Retry(connect=5, read=2, redirect=5) http = PoolManager(retries=retries) response = http.request('GET', 'http://example.com/') Or per-request (which overrides the default for the pool):: response = http.request('GET', 'http://example.com/', retries=Retry(10)) Retries can be disabled by passing ``False``:: response = http.request('GET', 'http://example.com/', retries=False) Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless retries are disabled, in which case the causing exception will be raised. :param int total: Total number of retries to allow. Takes precedence over other counts. Set to ``None`` to remove this constraint and fall back on other counts. Set to ``0`` to fail on the first retry. Set to ``False`` to disable and imply ``raise_on_redirect=False``. :param int connect: How many connection-related errors to retry on. These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request. Set to ``0`` to fail on the first retry of this type. :param int read: How many times to retry on read errors. These errors are raised after the request was sent to the server, so the request may have side-effects. Set to ``0`` to fail on the first retry of this type. :param int redirect: How many redirects to perform. Limit this to avoid infinite redirect loops. A redirect is a HTTP response with a status code 301, 302, 303, 307 or 308. Set to ``0`` to fail on the first retry of this type. Set to ``False`` to disable and imply ``raise_on_redirect=False``. :param int status: How many times to retry on bad status codes. These are retries made on responses, where status code matches ``status_forcelist``. Set to ``0`` to fail on the first retry of this type. :param int other: How many times to retry on other errors. Other errors are errors that are not connect, read, redirect or status errors. These errors might be raised after the request was sent to the server, so the request might have side-effects. Set to ``0`` to fail on the first retry of this type. If ``total`` is not set, it's a good idea to set this to 0 to account for unexpected edge cases and avoid infinite retry loops. :param iterable allowed_methods: Set of uppercased HTTP method verbs that we should retry on. By default, we only retry on methods which are considered to be idempotent (multiple requests with the same parameters end with the same state). See :attr:`Retry.DEFAULT_ALLOWED_METHODS`. Set to a ``False`` value to retry on any verb. .. warning:: Previously this parameter was named ``method_whitelist``, that usage is deprecated in v1.26.0 and will be removed in v2.0. :param iterable status_forcelist: A set of integer HTTP status codes that we should force a retry on. A retry is initiated if the request method is in ``allowed_methods`` and the response status code is in ``status_forcelist``. By default, this is disabled with ``None``. :param float backoff_factor: A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). urllib3 will sleep for:: {backoff factor} * (2 ** ({number of total retries} - 1)) seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer than :attr:`Retry.DEFAULT_BACKOFF_MAX`. By default, backoff is disabled (set to 0). :param bool raise_on_redirect: Whether, if the number of redirects is exhausted, to raise a MaxRetryError, or to return a response with a response code in the 3xx range. :param bool raise_on_status: Similar meaning to ``raise_on_redirect``: whether we should raise an exception, or return a response, if status falls in ``status_forcelist`` range and retries have been exhausted. :param tuple history: The history of the request encountered during each call to :meth:`~Retry.increment`. The list is in the order the requests occurred. Each list item is of class :class:`RequestHistory`. :param bool respect_retry_after_header: Whether to respect Retry-After header on status codes defined as :attr:`Retry.RETRY_AFTER_STATUS_CODES` or not. :param iterable remove_headers_on_redirect: Sequence of headers to remove from the request when a response indicating a redirect is returned before firing off the redirected request. )HEADGETPUTDELETEOPTIONSTRACE)iiiCookie Authorizationx NrTc2U[La0U[La [S5e[R"S[SS9 UnU[La UR nU[La UR nXlX lX0l XPl X`l USLdUSLaSnSn X@l U=(d [5UlXplXlXlXlU =(d ['5UlXl[-UVs/sHnUR/5PM sn5Ulgs snf)NzoUsing both 'allowed_methods' and 'method_whitelist' together is not allowed. Instead only use 'allowed_methods'lUsing 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' insteadr) stacklevelFr)_Default ValueErrorrrrrr+totalconnectreadrotherredirectsetstatus_forcelistallowed_methodsbackoff_factorraise_on_redirectraise_on_statustuplehistoryrespect_retry_after_header frozensetlowerremove_headers_on_redirect)selfrPrQrRrTrrSrWrVrXrYrZr\r]r`method_whitelisths r!__init__Retry.__init__s ( 8 +h. 9 MMI"   /O h &"::O % 1)-)P)P &     u H %  0 9CE.,!2.)%' *D'*3 : ; :1QWWY : ;+ ' ;s-Dc [URURURURUR UR URURURURURURURS9 nSU;aPSU;aJSUR;a+[R "S["5 UR$US'OUR$US'UR'U5 [)U5"S0UD6$)N) rPrQrRrTrrSrVrXrYrZr\r`r]rbrWrLr6)dictrPrQrRrTrrSrVrXrYrZr\r`r]__dict__rrrrWupdatetype)rakwparamss r!new Retry.new0s**LL]];;**!22.."44 00LL'+'F'F'+'F'F * R ',=R,G!T]]2 M& .2-A-A)*,0,@,@() bDz#F##r$cUcUbUO URn[U[5(aU$[U5=(a SnU"XS9n[R SX5 U$)z3Backwards-compatibility for the old retries format.N)rTz!Converted retries value: %r -> %r)DEFAULT isinstancer?boollogdebug)r retriesrTdefault new_retriess r!from_intRetry.from_intTsX ?!(!4g#++G gu % %N>*d'5  5wLr$c [[[S[UR5555nUS::agUR SUS- --n[ URU5$)z9Formula for computing the current backoff :rtype: float cURSL$N)r)xs r!(Retry.get_backoff_time..jsA$7$74$?r$rr)lenlistrreversedr\rXminr2)raconsecutive_errors_len backoff_values r!get_backoff_timeRetry.get_backoff_timebsf "% ?$,,AWX "  "Q &++q5Ka5O/PQ 4++];;r$c\[R"SU5(a [U5nO{[RR U5nUc[ SU-5eUScUSSS-USS-n[RRU5nU[R"5- nUS:aSnU$)Nz^\s*[0-9]+\s*$zInvalid Retry-After header: %s )rrJr) rematchintemailutils parsedate_tzr mktime_tztime)ra retry_aftersecondsretry_date_tuple retry_dates r!parse_retry_afterRetry.parse_retry_afterss 88%{ 3 3+&G${{77 D '#$D{$RSS"* $4BQ#7$#>AQRTRUAV#V ../?@J 499;.G Q;Gr$cbURRS5nUcgURU5$)z(Get the value of Retry-After in seconds.z Retry-AfterN)headersgetrraresponsers r!get_retry_afterRetry.get_retry_afters4&&**=9  %%k22r$cbURU5nU(a[R"U5 gg)NTF)rrsleeprs r!sleep_for_retryRetry.sleep_for_retrys'**84  JJ{ #r$c^UR5nUS::ag[R"U5 g)Nr)rrr)rabackoffs r!_sleep_backoffRetry._sleep_backoffs&'') a<  7r$cUR(a U(aURU5nU(agUR5 g)aSleep 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)r]rr)rarslepts r!r Retry.sleeps1  * *x((2E r$cd[U[5(a URn[U[5$)zjErrors when we're fairly sure that the server did not receive the request, so it should be safe to retry. )rqr original_errorrraerrs r!_is_connection_errorRetry._is_connection_errors* c: & &$$C#233r$c.[U[[45$)zoErrors that occur after the request has been started, so we should assume that the server began processing it. )rqr r rs r!_is_read_errorRetry._is_read_errors# 0-@AAr$cSUR;a([R"S[5 URnO UR nU(aUR 5U;agg)ziChecks if a given HTTP method should be retried upon, depending if it is included in the allowed_methods rbrLFT)rhrrrrbrWupper)rarrWs r!_is_method_retryableRetry._is_method_retryablesS  . MMI"  #33O"22O v||~_Dr$cURU5(dgUR(aX R;agUR=(a* UR=(a U=(a X R;$)aOIs 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)rrVrPr]RETRY_AFTER_STATUS_CODES)rar status_codehas_retry_afters r!is_retryRetry.is_retrysf((00  [4I4I%I JJ ?// ? ? = ==  r$cURURURURURUR 4n[ [SU55nU(dg[U5S:$)zAre we out of retries?NFr) rPrQrRrTrrSrfilterr)ra retry_countss r! is_exhaustedRetry.is_exhausteds^ JJ LL II MM KK JJ  F467 < 1$$r$c URSLa'U(a [R"[U5XF5eURnUbUS-nURnUR n UR n URn URn Sn SnSnU(aEURU5(a/USLa [R"[U5XF5eUbUS-nGOU(aZURU5(aDU SLdURU5(d [R"[U5XF5eU bU S-n OU(a U bU S-n OU(a<UR5(a'U bU S-n Sn UR5nURnOc[Rn U(aLUR(a;U bU S-n [RR!URS9n URnUR"[%XXNU54-nUR'UUU U U U US9nUR)5(a[+XRU=(d [U 55e[,R/SUU5 U$) ahReturn a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.HTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. FNrunknownztoo many redirects)r)rPrQrRrTrrSr\z$Incremented Retry for (url='%s'): %r)rPrreraiserjrQrRrTrrSrrrget_redirect_locationr GENERIC_ERRORSPECIFIC_ERRORformatr\rrmrr rsrt)rarrrr_pool _stacktracerPrQrRrT status_countrScauserrr\ new_retrys r! incrementRetry.increments0& :: 5++d5k5> >    QJE,,yy=={{    T..u55%kk$u+uBB$1  t**511u}D$=$=f$E$Ekk$u+uBB!     (88::#A (E ( > > @ __F "//EHOO+ A%L%44;;;X!,, 67H I"  HH   ! ! # #E,I]55IJ J 8#yIr$c4SR[U5US9$)Nz|{cls.__name__}(total={self.total}, connect={self.connect}, read={self.read}, redirect={self.redirect}, status={self.status}))r ra)rrj)ras r!__repr__Retry.__repr__Vs P &T$Zd& + ,r$c>US:Xa'[R"S[5 UR$[ [ [ U5U5$![a [ [ U5s$f=f)NrbrL)rrrrWgetattrsuperr?AttributeError)raitem __class__s r! __getattr__Retry.__getattr__\sd % % MMI"  '' ' (5-t4 4 (5$' ' (sA A'&A')rWrXrQr\rSrYrZrRrTr`r]rrVrP)TNr|)F)NNNNNN)r7r8r9r:__doc__r^rrr+r2rNrdrm classmethodrxrrrrrrrrrrrrrrr= __classcell__)rs@r!r?r?[sFR(< )9*3Ho3N)O&  #'#+!#; z"$H  <".3  4B ( (%$ \|, ( (r$r?) __future__rrloggingrrr collectionsr itertoolsr exceptionsrrr r r r r packagesr getLoggerr7rsrobjectrNrjr add_metaclassr?rpr6r$r!rs&  " !O 85(5(p:L(FL(L(`a r$