403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_venv.cpython-36.opt-2.pyc
3

�
�^G�@s&ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
mZddlZddlZyddlZWnek
r�dZYnXyddlZWnek
r�dZYnXejejejkd�Zd
dd�ZGdd�dej�ZGdd	�d	e�ZeGd
d�de��Zedk�r"ej�dS)�N)�captured_stdout�captured_stderr�
requires_zlib�can_symlink�EnvironmentVarGuard�rmtreezTest not appropriate in a venvcCsBtj|tjtj|d�}|j�\}}|jr:tj|j|||��||fS)N)�stdout�stderr�encoding)�
subprocess�Popen�PIPEZcommunicate�
returncode�CalledProcessError)�cmdr
�p�out�err�r�./opt/alt/python36/lib64/python3.6/test_venv.py�check_output#src@s8eZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�BaseTest�P�2cCs�tjjtj��|_tjdkr0d|_d
|_d|_	n$d|_ddt
jdd�f|_d	|_	t
jd
krtdtj
krttj
d}nt
j}tjj|�d|_dS)N�nt�Scripts�Lib�Include�bin�libzpython%d.%d��include�darwin�__PYVENV_LAUNCHER__�)r���)�os�path�realpath�tempfileZmkdtemp�env_dir�name�bindirrr!�sys�version_info�platform�environ�
executable�split�exe)�selfr1rrr�setUp2s
zBaseTest.setUpcCst|j�dS)N)rr*)r4rrr�tearDownBszBaseTest.tearDowncOs>t��"}t��}|||�WdQRXWdQRX|j�|j�fS)N)rr�getvalue)r4�func�args�kwargs�output�errorrrr�run_with_captureEszBaseTest.run_with_capturecGstjj|jf|��S)N)r&r'�joinr*)r4r9rrr�get_env_fileKszBaseTest.get_env_filec	Gs(t|j|�d��}|j�}WdQRX|S)N�r)�openr?�read)r4r9�f�resultrrr�get_text_file_contentsNszBaseTest.get_text_file_contentsNi�)	�__name__�
__module__�__qualname__ZmaxDiffr5r6r=r?rErrrrr.src	@s�eZdZdd�Zdd�Zdd�Zedd��Zej	d	kr<d/Z
n4d0d1d2ddejdd�fddejdd�d
ffZ
dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeje�d �d!d"��Zed#d$��Zeje�d �d%d&��Zejejd'kd(�d)d*��ZdS)3�	BasicTestcGs |j|�}|jtjj|��dS)N)r?�
assertTruer&r'�isdir)r4r9�fnrrrrKVs
zBasicTest.isdircCsDt|j�|jtj|j�|j|j�|j|j�|j|j�|j	d�}t
jd�dkohtj
dkohtjdk}|r�|jtjj|��n|jtjj|��|jd�}tjdkr�dtjkr�tjd}ntj}tjj|�}|jd||�|j	|j|j�}tjj|��s(|j	|j�}td	|�td
tj|��|jtjj|�d|�dS)N�lib64�P��posixr"z
pyvenv.cfgr#z	home = %szContents of %r:z    %rzFile %r should exist.)rr*r=�venv�createrKr,r!rr?�struct�calcsizer&r+r-r/rJr'�islink�assertFalse�existsrEr0r1�dirname�assertInr3�print�listdir)r4rZ
conditions�datar1r'rL�bdrrr�
test_defaultsZs0



zBasicTest.test_defaultscCsbtjj|j�d}tj�}|j|j�}|j|jd|�tjdd�}|j|j�}|j|jd�dS)Nr$z(%s) z	My prompt)�promptz(My prompt) )	r&r'r2r*rQ�
EnvBuilderZensure_directories�assertEqualr_)r4Zenv_name�builder�contextrrr�test_promptzszBasicTest.test_promptcCs�|jtjtj�|jtjtj�t|j�|jt	j
|j�tjj
|j|j|j�}|ddg}x\d|jfd|jfdtjfdtjffD]4\}}d||d<t|�\}}|j|j�|j��q�WdS)Nz-c�prefix�base_prefix�base_exec_prefixzimport sys; print(sys.%s)r )rar-rfrerg�exec_prefixrr*r=rQrRr&r'r>r,r3r�strip�encode)r4�envpyrreZexpectedrrrrr�
test_prefixes�s

