403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/pip/_internal/network/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc
�

T8�h�����dZddlmZddlZddlZddlmZddlmZddl	m	Z	ddl
mZmZm
Z
ddlmZdd	lmZdd
lmZddlmZmZddlmZdd
�Zedd��ZGd�de�Zy)zHTTP cache implementation.�)�annotationsN)�	Generator)�contextmanager)�datetime)�Any�BinaryIO�Callable)�SeparateBodyBaseCache)�SeparateBodyFileCache)�Response)�adjacent_tmp_file�replace)�
ensure_dirc��t|dd�S)N�
from_cacheF)�getattr)�responses �=C:\Python312\Lib\site-packages\pip/_internal/network/cache.py�
is_from_cachers���8�\�5�1�1�c#�4K�	d��y#t$rYywxYw�w)zvIf we can't access the cache then we can just skip caching and process
    requests as if caching wasn't enabled.
    N)�OSError�rr�suppressed_cache_errorsrs����

�
���
��
�s��	��	���c���eZdZdZd
�fd�Zdd�Zdd�Zdd�Zdd�Zdd�Z		d							dd�Z
dd	�Zdd
�Zdd�Z
dd�Z�xZS)�
SafeFileCacheaG
    A file based cache which is safe to use even when the target directory may
    not be accessible or writable.

    There is a race condition when two processes try to write and/or read the
    same entry at the same time, since each entry consists of two separate
    files (https://github.com/psf/cachecontrol/issues/324).  We therefore have
    additional logic that makes sure that both files to be present before
    returning an entry; this fixes the read side of the race condition.

    For the write side, we assume that the server will only ever return the
    same data for the same URL, which ought to be the case for files pip is
    downloading.  PyPI does not have a mechanism to swap out a wheel for
    another wheel, for example.  If this assumption is not true, the
    CacheControl issue will need to be fixed.
    c�B��|�Jd��t�|��||_y)Nz!Cache directory must not be None.)�super�__init__�	directory)�selfr �	__class__s  �rrzSafeFileCache.__init__5s'����$�I�&I�I�$�
����"��rc��tj|�}t|dd�|gz}tjj
|jg|���S)N�)r�encode�list�os�path�joinr )r!�name�hashed�partss    r�_get_cache_pathzSafeFileCache._get_cache_path:sG��'�-�-�d�3���V�B�Q�Z� �F�8�+���w�w�|�|�D�N�N�3�U�3�3rc�d�|j|�}|dz}tjj|�rtjj|�syt	�5t|d�5}|j
�cddd�cddd�S#1swYnxYw	ddd�y#1swYyxYw�N�.body�rb)r-r'r(�existsr�open�read)r!�key�
metadata_path�	body_path�fs     r�getzSafeFileCache.getBs����,�,�S�1�
�!�G�+�	������}�-�"�'�'�.�.��2K��
$�
&��m�T�*�a��v�v�x�
 �
 �	 �	 �*�*��*�'�
&�
&�s$� 
B&�-B�=	B&�B	�B&�&B/c�z�t�5ttjj	|��t|�5}||�tj|j�jdzdz}tjtjvr%tj|j�|�nBtjtjvr"tj|j|d��ddd�tj|�ddd�y#1swY�(xYw#1swYyxYw)zICommon file writing logic with proper permissions and atomic replacement.i�i�F)�follow_symlinksN)rrr'r(�dirnamer
�statr �st_mode�chmod�supports_fd�fileno�supports_follow_symlinksr*r)r!r(�writer_funcr8�modes     r�_write_to_filezSafeFileCache._write_to_fileLs���
$�
&��r�w�w���t�,�-�"�4�(�A��A���G�G�D�N�N�+�3�3�������8�8�r�~�~�-��H�H�Q�X�X�Z��.��X�X��!<�!<�<��H�H�Q�V�V�T�5�A�)�
�A�F�F�D�!�%'�
&�)�(��'�
&�s#�4D1�B?D%�>D1�%D.	�*D1�1D:c�0��|j|�fd��y)Nc�&��|j��S�N)�write)r8�datas �r�<lambda>z&SafeFileCache._write.<locals>.<lambda>cs
���A�G�G�D�Mr�rE)r!r(rJs  `r�_writezSafeFileCache._writebs������D�"9�:rc�0��|j|�fd��y)Nc�0��tj�|�SrH)�shutil�copyfileobj)r8�source_files �rrKz.SafeFileCache._write_from_io.<locals>.<lambda>fs���F�,>�,>�{�A�,NrrL)r!r(rRs  `r�_write_from_iozSafeFileCache._write_from_ioes������D�"N�Orc�J�|j|�}|j||�yrH�r-rM)r!r5�value�expiresr(s     r�setzSafeFileCache.seths"���#�#�C�(�����D�%� rc��|j|�}t�5tj|�ddd�t�5tj|dz�ddd�y#1swY�5xYw#1swYyxYw�Nr0)r-rr'�remove)r!r5r(s   r�deletezSafeFileCache.deletensV���#�#�C�(��
$�
&��I�I�d�O�'�
$�
&��I�I�d�W�n�%�'�
&�'�
&��
&�
&�s�A&�A2�&A/�2A;c��|j|�}|dz}tjj|�rtjj|�syt	�5t|d�cddd�S#1swYyxYwr/)r-r'r(r2rr3)r!r5r6r7s    r�get_bodyzSafeFileCache.get_bodyus_���,�,�S�1�
�!�G�+�	������}�-�"�'�'�.�.��2K��
$�
&��	�4�(�	)�	)�
&�
&�s� A6�6A?c�P�|j|�dz}|j||�yrZrU)r!r5�bodyr(s    r�set_bodyzSafeFileCache.set_body~s%���#�#�C�(�7�2�����D�$�rc�P�|j|�dz}|j||�y)z3Set the body of the cache entry from a file object.r0N)r-rS)r!r5�	body_filer(s    r�set_body_from_iozSafeFileCache.set_body_from_io�s'���#�#�C�(�7�2�����D�)�,r)r �str�return�None)r*rerfre)r5rerfzbytes | None)r(rerCzCallable[[BinaryIO], Any]rfrg)r(rerJ�bytesrfrg)r(rerRrrfrgrH)r5rerVrhrWzint | datetime | Nonerfrg)r5rerfrg)r5rerfzBinaryIO | None)r5rer`rhrfrg)r5rercrrfrg)�__name__�
__module__�__qualname__�__doc__rr-r9rErMrSrXr\r^rard�
__classcell__)r"s@rrr#sg����"#�
4� �"�,;�P�HL�!��!�$�!�/D�!�	
�!�&�)� �-rr)rrrf�bool)rfzGenerator[None, None, None])rl�
__future__rr'rP�collections.abcr�
contextlibrr�typingrrr	�pip._vendor.cachecontrol.cacher
�pip._vendor.cachecontrol.cachesr�pip._vendor.requests.modelsr�pip._internal.utils.filesystemr
r�pip._internal.utils.miscrrrrrrr�<module>rxsW�� �"�	�
�%�%��*�*�@�A�0�E�/�2��
��
�b-�)�b-r

Youez - 2016 - github.com/yon3zu
LinuXploit