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/lib/python3.9/site-packages/pip/_internal/network/__pycache__/session.cpython-39.pyc
a

?�fh;�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZm
Z
ddlmZddlmZmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.e,�rXddl/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6e3e7e7e2e4e8e7ffZ9e�:e;�Z<e	j=ded�gd�Z>dZ?dd�Z@dd�ZAGdd�de�ZBGdd�de�ZCGd d!�d!e�ZDGd"d#�d#ejE�ZFdS)$zhPipSession and supporting code, containing all pip-specific
network request configuration and behavior.
�N)�requests�six�urllib3)�CacheControlAdapter)�BaseAdapter�HTTPAdapter)�Response)�CaseInsensitiveDict)�parse)�InsecureRequestWarning)�__version__)�MultiDomainBasicAuth)�
SafeFileCache)�has_tls�	ipaddress)�libc_ver)�build_url_from_netloc�get_installed_version�parse_netloc)�MYPY_CHECK_RUNNING)�url_to_path)�Iterator�List�Optional�Tuple�Union)�Link�ignore)�category))�https�*r )r Z	localhostr )r z127.0.0.0/8r )r z::1/128r )�filer N)Zsshr r )Z
BUILD_BUILDIDZBUILD_IDZCIZ	PIP_IS_CIcCstdd�tD��S)z?
    Return whether it looks like pip is running under CI.
    css|]}|tjvVqdS�N)�os�environ)�.0�name�r'�A/usr/lib/python3.9/site-packages/pip/_internal/network/session.py�	<genexpr>`�z looks_like_ci.<locals>.<genexpr>)�any�CI_ENVIRONMENT_VARIABLESr'r'r'r(�
looks_like_ciXsr-cCsJdtd�t��dt��id�}|dddkr@t��|dd<n�|dddkr�tjjd	krltjd
d�}ntj}d�d
d�|D��|dd<nB|dddkr�t��|dd<n |dddkr�t��|dd<tj�d��rFddl	m
}ttdd�t
gd�|�����}ttdd�t
ddgt����}|�r8||d<|�rF||d<tj�d��rxt��d�rxdt��dd�|d<t���r�t��|�di�d<t���r�t��|�di�d<t���r�t��|d<t��r�dd
l}|j|d <td!�}|d
u�r�||d"<t��r
d#nd
|d$<tj�d%�}|d
u�r0||d&<d'j|tj|d(d#d)�d*�S)+z6
    Return a string representing the user agent.
    �pip)r&�versionr&)Z	installerZpython�implementationr0ZCPythonr/ZPyPy�finalN��.cSsg|]}t|��qSr')�str)r%�xr'r'r(�
<listcomp>wr*zuser_agent.<locals>.<listcomp>ZJythonZ
IronPythonZlinuxr)�distrocSs|dS�N�r'�r5r'r'r(�<lambda>�r*zuser_agent.<locals>.<lambda>)r&r/�idcSs|dSr8r'r:r'r'r(r;�r*�lib�libcr7�darwinZmacOS�system�releaseZcpuZopenssl_versionZ
setuptools�setuptools_versionTZciZPIP_USER_AGENT_USER_DATA�	user_dataz9{data[installer][name]}/{data[installer][version]} {json})�,�:)Z
separatorsZ	sort_keys)�data�json) r�platformZpython_versionZpython_implementation�sys�pypy_version_info�releaselevel�join�
startswith�pip._vendorr7�dict�filter�zipZlinux_distributionrZmac_verr@�
setdefaultrA�machinerZ_sslZOPENSSL_VERSIONrr-r#r$�get�formatrG�dumps)rFrJr7Zdistro_infosr>ZsslrBrCr'r'r(�
user_agentcsl�����





�rWc@seZdZddd�Zdd�ZdS)�LocalFSAdapterNc

