관리-도구
편집 파일: filesystem.cpython-37.pyc
B ��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-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/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�sdS tj�| �s(t�d }xp| |kr�tj�| �r�t�� dkrxyt | �}W n t k rn dS X |dkS t�| tj�S q.| tj� | � }} q.W 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 �| |� W nf ttfk rv xJ| |gD ]>}yt|�}W n tk rR Y q.X |r.t �djf 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"