403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.6/site-packages/pip/_internal/utils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.6/site-packages/pip/_internal/utils/__pycache__/unpacking.cpython-36.pyc
3

�N�a�"�@s�dZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZddlm
Z
ddlmZmZmZmZddlmZeje�ZeeZyddlZee7ZWnek
r�ejd�YnXyddlZee7ZWnek
r�ejd	�YnXed
�dd�Zee	ed
�dd�Z eee!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
edd"�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)�returncCstjd�}tj|�|S)zBGet the current umask which involves having to set it temporarily.r)�os�umask)�mask�r�/usr/lib/python3.6/unpacking.py�
current_umask+s

r)�pathrcCsh|jd�jd�}d|krHd|kr4|jd�|jd�ks<d|krH|jdd�Sd|kr\|jdd�S|dgSdS)N�/�\��)�lstrip�find�split)rrrr�split_leading_dir2s$r)�pathsrcCsDd}x:|D]2}t|�\}}|s"dS|dkr0|}q
||kr
dSq
WdS)zyReturns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)NFT)r)rZ
common_prefixr�prefix�restrrr�has_leading_dir>s
r)�	directory�targetrcCs0tjj|�}tjj|�}tjj||g�}||kS)zL
    Return true if the absolute path of target is within the directory
    )r
r�abspath�commonprefix)r r!Z
abs_directoryZ
abs_targetrrrr�is_within_directoryMsr$cCstj|dt�@dB�dS)zx
    Make file present at path have execute for user/group/world
    (chmod +x) is no-op on windows per python docs
    i��IN)r
�chmodr)rrrr�2set_extracted_file_to_default_mode_plus_executableXsr')�inforcCs$|jd?}t|o tj|�o |d@�S)N�r%)Z
external_attr�bool�stat�S_ISREG)r(�moderrr�zip_item_is_executable`s
r.T)�filename�location�flattenrc
Cst|�t|d�}z�tj|dd�}t|j��o0|}x�|j�D]�}|j}|}|rZt|�d}t	j
j||�}t	j
j|�}	t
||�s�d}
t|
j|||���|jd�s�|jd�r�t|�q<t|	�|j|�}z&t|d��}tj||�Wd	QRXWd	|j�t|��rt|�Xq<WWd	|j�Xd	S)
a�
    Unzip the file (with path `filename`) to the destination `location`.  All
    files are written based on system defaults and umask (i.e. permissions are
    not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written. Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    �rbT)Z
allowZip64rzQThe zip file ({}) has a file ({}) trying to install outside target directory ({})rr�wbN)r�open�zipfileZZipFilerZnamelistZinfolistr/rr
r�join�dirnamer$r�format�endswith�shutil�copyfileobj�closer.r')
r/r0r1Zzipfp�zip�leadingr(�name�fn�dir�message�fp�destfprrr�
unzip_filegs4	




rE)r/r0rcCs(t|�|j�jd�s$|j�jd�r*d}nL|j�jt�r>d}n8|j�jt�rRd}n$|j�jd�rfd}ntjd|�d	}tj||d
d�}�z�t	dd
�|j
�D��}�xr|j
�D�]d}|j}|r�t|�d}t
jj||�}t||�s�d}t|j|||���|j��r
t|�q�|j��r`y|j||�Wn8tk
�r\}	ztjd||j|	�w�WYdd}	~	XnXq�y|j|�}
Wn<ttfk
�r�}	ztjd||j|	�w�WYdd}	~	XnXtt
jj|��|
dk	�s�t�t|d��}tj|
|�WdQRX|
j�|j||�|j d@r�t!|�q�WWd|j�XdS)a�
    Untar the file (with path `filename`) to the destination `location`.
    All files are written based on system defaults and umask (i.e. permissions
    are not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written.  Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    z.gzz.tgzzr:gzzr:bz2zr:xzz.tar�rz-Cannot determine compression type for file %szr:*zutf-8)�encodingcSsg|]
}|j�qSr)r?)�.0�memberrrr�
<listcomp>�szuntar_file.<locals>.<listcomp>rzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNr3r%)"r�lowerr9rr	�loggerZwarning�tarfiler4rZ
getmembersr?rr
rr6r$rr8�isdirZissymZ_extract_member�	ExceptionZextractfile�KeyError�AttributeErrorr7�AssertionErrorr:r;r<�utimer-r')r/r0r-Ztarr>rIr@rrB�excrCrDrrr�
untar_file�sl	




rU)r/r0�content_typercCs�tjj|�}|dks,|j�jt�s,tj|�rDt|||jd�d�nR|dkslt	j
|�sl|j�jttt
�rxt||�ntjd|||�td|����dS)Nzapplication/zipz.whl)r1zapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of )r
r�realpathrKr9r
r5Z
is_zipfilerErMZ
is_tarfilerrr	rUrLZcriticalr)r/r0rVrrr�unpack_file�s

rX)T)N))�__doc__Zloggingr
r:r+rMr5ZtypingrrrrZpip._internal.exceptionsrZpip._internal.utils.filetypesrrr	r
Zpip._internal.utils.miscrZ	getLogger�__name__rLZSUPPORTED_EXTENSIONS�bz2�ImportError�debugZlzma�intr�strrr*rr$r'r.rErUrXrrrr�<module>sB
.T

Youez - 2016 - github.com/yon3zu
LinuXploit