Cs�t|j�}t�}d|_|j|_zt�|�}	Wn0ty\}
zd|_|
|_WYd}
~
nXd}
~
00tj	j
|	jdd�}t�
|�dp�d}t||	j|d��|_t|d�|_|jj|_|S)	N��i�T)Zusegmtrz
text/plain)zContent-TypezContent-Lengthz
Last-Modified�rb)r�urlrZstatus_coder#�stat�OSError�raw�emailZutilsZ
formatdate�st_mtime�	mimetypesZ
guess_typer	�st_size�headers�open�close)
�self�request�stream�timeout�verify�certZproxies�pathnameZrespZstats�excZmodifiedZcontent_typer'r'r(�send�s&
�

zLocalFSAdapter.sendcCsdSr"r')rfr'r'r(re�szLocalFSAdapter.close)NNNNN)�__name__�
__module__�__qualname__rnrer'r'r'r(rX�s�
rXcseZdZ�fdd�Z�ZS)�InsecureHTTPAdaptercstt|�j||d|d�dS�NF)�connr[rjrk)�superrr�cert_verify�rfrtr[rjrk��	__class__r'r(rv�s
�zInsecureHTTPAdapter.cert_verify�rorprqrv�
__classcell__r'r'rxr(rr�srrcseZdZ�fdd�Z�ZS)�InsecureCacheControlAdaptercstt|�j||d|d�dSrs)rur|rvrwrxr'r(rv�s
�z'InsecureCacheControlAdapter.cert_verifyrzr'r'rxr(r|�sr|csFeZdZdZ�fdd�Zd
dd�Zdd�Zd	d
�Z�fdd�Z�Z	S)�
PipSessionNc
s�|�dd�}|�dd�}|�dg�}|�dd�}tt|�j|i|��g|_t�|jd<t|d�|_t	j
|gd	�d
d�}t|d�}|r�tt
|�|d
�}tt
|�|d
�|_nt|d�}||_|�d|�|�d|�|�dt��|D]}	|j|	dd�q�dS)zj
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        �retriesr�cacheN�
trusted_hosts�
index_urlsz
User-Agent)r�)i�i�iig�?)�totalZstatus_forcelistZbackoff_factor)�max_retries)rr�zhttps://zhttp://zfile://T)�suppress_logging)�poprur}�__init__�pip_trusted_originsrWrcr
ZauthrZRetryrrrrr|�_trusted_host_adapterr�mountrX�add_trusted_host)
rf�args�kwargsr~rr�r�Zinsecure_adapterZsecure_adapter�hostrxr'r(r��s<�
��

zPipSession.__init__FcCs�|s.d�|�}|dur$|d�|�7}t�|�t|�}||jvrL|j�|�|�t|�d|j�|ds�|�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: {!r}Nz
 (from {})�/r9rE)	rU�logger�inforr��appendr�rr�)rfr��sourcer��msg�	host_portr'r'r(r�4s"



�
�zPipSession.add_trusted_hostccs<tD]
}|Vq|jD] \}}d||dur.dn|fVqdS)Nr )�SECURE_ORIGINSr�)rf�
secure_originr��portr'r'r(�iter_secure_originsQszPipSession.iter_secure_originsc	Cs�t�t|��}|j|j|j}}}|�dd�d}|��D]�}|\}}}	||kr\|dkr\q<z0t�	|durndnt
�|��}
t�t
�|��}Wn2t
y�|r�|��|��kr�|dkr�Yq<Yn0|
|vr�q<||	kr�|	dkr�|	dur�q<dSt�d||�dS)N�+r9���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�urlparser4�scheme�hostnamer��rsplitr�rZ
ip_addressrZensure_textZ
ip_network�
ValueError�lowerr�Zwarning)rf�location�parsedZorigin_protocolZorigin_hostZorigin_portr�Zsecure_protocolZsecure_hostZsecure_portZaddrZnetworkr'r'r(�is_secure_originXsR�

������
����	zPipSession.is_secure_origincs.|�d|j�tt|�j||g|�Ri|��S)Nri)rRrirur}rg)rf�methodr[r�r�rxr'r(rg�szPipSession.request)NF)
rorprqrir�r�r�r�rgr{r'r'rxr(r}�sL
Hr})G�__doc__Zemail.utilsr_rGZloggingrar#rHrI�warningsrNrrrZpip._vendor.cachecontrolrZpip._vendor.requests.adaptersrrZpip._vendor.requests.modelsrZpip._vendor.requests.structuresr	Zpip._vendor.six.moves.urllibr
r�Zpip._vendor.urllib3.exceptionsrr.rZpip._internal.network.authr
Zpip._internal.network.cacherZpip._internal.utils.compatrrZpip._internal.utils.glibcrZpip._internal.utils.miscrrrZpip._internal.utils.typingrZpip._internal.utils.urlsr�typingrrrrrZpip._internal.models.linkrr4�intZSecureOriginZ	getLoggerror��filterwarningsr�r,r-rWrXrrr|ZSessionr}r'r'r'r(�<module>sJ
P!