403Webshell
Server IP : 162.241.203.86  /  Your IP : 216.73.217.16
Web Server : Apache
System : Linux br1002.hostgator.com.br 5.14.0-687.36.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 7 05:40:49 EDT 2026 x86_64
User : luxlic01 ( 6532)
PHP Version : 8.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/virtualenv/discovery/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/virtualenv/discovery/__pycache__/py_info.cpython-39.pyc
a

��:i4e�
@sZdZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZddlmZedgd��Zdd	�Ze�Ze�d
�ZGdd�de�Zed
k�rVe	jdd�Zee�dkr�edZedd�ZndZee�dk�redZedd�ZndZe	jdd�ee	_e���Ze	j� d�!eddd�eeddd�f��dS)z�
The PythonInfo contains information about a concrete instance of a Python interpreter

Note: this file is also used to query target interpreters, so can only use standard library methods
�)�absolute_import�print_functionN)�OrderedDict�
namedtuple)�digits�VersionInfo)�major�minor�micro�releaselevel�serialcCs*tt�dgtj�dd����tj���S)N��PATHEXT)	�listr�fromkeys�os�environ�get�lower�split�pathsep�rr�@/usr/lib/python3.9/site-packages/virtualenv/discovery/py_info.py�_get_path_extensionssrz\{\w+\}c@s�eZdZdZdd�Zdd�Zdd�Zedd	��Ze	d
d��Z
e	dd
��Ze	dd��Ze	dd��Z
e	dd��Zdejfdd�ZdIdd�Ze	dd��Ze	dd��Ze	dd��Zd d!�Zd"d#�Zd$d%�Ze	d&d'��Zed(d)��Zd*d+�ZdZdZedJd,d-��ZedKd.d/��Z d0d1�Z!d2d3�Z"edLd5d6��Z#ed7d8��Z$ed9d:��Z%ed;d<��Z&iZ'dMd=d>�Z(d?d@�Z)edAdB��Z*dCdD�Z+dEdF�Z,dGdH�Z-dS)N�
PythonInfoz-Contains information for a Python interpreterc	s^dd��dd�}�tj��_�t����_�jdkrNt�fdd�tjD���_t�fdd	�tjD���_tjd
krvdnd�_	t
�d
��_�tj
��_
�tj��_�|ttdd����_�|ttdd����_�|ttdd����_�|ttdd����_�|ttdd����_�|tj���_�|�j���_����_ztd�d}Wnt�y`d}Yn0|�_�fdd	�tjD��_�t����_�ttj dd���_!t
�"�}d|v�r�d�_#��fdd�t
�$�D��_%i�_&n~tjdd�dk�rd|v�rd�_#�fdd�t
�$�D��_%i�_&n:d�_#�fdd�t
�$�D��_%�fd d���'��(�D��_&tt
d!tt
d"d��}�fd#d�d$|�ffD��_
t)�}�j%�*�D].}t+�,|�D]}|�-�|d%d&����q��q�|�-d'��fd(d�|D��_.�jdk�r
tjj/dk�r
d)�j.d*<�fd+d��j.�(�D�}��0d,|��_1��0d-|��_2ttd.ttd/d���_3d�_4dS)0NcSst|t�r|�d�S|S)N�utf-8)�
isinstance�bytes�decode��vrrr�u"szPythonInfo.__init__.<locals>.ucSs|durdStj�|�S�N)r�path�abspathrrrr�abs_path%sz%PythonInfo.__init__.<locals>.abs_pathZPyPyc3s|]}�|�VqdSr"r��.0�i�r!rr�	<genexpr>,�z&PythonInfo.__init__.<locals>.<genexpr>csg|]}�|��qSrrr&r)rr�
<listcomp>/r+z'PythonInfo.__init__.<locals>.<listcomp>l�@� Zpy_version_nodot�prefix�base_prefix�real_prefix�base_exec_prefix�exec_prefix�venvTFcsg|]}�|��qSrrr&r)rrr,Lr+�encodingc	s(i|] }�|��tj|d�jd���qS�F)�expand�scheme��	sysconfig�get_path�sysconfig_schemer&��selfr!rr�
<dictcomp>Ts�z'PythonInfo.__init__.<locals>.<dictcomp>�)��
Z
deb_systemZposix_prefixcs i|]}|tj|d�jd��qSr6r9r&�r>rrr?_scs$i|]}�|��tj|dd���qS)F)r7)r:r;r&r)rrr?fr+csi|]\}}�|��|��qSrr�r'�kr r)rrr?gr+Zget_makefile_filenameZ_get_makefile_filenamecs&i|]\}}|dur�|��|��qSr"rrDr)rrr?ks�Zmakefile_filename����ZPYTHONFRAMEWORKcs$i|]}�|��t�|�pd��qS�r
)r:�get_config_varr&r)rrr?zr+�pythonZimplementation_lowercs(i|] \}}||��j�r �jn|�qSr��
startswithr/�
system_prefixrDrCrrr?~r+ZstdlibZ
platstdlib�maxsizeZmaxint)5�sys�platformZpython_implementation�implementation�tupleZpypy_version_infor�version_inforN�architecturer:rIZ
version_nodot�versionr�name�getattrr/r0r1r2r3�
executable�original_executable�_fast_get_system_executable�system_executable�
__import__�ImportErrorZhas_venvr#�getfilesystemencoding�file_system_encoding�stdout�stdout_encodingZget_scheme_namesr<Zget_path_names�sysconfig_paths�distutils_install�_distutils_install�items�set�values�_CONF_VAR_RE�findall�add�sysconfig_varsr�sysconfig_pathZ
system_stdlibZsystem_stdlib_platformZmax_size�	_creators)	r>r%ZhasZscheme_namesZmakefileZconfig_var_keys�elementrEZconfsrr=r�__init__!s|



�
�
��	

zPythonInfo.__init__cs�|js|jdur�|j|jkr�|jdur�ttdd�}|dur�tj|kr�tj�|�rT|S|j	j
|j	j}}|jdkr�||fdkr�tj�|���fdd�d�
|�d�
||�fD�D]}tj�|�r�|Sq�dS|jS)	z>Try to get the system executable by just looking at propertiesN�_base_executable�posix)rA�csg|]}tj��|��qSr)rr#�join)r'�exe��base_dirrrr,�s�z:PythonInfo._fast_get_system_executable.<locals>.<listcomp>zpython{}�python{}.{})r1r0r/rWrOrXrr#�existsrSrr	�dirname�formatrY)r>Zbase_executablerr	rrurrZ�s*�
�


�

z&PythonInfo._fast_get_system_executablecsZ|j�|�}|durV|j|j|j|jf��fdd�|j��D�}|j||d��	t
j�}|S)Ncs"i|]\}}||�vrdn|�qSrHrrD��prefixesrrr?�r+z+PythonInfo.install_path.<locals>.<dictcomp>)�
config_var)rcrr/r3r0r2rkrerl�lstripr�sep)r>�key�resultr}rr{r�install_path�szPythonInfo.install_pathc	s�t���\t�d�zddlm}ddlm}Wn$tyTiYWd�S0Wd�n1sj0Y|�ddi�}t	t
d�r�dt
_t���(t�d�|jdd	d
��Wd�n1s�0Yt
j�_����fdd�|D�}|S)
N�ignorer)�dist)�SCHEME_KEYSZscript_argsz
--no-user-cfg�
_framework�installT)Zcreatecs.i|]&}|t�d�|��dd��tj��qS)z
install_{}rFN)rWrzr~rr)r'r��r(rrr?�r+z1PythonInfo._distutils_install.<locals>.<dictcomp>)�warnings�catch_warnings�simplefilterZ	distutilsr�Zdistutils.command.installr�r]ZDistribution�hasattrrOr�Zget_command_objrrr/Zfinalize_options)r�r��dr�rr�rrd�s"

6


,zPythonInfo._distutils_installcCsd�dd�|jdd�D��S)N�.css|]}t|�VqdSr"��strr&rrrr*�r+z)PythonInfo.version_str.<locals>.<genexpr>rrA�rsrSrCrrr�version_str�szPythonInfo.version_strcCsd�dd�|jdd�D��S)Nr�css|]}t|�VqdSr"r�r&rrrr*�r+z1PythonInfo.version_release_str.<locals>.<genexpr>rr@r�rCrrr�version_release_str�szPythonInfo.version_release_strcCs|j}d�|j|j�S)Nrw)rSrzrr	)r>rSrrr�python_name�szPythonInfo.python_namecCs
|jduSr")r1rCrrr�is_old_virtualenv�szPythonInfo.is_old_virtualenvcCs|jduo|jjdkS)NrA)r0rSrrCrrr�is_venv�szPythonInfo.is_venvNcCsJ|j|}|dur|j}n|j��}|�|�|}|jfi|���d|�S)N�/)rbrk�copy�updaterz�replace)r>r�r}r�pattern�baserrrrl�s


zPythonInfo.sysconfig_pathFcCs0|jdus|dur*ddlm}|�|�|_|jS)NTr)�CreatorSelector)rmZvirtualenv.run.plugin.creatorsr�Zfor_interpreter)r>Zrefreshr�rrr�creators�szPythonInfo.creatorscs^��d�fdd��j��D��}tj�|�sZtj��jtj���	d���}tj�|�rZ|}|S)NZincludecs(i|] \}}||��j�r �jn|�qSrrKrDrCrrr?�r+z-PythonInfo.system_include.<locals>.<dictcomp>Zheaders)
rlrkrerr#rxrsr/ryr�)r>r#�fallbackrrCr�system_include�s�zPythonInfo.system_includecCs|jp|jp|jSr")r1r0r/rCrrrrM�szPythonInfo.system_prefixcCs|jp|jp|jSr")r1r2r3rCrrr�system_exec_prefix�szPythonInfo.system_exec_prefixcCs t|�}tjdkr|�d�}|S)Nr@r)�reprrOrSr�r>Zcontentrrr�__unicode__s

zPythonInfo.__unicode__cCs d�|jjdd�|j��D��S)Nz{}({!r})cSs i|]\}}|�d�s||�qS)�_)rLrDrrrr?r+z'PythonInfo.__repr__.<locals>.<dictcomp>)rz�	__class__�__name__�__dict__rerCrrr�__repr__s�zPythonInfo.__repr__cCs�d�|jjd�dd�d|jf|jdur6|j|jkr6dnd|jf|j|jkrZ|j|jkrZdnd|jfd|jfd	|jfd
t	|j
�fdd�|j|j�ffD���}|S)
Nz{}({})z, css&|]\}}|durd�||�VqdS)Nz{}={})rzrDrrrr*s�z%PythonInfo.__str__.<locals>.<genexpr>�spec�system�originalrtrPrUZencoding_fs_ioz{}-{})
rzr�r�rsr�r[rXrYrPr�rUr_rar�rrr�__str__s4
�
��	
�
��	���zPythonInfo.__str__cCs$d�|jd�dd�|jD��|j�S)Nz{}{}-{}r�css|]}t|�VqdSr"r�r&rrrr*0r+z"PythonInfo.spec.<locals>.<genexpr>)rzrQrsrSrTrCrrrr�.szPythonInfo.speccCs"ddlm}||�|j��dS)Nr)�clear)�#virtualenv.discovery.cached_py_infor��_cache_exe_discovery)�cls�app_datar�rrr�clear_cache2szPythonInfo.clear_cachecCs|jrz|jtj�|j�krdS|jsztj�|j�}|j}tjdkrntj�	|�\}}|�
|�rn|dt|��}||krzdS|r�|jdur�|j�
�|j�
�kr�dS|jdur�|j|jkr�dSt|jdd�|j|j|jf�D]&\}}|dur�|dur�||kr�dSq�dS)zWcheck if a given specification can be satisfied by the this python interpreter instanceT�win32NFrrA)r#rXrr$Zis_abs�basenamerYrOrP�splitext�endswith�lenrQrrT�ziprSrr	r
)r>r�Zimpl_must_matchr�Z	spec_path�suffixZourZreqrrr�	satisfies:s*

(zPythonInfo.satisfiescCs&|jdur |jtj|ddd�|_|jS)��
        This locates the current host interpreter information. This might be different than what we run into in case
        the host python has been upgraded from underneath us.
        NTF��raise_on_error�resolve_to_host)�_current�from_exerOrX�r�r�rrr�currentYs
zPythonInfo.currentcCs&|jdur |jtj|ddd�|_|jS)r�NTr�)�_current_systemr�rOrXr�rrr�current_systemcs
zPythonInfo.current_systemcCstj|��dd�S)Nr@)�indent)�json�dumps�_to_dictrCrrr�_to_jsonmszPythonInfo._to_jsoncs*�fdd�t��D�}|d��|d<|S)Ncs$i|]}||dvrt�|�nd�qS))rmN)rW)r'�varrCrrr?rr+z'PythonInfo._to_dict.<locals>.<dictcomp>rS)�vars�_asdict)r>�datarrCrr�qszPythonInfo._to_dictTc

Cs�ddlm}|durtjn|}|||||||d�}t|t�r�|r�z|�||�}Wn@ty�}	z(|rh|	�t�	d|j
|	�d}WYd}	~	n
d}	~	00|S)z8Given a path to an executable get the python informationr)r�N)�envr��ignore_cachez-ignore %s due cannot resolve system due to %r)r�r�rrrr�_resolve_to_system�	Exception�logging�inforY)
r�rtr�r�r�r�r�r�Zproposed�	exceptionrrrr�wszPythonInfo.from_execCst�|�}|�|���Sr")r��loads�
_from_dictr�)r�Zpayload�rawrrr�
_from_json�s
zPythonInfo._from_jsoncCs*tfi|d��|d<|�}|��|_|S)NrS)rr�r�)r�r�r�rrrr��s
zPythonInfo._from_dictc	Cs�|j}t�}|jdur�|jp&|jp&|j}||vr�t|�dkrRt�d|�|j|_q�t	|�
�dd�D]\}\}}t�d|||�qbt�dt|�d||�td�
d�|������|||<|j||dd�}q|j|jkr�|�|j|�}||_|S)	NrFz$%r links back to itself via prefixes)�startz%d: prefix=%s, info=%rz prefixes are causing a circle {}�|F)r/�exact)rXrr[r1r0r/r�r�r��	enumeratere�error�RuntimeErrorrzrs�keys�discover_exer�)	r�r��targetZstart_executabler|r/�at�p�trrrr��s&
zPythonInfo._resolve_to_systemc
Cs||f}||jvr6|r6t�d|||j|�|j|St�d||�|��}|�|�}g}|durhtjn|}|D]@}	|D]6}
|�||	|
|||�}|durx||j|<|Sqxqp|dur�|r�|�||�}tj	�
|�}||j|<t�d||�|Sd�d�
|�tj	�
|��}
t|
��dS)Nz)discover exe from cache %s - exact %s: %rzdiscover exe for %s in %sFzFno exact match found, chosen most similar of %s within base folders %szfailed to detect {} in {}r�)
r�r��debug�_find_possible_exe_names�_find_possible_foldersrr�
_check_exe�_select_most_likelyrrsrzr�)r>r�r/r�r�r�Zpossible_namesZpossible_folders�
discovered�folderrVr�Zfolders�msgrrrr��s.



zPythonInfo.discover_exec
Cs�tj�||�}tj�|�sdS|j||dd|d�}|dur>dSdD]�}	t||	�}
t||	�}|
|krB|	dkr�d�dd�|
D��d�dd�|D��}
}|j}t�d||	|
|�|dur�|�	|�q�qB|SdS)	NF)r�r�r�)rQrTrSrSr�css|]}t|�VqdSr"r�r&rrrr*�r+z(PythonInfo._check_exe.<locals>.<genexpr>z2refused interpreter %s because %s differs %s != %s)
rr#rsrxr�rWrXr�r��append)
r>r�r�rVr�r�r�Zexe_pathr��item�foundZsearchedrXrrrr��s&

*
zPythonInfo._check_execs&�fdd�}t||dd�}|d}|S)Ncs||j�jk|jj�jjk|jj�jjk|j�jk|jj�jjk|jj�jjk|jj�jjkg}tdd�t	t
|��D��}|S)Ncss"|]\}}|rd|>ndVqdS)rFrNr)r'�pos�matchrrrr*�r+zBPythonInfo._select_most_likely.<locals>.sort_by.<locals>.<genexpr>)rQrSrr	rTr
rr�sumr��reversed)r��matches�priority�r�rr�sort_by�s

�	z/PythonInfo._select_most_likely.<locals>.sort_byT)r��reverser)�sorted)r�r�r�Zsorted_discoveredZmost_likelyrr�rr��szPythonInfo._select_most_likelycCs�t�}t�}d|tj�|j�<d||j<d|tj�|j�<d||j<|��D]>}tj�|�}|�|j	�rL|t
|j	�d�}d|d�||�<qLd||<dd�|��D�S)Nz{}{}cSsg|]}tj�|�r|�qSr)rr#rxr&rrrr,r+z5PythonInfo._find_possible_folders.<locals>.<listcomp>)rrr#�realpathrXrYr�ryrLr/r�rz)r>Z
inside_folderZcandidate_folderZexecutablesrtr��relativerrrr��s

z!PythonInfo._find_possible_foldersc
Cs�t�}|��D]d}dD]Z}d�dd�|jd|�D��}d�|j�dfD]&}tD]}d�||||�}d||<qPqHqqt|���S)N)rAr@rFrr�css|]}t|�VqdSr"r�r&rrrr*
r+z6PythonInfo._find_possible_exe_names.<locals>.<genexpr>z-{}r
z{}{}{}{})	r�_possible_basersrSrzrT�
EXTENSIONSrr�)r>Zname_candidaterVr�rUZarch�ext�	candidaterrrr�	sz#PythonInfo._find_possible_exe_namesccs�t�}tj�tj�|j��d�t�}d||<d||j<d|vrF|d=d|d<|D]H}|�	�}|Vddl
m}|�rR||kr�|V|��}||krR|VqRdS)NrrJ)�fs_is_case_sensitive)
rrr#r�r�rX�rstriprrQrZvirtualenv.infor�upper)r>Z
possible_baser�r�rrrrrrr�s" 
zPythonInfo._possible_base)F)N)N)NTFTN)TN).r��
__module__�__qualname__�__doc__rorZr��staticmethodrd�propertyr�r�r�r�r�rrrlr�r�rMr�r�r�r�r��classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrspc 	










 

		




r�__main__rFr
rG)"rZ
__future__rrr�r�rrP�rerOr:r��collectionsrr�stringrrrr��compilerh�objectrr��argvr�Zstart_cookieZ
end_cookier�r�r`�writersrrrr�<module>sB




Youez - 2016 - github.com/yon3zu
LinuXploit