1jV d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m Z mZmZm Z mZmZ d dlmZ d dlmZ d dlmZ ded efd Zedede d eeddf fd Z ed d ej Zded efdZded efdZdeded e e fdZded eeef fdZ ded efdZ!ded eeef fdZ"ded efdZ#dS ) N)contextmanager)NamedTemporaryFile)AnyBinaryIO GeneratorListUnioncast)get_path_uid)format_size)retrypathreturnc t j dk st t d sdS t j | sJ d }| |k rt j | r^t j dk r( t | }n# t $ r Y dS w xY w|dk S t j | t j S | t j | } }| |k dS )Nwin32geteuidTr F) sysplatformhasattrosr isabslexistsr r OSErroraccessW_OKdirname)r previouspath_uids p/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib/python3.11/site-packages/pip/_internal/utils/filesystem.pycheck_path_ownerr s |wgb)&<&<t 7==H ( 7??4 9z||q !+D11HH ! ! ! 55!1}$yrw///!27??4#8#8dH ( 5s B B&%B&kwargsc + K t ddt j | t j | dd|5 }t t | } |V | t j | n?# | t j | w xY w ddd dS # 1 swxY w Y dS )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 ) r r r r basenamer r flushfsyncfileno)r r! fresults r adjacent_tmp_filer. * s0 GOOD!!w%% & h"" &LLLLLNNNHV]]__%%%% LLNNNHV]]__%%%%%&