2bi_SrSSKrSSKJr SSKJr SSKJrJrJrJ r SSK J r SSK J r SSKJr SS KJrJr SS KJr S \S \4S jr\S \S4Sj5r"SS\ 5rg)zHTTP cache implementation. N)contextmanager)datetime)BinaryIO GeneratorOptionalUnion)SeparateBodyBaseCache)SeparateBodyFileCache)Response)adjacent_tmp_filereplace) ensure_dirresponsereturnc[USS5$)N from_cacheF)getattr)rs ڍ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/network/cache.py is_from_cachers 8\5 11)NNNc#6# Sv g![a gf=f7f)znIf we can't access the cache then we can just skip caching and process requests as if caching wasn't enabled. N)OSErrorrrsuppressed_cache_errorsrs      s  c ^\rSrSrSrS\SS4U4SjjrS\S\4SjrS \S\\ 4S jr S \S \ SS4S jr SS \S\ S\ \ \S4SS4SjjrS \SS4SjrS \S\\4SjrS \S\ SS4SjrSrU=r$) SafeFileCache a A file based cache which is safe to use even when the target directory may not be accessible or writable. There is a race condition when two processes try to write and/or read the same entry at the same time, since each entry consists of two separate files (https://github.com/psf/cachecontrol/issues/324). We therefore have additional logic that makes sure that both files to be present before returning an entry; this fixes the read side of the race condition. For the write side, we assume that the server will only ever return the same data for the same URL, which ought to be the case for files pip is downloading. PyPI does not have a mechanism to swap out a wheel for another wheel, for example. If this assumption is not true, the CacheControl issue will need to be fixed. directoryrNcB>UcS5e[TU]5 Xlg)Nz!Cache directory must not be None.)super__init__r)selfr __class__s rr!SafeFileCache.__init__2s%$I&II$ "rnamec[R"U5n[USS5U/-n[RR "UR /UQ76$)N)r encodelistospathjoinr)r"r%hashedpartss r_get_cache_pathSafeFileCache._get_cache_path7sG'--d3VBQZ F8+ww||DNN3U33rkeycURU5nUS-n[RRU5(a$[RRU5(dg[ 5 [ US5nUR 5sSSS5 sSSS5 $!,(df  O=fSSS5 g!,(df  g=fN.bodyrb)r/r*r+existsropenread)r"r1 metadata_path body_pathfs rgetSafeFileCache.get?s,,S1 !G+ }--"''..2K2K $ &mT*avvx+*' &***' & &s$* B57B B5 B( $B55 Cr+datac4[5 [[RR U55 [ U5nUR U5 SSS5 [WRU5 SSS5 g!,(df  N-=f!,(df  g=fN) rrr*r+dirnamer writer r%)r"r+r>r;s r_writeSafeFileCache._writeIsa $ & rwwt, -"4(A ) AFFD ! ' &)(' &s"4B A8B 8 B B  BvalueexpirescHURU5nURXB5 gr@r/rC)r"r1rErFr+s rsetSafeFileCache.setRs ##C( D rcURU5n[5 [R"U5 SSS5 [5 [R"US-5 SSS5 g!,(df  N;=f!,(df  g=fNr4)r/rr*remove)r"r1r+s rdeleteSafeFileCache.deleteXsV##C( $ & IIdO' $ & IIdWn %' &' & & &sA(A9( A69 Bc"URU5nUS-n[RRU5(a$[RRU5(dg[ 5 [ US5sSSS5 $!,(df  g=fr3)r/r*r+r6rr7)r"r1r9r:s rget_bodySafeFileCache.get_body_s`,,S1 !G+ }--"''..2K2K $ & 4(' & &s * B BbodycNURU5S-nURX25 grLrH)r"r1rSr+s rset_bodySafeFileCache.set_bodyhs###C(72 Dr)rr@)__name__ __module__ __qualname____firstlineno____doc__strr!r/rbytesr<rCrintrrIrNrrQrU__static_attributes__ __classcell__)r#s@rrr s"###$# 4C4C4 s x "3"e""MQ!!$!/4S(D5H/I! ! &#&$&)C)HX$6) C u   rr)r[r* contextlibrrtypingrrrrpip._vendor.cachecontrol.cacher pip._vendor.cachecontrol.cachesr pip._vendor.requests.modelsr pip._internal.utils.filesystemr r pip._internal.utils.miscrboolrrrrrrrism %77@A0E/2H22 +;!<  J )J r