id ddlZddlZddlZddlZddlZddlmZddlmZddl m Z m Z m Z m Z mZmZddlmZmZmZddlmZddlmZded efd Zeded e d e e ddffd Zed ededZeejZded efdZded efdZdeded e efdZ ded ee!e"ffdZ#ded efdZ$ded ee!e"ffdZ%ded efdZ&dS)N)contextmanager)NamedTemporaryFile)AnyBinaryIO GeneratorListUnioncast)retrystop_after_delay wait_fixed) get_path_uid) format_sizepathreturnctjdksttdsdSd}||krtj|r^tjdkr( t|}n#t$rYdSwxYw|dkStj |tj S|tj |}}||kdS)Nwin32geteuidTrF) sysplatformhasattrosrlexistsrrOSErroraccessW_OKdirname)rpreviouspath_uids S/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/utils/filesystem.pycheck_path_ownerr!s |wgb)&<&<tH (   7??4 9z||q  !+D11HH!!! 55!1}$yrw///!27??4#8#8dH (   5s'A77 BBkwargsc+Ktddtj|tj|dd|5}t t |} |V|tj| n?#|tj| wxYw ddddS#1swxYwYdS)a%Return a file-like object pointing to a tmp file next to path. The file is created securely and is ensured to be written to disk after the context reaches its end. kwargs will be passed to tempfile.NamedTemporaryFile to control the way the temporary file will be opened. Fz.tmp)deletedirprefixsuffixN) rrrrbasenamer rflushfsyncfileno)rr"fresults r adjacent_tmp_filer/+s0   GOOD ! !w%%        & h"" &LLL LLNNN HV]]__ % % % % LLNNN HV]]__ % % % % % & & & & & & & & & & & & & & & & & &s*C1%B$);C1$>  gmmD!!  w'yrw''' !$ ' ''cd}dtdD]}|dfdtdDz}tj||} tj|tjtjztjz}tj|tj |dS#t$rYt$rYdSwxYwtd ) N(accesstest_deleteme_fishfingers_custard_$abcdefghijklmnopqrstuvwxyz0123456789 c3@K|]}tjVdSN)randomchoice).0_alphabets r z)_test_writable_dir_win..ds-!L!La&-"9"9!L!L!L!L!L!Lr;TFz3Unexpected condition testing for writable directory) rangejoinrropenO_RDWRO_CREATO_EXCLcloseunlinkFileExistsErrorPermissionErrorr)rr)rFr7filefdrGs @r r8r8^s:H5H 2YY"''!L!L!L!L588!L!L!LLLLw||D$'' ry2:5 ABBB HRLLL IdOOO44    D    555   G H HHs)9C  C' C'&C'patterncg}tj|D]<\}}tj||}|fd|D=|S)zReturns a list of absolute paths of files beneath path, recursively, with filenames which match the UNIX-style shell glob pattern.c3XK|]$}tj|V%dSrB)rrrK)rEr-roots r rHzfind_files..s3==bgll4++======r;)rwalkfnmatchfilterextend)rrVr.rFfilesmatchesrYs @r find_filesr`zsgF'$-->>a.00 ====W======= Mr;ctj|rdStj|S)Nr)rrislinkgetsizers r file_sizeres1 w~~dq 7??4  r;c:tt|SrB)rrerds r format_file_sizergs y ' ''r;cd}tj|D]=\}}}|D]4}tj||}|t |z }5>|S)Ng)rrZrrKre)rsizerY_dirsr^filename file_paths r directory_sizermsi D gdmm))eU ) )H T844I Ii(( (DD ) Kr;c:tt|SrB)rrmrds r format_directory_sizeros ~d++ , ,,r;)'r[ros.pathrCr contextlibrtempfilertypingrrrrr r pip._vendor.tenacityr r r pip._internal.utils.compatrpip._internal.utils.miscrstrboolr!r/_replace_retryreplacer:r8r`intfloatrergrmror(r;r r}s  %%%%%%''''''>>>>>>>>>>>>>>>>DDDDDDDDDD333333000000346&C&3&9XtT=Q3R&&&&2t*:*:1*=*=JJtDTDTUUU . $ $ (C(D(((($IIIIII8S349!C!E#u*-!!!!(3(3((((sEz!2--------r;