zBasicTest.test_prefixes�win32rrr�
site-packagesrr!rzpython%d.%dNr c
Cs^xX|D]P}tjj|jf|��}tj|�tjj||�}t|d��}|jd�WdQRXqWdS)N�wbsStill here?)r&r'r>r*�mkdirrA�write)r4�paths�filename�subdirs�drLrCrrr�create_contents�s

zBasicTest.create_contentscCs�|j|jd�tj|j�x^|jD]T}tjj|jf|d��}|jtjj	|��t
|d��}|j|j�d�WdQRXq"Wtj
dd�}|j|j�x8|jD].}tjj|jf|d��}|jtjj	|��q�WdS)N�foo�rbsStill here?T)�clear)rw)rw)rv�ENV_SUBDIRSrQrRr*r&r'r>rJrWrArarBr`rV)r4rtrLrCrbrrr�test_overwrite_existing�sz!BasicTest.test_overwrite_existingcCs^xXtj|�D]J}tjj||�}tjj|�s6tjj|�rBtj|�qtjj|�rt|�qWdS)N)	r&r[r'r>rU�isfile�removerKr)r4r'rLrrr�clear_directory�szBasicTest.clear_directorycCsrxl|jdd�D]Z}tjj|jf|��}t|d��}|jd�WdQRX|jtt	ft
j|j�|j|j�qWdS)N�ro�)
rzr&r'r>r*rArqZassertRaises�
ValueError�OSErrorrQrRr~)r4rrrLrCrrr�test_unoverwritable_fails�sz#BasicTest.test_unoverwritable_failscCs�x�dD]�}tj|d�}|j|j|j�|j|j�|j|j�|j|j�|j	|j|j
�}tjj
|�s�|j	|j�}td|�tdtj|��|jtjj
|�d|�qWdS)NFT)�upgradezContents of %r:z    %rzFile %r should exist.)FT)rQr`r=rRr*rKr,r!rr?r3r&r'rWrZr[rJ)r4r�rbrLr]rrr�test_upgrade�s
zBasicTest.test_upgradecCsJxDd
D]<\}}tjd|d�}|j|j�|jd�}|jd||�qWdS)NT�trueF�false)ry�system_site_packagesz
pyvenv.cfgz"include-system-site-packages = %s
�Tr��Fr�)r�r�)rQr`rRr*rErY)r4Zssp�srbr\rrr�test_isolation�s

zBasicTest.test_isolationzNeeds symlinkscCsRxLdD]D}tjd|d�}|j|j�|j|j|j�}|r|jtj	j
|��qWdS)NFT)ry�symlinks)FT)rQr`rRr*r?r,r3rJr&r'rU)r4ZuslrbrLrrr�test_symlinking�s
zBasicTest.test_symlinkingcCsbt|j�|jtj|j�tjjtjj|j�|j	|j
�}t|ddg�\}}|j|j
�|j��dS)Nz-cz!import sys; print(sys.executable))rr*r=rQrRr&r'r>r(r,r3rrarirj)r4rkrrrrr�test_executable
s
zBasicTest.test_executablecCslt|j�tjddd�}|j|j�tjjtjj|j�|j	|j
�}t|ddg�\}}|j|j
�|j��dS)NT)ryr�z-cz!import sys; print(sys.executable))rr*rQr`rRr&r'r>r(r,r3rrarirj)r4rbrkrrrrr�test_executable_symlinkss
z"BasicTest.test_executable_symlinksrzonly relevant on WindowscCs�t|j�tjjtjj|j�d�}tjdd�}|j|�tjj||j	d�}tjj||j	|j
�}t|d|j
ddgdd	�\}}|j|j
�d
�dS)NuϼўТλФЙT)ryzactivate.bat�&z-czprint(0)Zoem)r
�0)rr*r&r'r>r(rQr`rRr,r3rrari)r4r*rbZactivaterkrrrrr�test_unicode_in_batch_file(s

