관리-도구
편집 파일: filesystem.cpython-36.pyc
3 �Re � @ sR d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm Z d dl mZ d dlm Z d dlmZ d dlmZ d dlmZ d dlmZmZ er�d d lmZmZmZmZmZ G d d� de�Zdd � Zdd� Zdd� Z e dd� �Z!e ddd�Z"e�re"dd� �Z#n e"ej#�Z#dd� Z$dd� Z%dd� Z&dd � Z'd!d"� Z(d#d$� Z)d%d&� Z*dS )'� N)�contextmanager)�NamedTemporaryFile)�retry)�PY2)�get_path_uid)�format_size)�MYPY_CHECK_RUNNING�cast)�Any�BinaryIO�Iterator�List�Unionc @ s e Zd Zedd� �ZdS )�NamedTemporaryFileResultc C s d S )N� )�selfr r ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/filesystem.py�file s zNamedTemporaryFileResult.fileN)�__name__� __module__�__qualname__�propertyr r r r r r s r c C s� t jdksttd� rdS tjj| �s*t�d }xp| |kr�tjj| �r�tj� dkrzyt | �}W n t k rp dS X |dkS tj| tj�S q0| tjj | � }} q0W dS )N�win32�geteuidTr F)�sys�platform�hasattr�os�path�isabs�AssertionError�lexistsr r �OSError�access�W_OK�dirname)r �previous�path_uidr r r �check_path_owner s r( c C s| yt j| |� W nf ttfk rv xJ| |gD ]>}yt|�}W n tk rR Y q.X |r.t jdjf t� ���q.W � Y nX dS )z�Wrap shutil.copy2() but map errors copying socket files to SpecialFileError as expected. See also https://bugs.python.org/issue37700. z`{f}` is a socketN)�shutil�copy2r"