✏️ 编辑:unpacking.cpython-39.pyc
路径:
/usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/unpacking.cpython-39.pyc
大小:6.64 KB · 修改:2026-05-23 08:59:54 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a �lj�# � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZm Z m Z ddlmZ ddlm Z ddlmZmZmZmZ ddlmZ e�e�Zee ZzddlZee7 ZW n ey� e�d� Y n0 zddlZee7 ZW n ey� e�d � Y n0 ed �dd�Zee e d �dd�Z ee e!d�dd�Z"eee!d�dd�Z#edd �dd�Z$ee!d�dd�Z%d%eee!dd�dd�Z&eedd�d d!�Z'd&eee e dd"�d#d$�Z(dS )'zUtilities related archives. � N)�Iterable�List�Optional)�ZipInfo)�InstallationError)�BZ2_EXTENSIONS�TAR_EXTENSIONS� XZ_EXTENSIONS�ZIP_EXTENSIONS)� ensure_dirzbz2 module is not availablezlzma module is not available)�returnc C s t �d�} t �| � | S )zBGet the current umask which involves having to set it temporarily.r )�os�umask)�mask� r �A/usr/lib/python3.9/site-packages/pip/_internal/utils/unpacking.py� current_umask+ s r )�pathr c C sh | � d�� d�} d| v rHd| v r4| �d�| �d�k s<d| vrH| �dd�S d| v r\| �dd�S | dgS d S )N�/�\� � )�lstrip�find�split�r r r r �split_leading_dir2 s ���r )�pathsr c C sD d}| D ]6}t |�\}}|s" dS |du r0|}q||kr dS qdS )zyReturns true if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive)NFT)r )r Z common_prefixr �prefix�restr r r �has_leading_dir>