z$BasicTest.test_unicode_in_batch_file�r�r�r�rrn)r�r�r�r�)r)r!)r)rFrGrHrKr^rd�
skipInVenvrlr-r/rzr.rvr{r~r�r�r��unittest�
skipUnlessrr�r�r�r&r+r�rrrrrISs0 
	

rIc@sXeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zej	e
d�ej	ed�ed
d����Z
dS)�
EnsurePipTestcCsdtjjtjj|j�|j|j�}t|ddg�\}}|jd�}|j	|d�|jd�}|j	|j
�d�dS)Nz-cz1try:
 import pip
except ImportError:
 print("OK")zlatin-1�ZOK)r&r'r>r(r*r,r3r�decoderari)r4rkrrrrr�assert_pip_not_installed<s

z&EnsurePipTest.assert_pip_not_installedcCs&t|j�|jtj|j�|j�dS)N)rr*r=rQrRr�)r4rrr�test_no_pip_by_defaultIs
z$EnsurePipTest.test_no_pip_by_defaultcCs*t|j�|jtj|jdd�|j�dS)NF)�with_pip)rr*r=rQrRr�)r4rrr�test_explicit_no_pipNs
z"EnsurePipTest.test_explicit_no_pipc
Csdttjd��}|j|j�d�WdQRXtjj�dkrL|jtjjtj��n|j	tjjtj��dS)Nrxr�Znul)
rAr&�devnullrarB�lowerrVr'rWrJ)r4rCrrr�test_devnullSs
zEnsurePipTest.test_devnullc)Cs2t|j�t����}d|d<d|d<tj���}||d<d}d}d}xX|fD]N\}}tjj||�}	tj|	�tjj|	|�}
t	|
d��}|j
|�WdQRXqJWy|jtj
|j|dd
�WnJtjk
�r}z*|jjdd�}
d}|j|j||
��WYdd}~XnXWdQRXWdQRXtjjtjj|j�|j|j�}t|dddg�\}}|jd�}|j|d�|jd�}djtj��}|j|dt|��|�tj|j�jd�}|j||�t��}t|ddg�\}}WdQRX|jd�}tjdd|tj d�}|j|j!�d�|jd�}|jd|�|jd|�|�s.|j"�dS)N�eZPYTHONWARNINGS�1ZPIP_NO_INSTALL�HOMEz[global]
no-install=1�pip�pip.ini�.pip�pip.conf�wT)r�r��replace)�errorsz{}

**Subprocess Output**
{}z-Imz	--versionzlatin-1r�zpip {}zensurepip._uninstallzN^The directory .* or its parent directory is not owned by the current user .*$)�flagszSuccessfully uninstalled pipz#Successfully uninstalled setuptools)r�r�)r�r�)#rr*rr)ZTemporaryDirectoryr&r'r>rprArqr=rQrRrrr;r�Zfail�formatr(r,r3rra�	ensurepip�version�len�fsencoderY�re�sub�	MULTILINE�rstripr�)r4r��envvarsZhome_dirZ
bad_configZwin_locationZposix_locationrXZfname�dirpathZfpathrC�excZdetails�msgrkrrZexpected_versionr*rrr�do_test_with_pipasV



8



zEnsurePipTest.do_test_with_pipz@some dependencies of pip import threading module unconditionallyzpip requires ctypescCs|jd�|jd�dS)NFT)r�)r4rrr�
test_with_pip�s
zEnsurePipTest.test_with_pipN)rFrGrHr�r�r�r�r�r�r��	threading�ctypesrr�rrrrr�9s
T

r��__main__)N)r�r&Zos.pathr�rSrr-r)Ztest.supportrrrrrrr�rQr��ImportErrorr�ZskipIfrerfr�rZTestCaserrIr�rF�mainrrrr�<module>s: 


%g


Youez - 2016 - github.com/yon3zu
LinuXploit