HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/virtualenv/discovery/__pycache__/cached_py_info.cpython-310.pyc
o

$�"b��@s�dZddlmZmZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZe	�Ze
�eeej�<dd
d�Zddd�Zdd�Zdd�ZGdd�de�Zdd�ZdZ dS)z�

We acquire the python information by running an interrogation script via subprocess trigger. This operation is not
cheap, especially not on Windows. To not have to pay this hefty cost every time we apply multiple levels of
caching.
�)�absolute_import�unicode_literalsN)�OrderedDict)�AppDataDisabled)�
PythonInfo)�PY2)�Path)�ensure_text)�Popen�
subprocessTFcCsN|durtjn|}t|||||d�}t|t�r%|r|�t�dt|��d}|S)N)�ignore_cachez%s)�os�environ�_get_from_cache�
isinstance�	Exception�logging�info�str)�cls�app_data�exe�env�raise_on_errorr�result�r�E/usr/lib/python3/dist-packages/virtualenv/discovery/cached_py_info.py�from_exes
rcCsNt|�}|s|tvrt|}nt|||||�}|}t|<t|t�r%||_|S�N)r�_CACHE�_get_via_file_cacherr�
executable)rrrrr�exe_pathr�py_inforrrr&s

rcCsdtt|��}z|��j}Wntyd}Ynw|dur t�}d|�|�}}|���||��ro|�	�}	|	d|	d|	d}
}}|
|krk||krk|�
dd�|��D��}|j}
|
durjt
j�|
�sj|��d}n|��|dur�t||||�\}}|dur�|||��d�}	|�|	�n|}Wd�|SWd�|SWd�|S1s�wY|S)N����path�st_mtime�contentcSsi|]\}}||�qSrr)�.0�k�vrrr�
<dictcomp>Csz'_get_via_file_cache.<locals>.<dictcomp>)r&r%r')r	r�statr&�OSErrorrr#�locked�exists�read�
_from_dict�items�system_executabler
r%�remove�_run_subprocess�_to_dict�write)rrr%rr�	path_text�
path_modifiedr#�
py_info_store�data�of_path�of_st_mtime�
of_content�sys_exe�failurerrrr 5sJ�
�
��
��
��r cCs>ttj�t��jd}|�|��U}|t|�g}|��}|�	dd�t
�dt|��zt
|dtjtjtj|d�}|��\}}|j}	Wnty]}
zd|
j|
j}}}	WYd}
~
nd}
~
wwWd�n1shwYd\}}|	dkr�|�|�}||_||fSd	�||	|r�d
�|�nd|r�d�|�nd�}
t|
�}||fS)Nz
py_info.py�__PYVENV_LAUNCHER__z get interpreter info via cmd: %sT)�universal_newlines�stdin�stderr�stdoutr�)NNrz#failed to query {} with code {}{}{}z
 out: {!r}z
 err: {!r})rr
r%�abspath�__file__�parent�ensure_extractedr�copy�popr�debug�LogCmdr
r�PIPE�communicate�
returncoder-�strerror�errno�
_from_jsonr!�format�RuntimeError)rrrr�py_info_script�cmd�process�out�err�code�os_errorrr@�msgrrrr5TsH�
 ����
	��r5c@s&eZdZddd�Zdd�Zdd�ZdS)	rNNcCs||_||_dSr)rXr)�selfrXrrrr�__init__ys
zLogCmd.__init__csVdd���d���fdd�|jD��}|jdur"|�d��|j�7}tr)|�d�S|S)NcSst|t�r
|�d�S|S�N�utf-8)r�bytes�decode)r*rrr�e~szLogCmd.__repr__.<locals>.e� c3s�|]
}t��|��VqdSr)�pipes�quote)r(�c�rerr�	<genexpr>�s�z"LogCmd.__repr__.<locals>.<genexpr>z env of {!r}rb)�joinrXrrUr�encode)r_�cmd_reprrrjr�__repr__}s

zLogCmd.__repr__cCst|�}tr|�d�S|Sra)�reprrrd)r_�rawrrr�__unicode__�s
zLogCmd.__unicode__r)�__name__�
__module__�__qualname__r`rorrrrrrrNxs
rNcCs|��t��dSr)�
py_info_clearr�clear)rrrrrw�srw)rrwrN)NTF)T)!�__doc__�
__future__rrrr
rg�sys�collectionsr�virtualenv.app_datar�virtualenv.discovery.py_infor�virtualenv.infor�virtualenv.util.pathr�virtualenv.util.sixr	�virtualenv.util.subprocessr
rrr!rrr r5�objectrNrw�	___all___rrrr�<module>s,

$