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.9/site-packages/pip/_internal/network/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pip/_internal/network/__pycache__/cache.cpython-39.pyc
a

W��e_�@s�dZddlZddlmZddlmZddlmZmZmZm	Z	ddl
mZddlm
Z
ddlmZdd	lmZmZdd
lmZeed�dd
�Zeedd�dd��ZGdd�de�ZdS)zHTTP cache implementation.
�N)�contextmanager)�datetime)�BinaryIO�	Generator�Optional�Union)�SeparateBodyBaseCache)�SeparateBodyFileCache)�Response)�adjacent_tmp_file�replace)�
ensure_dir)�response�returncCst|dd�S)NZ
from_cacheF)�getattr)r�r�?/usr/lib/python3.9/site-packages/pip/_internal/network/cache.py�
is_from_cachesr)NNN)rccs"z
dVWntyYn0dS)zvIf we can't access the cache then we can just skip caching and process
    requests as if caching wasn't enabled.
    N)�OSErrorrrrr�suppressed_cache_errorss
rcs�eZdZdZedd��fdd�Zeed�dd�Zeeed	�d
d�Z	eedd�d
d�Z
deeeee
dfdd�dd�Zedd	�dd�Zeeed	�dd�Zeedd�dd�Z�ZS)�
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.
    N)�	directoryrcs$|dusJd��t���||_dS)Nz!Cache directory must not be None.)�super�__init__r)�selfr��	__class__rrr2s
zSafeFileCache.__init__)�namercCs6t�|�}t|dd��|g}tjj|jg|�R�S)N�)r	�encode�list�os�path�joinr)rrZhashed�partsrrr�_get_cache_path7s
zSafeFileCache._get_cache_path)�keyrc	Cs�|�|�}|d}tj�|�r*tj�|�s.dSt��Pt|d��&}|��Wd�Wd�S1sl0YWd�n1s�0YdS�N�.body�rb)r%r!r"�existsr�open�read)rr&�
metadata_path�	body_path�frrr�get?s
zSafeFileCache.get)r"�datarc	Csxt��^ttj�|��t|��}|�|�Wd�n1s@0Yt|j|�Wd�n1sj0YdS�N)	rr
r!r"�dirnamer�writerr)rr"r1r/rrr�_writeIs

(zSafeFileCache._write)r&�value�expiresrcCs|�|�}|�||�dSr2�r%r5)rr&r6r7r"rrr�setRs
zSafeFileCache.setcCsr|�|�}t��t�|�Wd�n1s00Yt��t�|d�Wd�n1sd0YdS�Nr()r%rr!�remove)rr&r"rrr�deleteXs

(zSafeFileCache.deletecCsb|�|�}|d}tj�|�r*tj�|�s.dSt��t|d�Wd�S1sT0YdSr')r%r!r"r*rr+)rr&r-r.rrr�get_body_s
zSafeFileCache.get_body)r&�bodyrcCs|�|�d}|�||�dSr:r8)rr&r>r"rrr�set_bodyhszSafeFileCache.set_body)N)�__name__�
__module__�__qualname__�__doc__�strrr%r�bytesr0r5r�intrr9r<rr=r?�
__classcell__rrrrr s

��	r)rCr!�
contextlibrr�typingrrrrZpip._vendor.cachecontrol.cacherZpip._vendor.cachecontrol.cachesr	Zpip._vendor.requests.modelsr
Zpip._internal.utils.filesystemrrZpip._internal.utils.miscr
�boolrrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit