HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_internal/network/__pycache__/session.cpython-37.pyc
B

L��g
I�@s~UdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlmZmZmZmZmZmZmZmZmZmZddlmZmZddlmZ ddl!m"Z"m#Z#ddl!m$Z%ddl&m'Z'm(Z(dd	l)m*Z*dd
l+m,Z,ddl-m.Z.ddl/m0Z0dd
l1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>m?Z?ddl@mAZAe�r�ddlBmCZCddlDmEZEe�FeG�ZHeeIeIeeeJeIffZKejLde.d�ddddddgZMeeKeNd<d ZOePd!�d"d#�ZQeId!�d$d%�ZRGd&d'�d'e#�ZSGd(d)�d)�ZTGd*d+�d+eTe%�Z$Gd,d-�d-eTe �ZGd.d/�d/e$�ZUGd0d1�d1e�ZVGd2d3�d3ejW�ZXdS)4zhPipSession and supporting code, containing all pip-specific
network request configuration and behavior.
�N)
�
TYPE_CHECKING�Any�Dict�	Generator�List�Mapping�Optional�Sequence�Tuple�Union)�requests�urllib3)�CacheControlAdapter)�DEFAULT_POOLBLOCK�BaseAdapter)�HTTPAdapter)�PreparedRequest�Response)�CaseInsensitiveDict)�ConnectionPool)�InsecureRequestWarning)�__version__)�get_default_environment)�Link)�MultiDomainBasicAuth)�
SafeFileCache)�has_tls)�libc_ver)�build_url_from_netloc�parse_netloc)�url_to_path)�
SSLContext)�PoolManager�ignore)�category)�https�*r&)r&�	localhostr&)r&z127.0.0.0/8r&)r&z::1/128r&)�filer&N)�sshr&r&�SECURE_ORIGINS)�
BUILD_BUILDID�BUILD_ID�CI�	PIP_IS_CI)�returncCstdd�tD��S)z?
    Return whether it looks like pip is running under CI.
    css|]}|tjkVqdS)N)�os�environ)�.0�name�r4�A/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/network/session.py�	<genexpr>jsz looks_like_ci.<locals>.<genexpr>)�any�CI_ENVIRONMENT_VARIABLESr4r4r4r5�
looks_like_cicsr9c
Cs�dtd�t��dt��id�}|dddkr@t��|dd<n�|dddkr�tj}|jd	krl|d
d�}d�d
d�|D��|dd<nB|dddkr�t��|dd<n |dddkr�t��|dd<tj�d��rTddl	m
}|��|��|�
�f}ttdd�tdddg|���}ttdd�tddgt����}|�rF||d<|�rT||d<tj�d��r�t��d�r�dt��dd�|d<t���r�t��|�di�d<t���r�t��|�di�d<t���r�t��|d<t��r�dd
l}|j|d <t��d!�}|d
k	�rt|j�|d"<t�d#�d
k	�rzytj d#d$gtj!d%d&�}Wnt"k
�rVYn$X|�d'��rz|�#d(�d)�$�|d*<t%��r�d+nd
|d,<t&j'�(d-�}	|	d
k	�r�|	|d.<d/j)|t*j+|d0d+d1�d2�S)3z6
    Return a string representing the user agent.
    �pip)r3�versionr3)�	installer�python�implementationr>�CPythonr;�PyPy�finalN��.cSsg|]}t|��qSr4)�str)r2�xr4r4r5�
<listcomp>�szuser_agent.<locals>.<listcomp>�Jython�
IronPython�linuxr)�distrocSs|dS)N�r4)rEr4r4r5�<lambda>��zuser_agent.<locals>.<lambda>�idcSs|dS)NrKr4)rEr4r4r5rL�rM�lib�libcrJ�darwin�macOS�system�release�cpu�openssl_version�
setuptools�setuptools_versionZrustcz	--versiong�?)�stderr�timeoutsrustc � rKZ
rustc_versionT�ci�PIP_USER_AGENT_USER_DATA�	user_dataz9{data[installer][name]}/{data[installer][version]} {json})�,�:)�
separators�	sort_keys)�data�json),r�platform�python_version�python_implementation�sys�pypy_version_info�releaselevel�join�
startswith�pip._vendorrJr3r;�codename�dict�filter�zipr�mac_verrS�
setdefaultrT�machiner�_ssl�OPENSSL_VERSIONr�get_distributionrD�shutil�which�
subprocess�check_output�STDOUT�	Exception�split�decoder9r0r1�get�formatrd�dumps)
rcrirJ�linux_distribution�distro_infosrP�sslZsetuptools_distZrustc_outputr^r4r4r5�
user_agentmsv






r�c@sreZdZd
eeeeeeeeffeee	feee	ee	e	ffee
e	e	fed�dd�Zdd�dd	�Z
dS)�LocalFSAdapterFNT)�request�streamrZ�verify�cert�proxiesr/c

Cs�t|j�}t�}d|_|j|_yt�|�}	WnRtk
r~}
z4d|_t|
�j|_	t
�|j	�d|
���d��|_
Wdd}
~
XYnPXtjj|	jdd�}t�|�dp�d}t||	j|d	��|_t|d
�|_
|j
j|_|S)N��i�z: �utf8T)�usegmtrz
text/plain)zContent-TypezContent-Lengthz
Last-Modified�rb)r �urlr�status_coder0�stat�OSError�type�__name__�reason�io�BytesIO�encode�raw�email�utils�
formatdate�st_mtime�	mimetypes�
guess_typer�st_size�headers�open�close)
�selfr�r�rZr�r�r��pathname�resp�stats�exc�modified�content_typer4r4r5�send�s&	
0
zLocalFSAdapter.send)r/cCsdS)Nr4)r�r4r4r5r��szLocalFSAdapter.close)FNTNN)r��
__module__�__qualname__r�boolrr�floatr
rDrrr�r�r4r4r4r5r��sJr�csReZdZdZdd�ededd��fdd�Zefeee	edd	��fd
d�
Z
�ZS)�_SSLContextAdapterMixina#Mixin to add the ``ssl_context`` constructor argument to HTTP adapters.

    The additional argument is forwarded directly to the pool manager. This allows us
    to dynamically decide what SSL store to use at runtime, which is used to implement
    the optional ``truststore`` backend.
    N)�ssl_contextr!)r��kwargsr/cs||_t�jf|�dS)N)�_ssl_context�super�__init__)r�r�r�)�	__class__r4r5r�sz _SSLContextAdapterMixin.__init__r")�connections�maxsize�block�pool_kwargsr/cs2|jdk	r|�d|j�t�jf|||d�|��S)Nr�)r�r�r�)r�rsr��init_poolmanager)r�r�r�r�r�)r�r4r5r�s
z(_SSLContextAdapterMixin.init_poolmanager)r�r�r��__doc__rrr�r�intr�r��
__classcell__r4r4)r�r5r��s
r�c@seZdZdS)rN)r�r�r�r4r4r4r5r src@seZdZdS)rN)r�r�r�r4r4r4r5r$src	sFeZdZeeeeefeeeeeeffdd��fdd�Z	�Z
S)�InsecureHTTPAdapterN)�connr�r�r�r/cst�j||d|d�dS)NF)r�r�r�r�)r��cert_verify)r�r�r�r�r�)r�r4r5r�)szInsecureHTTPAdapter.cert_verify)r�r�r�rrDrr�rr
r�r�r4r4)r�r5r�(s

r�c	sFeZdZeeeeefeeeeeeffdd��fdd�Z	�Z
S)�InsecureCacheControlAdapterN)r�r�r�r�r/cst�j||d|d�dS)NF)r�r�r�r�)r�r�)r�r�r�r�r�)r�r4r5r�4sz'InsecureCacheControlAdapter.cert_verify)r�r�r�rrDrr�rr
r�r�r4r4)r�r5r�3s

r�c
s�eZdZUdZeeed<dddddd�eeeee	eee
eededd��fdd	�Ze
edd
�dd�Zdeeee
dd�dd�Zeeddfd�dd�Zee
d�dd�Zeeeeed��fdd�Z�ZS)�
PipSessionNrZrr4)�retries�cache�
trusted_hosts�
index_urlsr�r!)�argsr�r�r�r�r�r�r/cs�t�j||�g|_t�|jd<t|d�|_tj|dddddgdd	�}t	|d
�}|rzt
t|�||d�}	tt|�|d�|_
nt||d
�}	||_
|�d|	�|�d|�|�dt��x|D]}
|j|
dd�q�WdS)zj
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        z
User-Agent)r�i�i�i�iig�?)�total�status_forcelist�backoff_factor)�max_retries)r�r�r�)r�r�)r�r�zhttps://zhttp://zfile://T)�suppress_loggingN)r�r��pip_trusted_originsr�r�r�authr
�Retryr�rrr��_trusted_host_adapterr�mountr��add_trusted_host)r�r�r�r�r�r�r�r��insecure_adapter�secure_adapter�host)r�r4r5r�As0

zPipSession.__init__)�new_index_urlsr/cCs||j_dS)zn
        :param new_index_urls: New index urls to update the authentication
            handler with.
        N)r�r�)r�r�r4r4r5�update_index_urls�szPipSession.update_index_urlsF)r��sourcer�r/cCs�|s0d|��}|dk	r&|d|�d�7}t�|�t|�\}}|dkrRtd|����||f|jkrp|j�||f�|�t|dd�d|j�|�t|�d|j�|s�|�t|dd�d	|j�|�t|�d	|j�dS)
z�
        :param host: It is okay to provide a host that has previously been
            added.
        :param source: An optional source string, for logging where the host
            string came from.
        zadding trusted host: Nz (from �)z+Trusted host URL must include a host part: �http)�scheme�/r`)	�logger�infor�
ValueErrorr��appendr�rr�)r�r�r�r��msgZparsed_hostZparsed_portr4r4r5r��s$	

zPipSession.add_trusted_host)r/ccs:tEdHx*|jD] \}}d||dkr*dn|fVqWdS)Nr&)r*r�)r�r��portr4r4r5�iter_secure_origins�s
zPipSession.iter_secure_origins)�locationr/c	Cs�tj�t|��}|j|j|j}}}|�dd�d}x�|��D]�}|\}}}	||kr`|dkr`q@yt	�
|pld�}
t	�|�}Wn2tk
r�|r�|�
�|�
�kr�|dkr�w@YnX|
|kr�q@||	kr�|	dkr�|	dk	r�q@dSWt�d||�dS)	N�+rK���r&�Tz�The repository located at %s is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host %s'.F)�urllib�parse�urlparserDr��hostnamer��rsplitr��	ipaddress�
ip_address�
ip_networkr��lowerr��warning)r�r��parsed�origin_protocol�origin_host�origin_port�
secure_origin�secure_protocol�secure_host�secure_port�addr�networkr4r4r5�is_secure_origin�s:
zPipSession.is_secure_origin)�methodr�r�r�r/cs2|�d|j�|�d|j�t�j||f|�|�S)NrZr�)rsrZr�r�r�)r�rr�r�r�)r�r4r5r�szPipSession.request)NF)r�r�r�rZrr��__annotations__rrDr	rr�r�r�r�r�SecureOriginr�rr�rr�r�r4r4)r�r5r�>s
&GCr�)Yr��email.utilsr�r�r�rd�loggingr�r0rerxrzrh�urllib.parser��warnings�typingrrrrrrrr	r
rrmrr
Zpip._vendor.cachecontrolrZ_BaseCacheControlAdapterZpip._vendor.requests.adaptersrrrZ_BaseHTTPAdapterZpip._vendor.requests.modelsrrZpip._vendor.requests.structuresrZ"pip._vendor.urllib3.connectionpoolrZpip._vendor.urllib3.exceptionsrr:rZpip._internal.metadatar�pip._internal.models.linkr�pip._internal.network.authr�pip._internal.network.cacher�pip._internal.utils.compatr�pip._internal.utils.glibcr�pip._internal.utils.miscrr�pip._internal.utils.urlsr r�r!Zpip._vendor.urllib3.poolmanagerr"�	getLoggerr�r�rDr�r�filterwarningsr*rr8r�r9r�r�r�r�r��Sessionr�r4r4r4r5�<module>sj0




e,"