403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.141
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:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_embed.cpython-313.opt-2.pyc
�

��iS3��P�SSKJr SSKJrJrJrJr SSKrSSKJ	r	 SSK
r
SSKrSSKrSSK
r
SSKr
SSKrSSKrSSKrSSKrSSKrSSKrSSKr\R,(d\R."S5eSSKr\R4S:HrSrSrSrS	r\R@(a\r!O\r!\""\S
5r#Sr$Sr%Sr&Sr'S
r(\RR"S5(aSOSr*\
RVRY\RZ\R\S\R^R`S\R^Rb35r2\
RVRg\
RVRY\2S55(dSr2Sr4Sr5"SS5r6"SS\6\Rn5r8\Rr"\SLS5"SS\6\Rn55r:"SS\Rn5r;"SS \6\Rn5r<"S!S"\6\Rn5r=\>S#:Xa\R~"5 gg!\a SrGN�f=f)$�)�support)�
import_helper�	os_helper�threading_helper�
MS_WINDOWSN)�
namedtupleztest module requires subprocess�darwin����	_stats_on��l���Py_GIL_DISABLED�t��python�.�os.pyc���[RRU5n[RRU5SnUR	5RSR	55$)Nr�_d)�os�path�basename�splitext�casefold�endswith)�program�names  �$C:\Python313\\Lib\test\test_embed.py�debug_buildr!>sL���g�g���w�'�G�
�7�7���G�$�Q�'�D��=�=�?�#�#�D�M�M�O�4�4�c��[[R5n[U5HnUR	S5(dMX	M U$)N�PYTHON)�dictr�environ�list�
startswith)�env�keys  r �remove_python_envvarsr+Ds9��
�r�z�z�
�C��C�y���>�>�(�#�#�����Jr"c�<�\rSrSrSrSrSSSSSS.SjrSrS	rg)
�EmbeddingTestsMixin�Mc�,�Sn[RR[R5n[
(a,[
[R5(aSOSS-nX-
nUnO [RRUS5n[RRXA5=Uln[RRU5(dURSU-5 [R"5Ul[R"U5 g)N�
_testembedrr�.exe�Programsz%r doesn't exist)rr�dirname�sys�
executablerr!�join�test_exe�exists�skipTest�getcwd�oldcwd�chdir)�self�exename�builddir�ext�exepath�exes      r �setUp�EmbeddingTestsMixin.setUpNs������7�7�?�?�3�>�>�2���:�&�s�~�~�6�6�4�B�&�H�C��N�G��G��g�g�l�l�8�Z�8�G� �g�g�l�l�7�<�<��
���w�w�~�~�c�"�"��M�M�,�s�2�3��i�i�k���
����r"c�D�[R"UR5 g�N)rr<r;�r=s r �tearDown�EmbeddingTestsMixin.tearDown`s��
������r"Nr)r)�timeout�
returncode�input�cwdc	��UR/nURU5 Ub1[(a&UR5n[R
SUS'[R"U[R[RSUUS9nURXBS9up�URU:waK[R(a6[SUS35 [SU	35 [SU
35 [S	5 UR!URUS
URU
4-5 X�4$! UR5 UR5 e=f)N�
SYSTEMROOTT)�stdout�stderr�universal_newlinesr)rM)rLrJz--- z failed ---zstdout:
zstderr:
z------zbad returncode %d, stderr is %r)r7�extendr�copyrr&�
subprocess�Popen�PIPE�communicate�	terminate�waitrKr�verbose�print�assertEqual)r=r)rJrKrLrM�args�cmd�p�out�errs           r �run_embedded_interpreter�,EmbeddingTestsMixin.run_embedded_interpretercs���}�}�o���
�
�4���?�z�z��(�(�*�C� "�
�
�<� 8�C������S�$.�O�O�$.�O�O�04�!$�!$�
&��	����U��D�J�S�

�<�<�:�%�'�/�/��D���[�)�*��I�c�U�#�$��I�c�U�#�$��(�O�������z�:��,�,��,�-�	.��x���	�
�K�K�M�
�F�F�H��s�	D$�$#Ec#�f# �URS5upURUS5 Sn[SS5nSn/nUR5GHanUSR	U5:XaAUR[U5S5 [RS:�a[U5 US-
nMZUR[U5S	5 [R"X75nUcURXs5 U"UR56n	[RS
:�a[U	5 URU	R5 URU	R 5 URU	R"5 UR%U	5 [U5S	:XdGMEUSn
URX�5 Uv� /nGMd g7f)N�&test_repeated_init_and_subinterpretersrzS^interp (\d+) <(0x[\dA-F]+)>, thread state <(0x[\dA-F]+)>: id\(modules\) = ([\d]+)$�Interpzid interp tstate modulesrz--- Pass {} ---r�r
)rcr]r�
splitlines�format�lenrr[r\�
assertLess�re�match�assertRegex�groups�
assertTrue�interp�tstate�modules�append)r=rarb�
interp_patrg�numloops�current_run�linernrr�mains           r �%run_repeated_init_and_subinterpreters�9EmbeddingTestsMixin.run_repeated_init_and_subinterpreters�si����0�0�1Y�Z�������b�!�2�
��H�&@�A�������N�N�$�D��(�/�/��9�9�� � ��[�!1�1�5��?�?�Q�&��$�K��A�
����O�O�C��,�a�0��H�H�Z�.�E��}�� � ��2��U�\�\�^�,�F�����"��f�
��O�O�F�M�M�*��O�O�F�M�M�*��O�O�F�N�N�+����v�&��;��1�$�"�1�~��� � ��.�!�!� ��;%�s�FF1�"F1)r;r7)	�__name__�
__module__�__qualname__�__firstlineno__rCrHrcr{�__static_attributes__�r"r r-r-Ms&���$�37�)-�!�4�%)�!�F2!r"r-c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSr\R,\R0"\R2S5S55rSrSrSrSr\S\ S\ S\ 4Sj5r!Sr"g)�EmbeddingTests�i�c�t�UR5H$nUSnURURS5 M& g)Nr�0)r{r]�id)r=�runrzs   r �test_subinterps_main�#EmbeddingTests.test_subinterps_main�s3���=�=�?�C��q�6�D����T�W�W�c�*�@r"c	���UR5H[nUGtp#n[UR5n[U5H/upgUR	UR[XV-S-55 M1 M] g)Nr)r{�intr��	enumerater]�str)r=r�rz�subs�_�mainid�i�subs        r �test_subinterps_different_ids�,EmbeddingTests.test_subinterps_different_ids�s[���=�=�?�C� �N�D������\�F�#�D�/���� � �����V�Z�!�^�)<�=�*�	@r"c�j�UR5H�nUGtp#nSU;a[R"S5eUHunURURUR5 URUR
UR
5 URURUR5 Mw M� g)N�0x0zplatform prints pointers as 0x0)r{�unittest�SkipTest�assertNotEqualrrrsrt)r=r�rzr�r�r�s      r �test_subinterps_distinct_state�-EmbeddingTests.test_subinterps_distinct_state�s����=�=�?�C� �N�D����}�
�'�'�(I�J�J����#�#�C�J�J����<��#�#�C�J�J����<��#�#�C�K�K����>��@r"c���URS5upURUS5 [S[S-5Vs/sH	nSUS3PM nnSR	U5S-nURX5 gs snf)N�test_repeated_init_and_inittabrrz	--- Pass z ---�
)rcr]�range�
INIT_LOOPSr6)r=rarbr��liness     r r��-EmbeddingTests.test_repeated_init_and_inittab�sv���0�0�1Q�R�������b�!�.3�A�z�!�|�.D�E�.D��9�Q�C�t�$�.D��E��	�	�%� �4�'������$��Fs�A3c�r�URS5upURUS5 URUS5 g)N�!test_inittab_submodule_multiphaserz�<module 'mp_pkg.mp_submod' (built-in)>
<module 'mp_pkg.mp_submod' (built-in)>
Hello from sub-module
mp_pkg.mp_submod.mp_submod_exec_slot_ran='yes'
mp_pkg.mp_pkg_exec_slot_ran='yes'
�rcr]�r=rarbs   r r��0EmbeddingTests.test_inittab_submodule_multiphase�s:���0�0�1T�U�������b�!�����?�	r"c��URS5upURURUS5S5 URUS5 g)N�"test_inittab_submodule_singlephase�sp_pkgrzd<module 'sp_pkg.sp_submod' (built-in)>
<module 'sp_pkg.sp_submod' (built-in)>
Hello from sub-module
)rcr]�_nogil_filtered_errr�s   r r��1EmbeddingTests.test_inittab_submodule_singlephase�sG���0�0�1U�V�������1�1�#�x�@�"�E�����3�	r"c�^�[[RSS9nURSUS9up#[R
S:�a [
5 [
U5 [
U5 SnSnSR/S	Q5nURUUUS
9nSUl	URUR5U5 g)Nzutf-8:surrogateescape)�PYTHONIOENCODING�test_forced_io_encoding�r)r�utf-8�surrogateescaper�)z--- Use defaults ---�Expected encoding: default�Expected errors: defaultzstdin: {in_encoding}:{errors}zstdout: {out_encoding}:{errors}�'stderr: {out_encoding}:backslashreplacez--- Set errors only ---r�zExpected errors: ignorezstdin: {in_encoding}:ignorezstdout: {out_encoding}:ignorer�z--- Set encoding only ---�Expected encoding: iso8859-1r�zstdin: iso8859-1:{errors}zstdout: iso8859-1:{errors}�"stderr: iso8859-1:backslashreplacez--- Set encoding and errors ---r�zExpected errors: replacezstdin: iso8859-1:replacezstdout: iso8859-1:replacer�)�in_encoding�out_encoding�errors)r%rr&rcrr[r\r6rj�maxDiffr]�strip)r=r)rarb�expected_stream_encoding�expected_errors�expected_outputs       r r��&EmbeddingTests.test_forced_io_encoding�s����2�:�:�0G�H���0�0�1J�PS�0�T����?�?�Q���G��#�J��#�J�#*� �+���)�)�%.�/��2*�0�0�,D�-E�'6�1�8��
����������o�6r"c��[[R[RR	[
R5S9nURSUS9up#[RS:�a [5 [U5 [U5 [(a
URnO3[RR	[R"5S5nSUS3nURXR5 URUS5 g)	N)�
PYTHONPATH�test_pre_initialization_apir�r�spamzsys.executable: r�r)r%rr&�pathsepr6r4rrcrr[r\rr7r:�assertInr])r=r)rarb�
expected_pathr�s      r r��*EmbeddingTests.test_pre_initialization_api(s���
�2�:�:�"�*�*�/�/�#�(�(�*C�D���0�0�1N�TW�0�X����?�?�Q���G��#�J��#�J��:� �M�M�M��G�G�L�L�����f�=�M�,�]�O�2�>���
�
�o�+�����b�!r"c�N�[5n[RR[R
5US'UR
SUS9up#[RS:�a [5 [U5 [U5 SnURXB5 URUS5 g)Nr��#test_pre_initialization_sys_optionsr�rz�sys.warnoptions: ['once', 'module', 'default']
sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}
warnings.filters[:3]: ['default', 'module', 'once']
r)r+rr�r6r4rrcrr[r\r�r])r=r)rarbr�s     r r��2EmbeddingTests.test_pre_initialization_sys_options;s���
$�%���J�J�O�O�C�H�H�5��L���0�0�=�3�1�H����?�?�Q���G��#�J��#�J�
D�	�
	
�
�
�o�+�����b�!r"c�r�URS5upURUS5 URUS5 g)N�
test_bpo20891rr�r�s   r r��EmbeddingTests.test_bpo20891Ps6��
�0�0��A�������b�!�����b�!r"c�r�URS5upURUS5 URUS5 g)N�test_initialize_twicerr�r�s   r r��$EmbeddingTests.test_initialize_twiceYs7��
�0�0�1H�I�������b�!�����b�!r"c��URS5upURUR5S5 URUS5 g)N�test_initialize_pymainz6Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']r�rcr]�rstripr�s   r r��%EmbeddingTests.test_initialize_pymainbs>���0�0�1I�J����������'_�`�����b�!r"c��URS5upURUR5S5 URUS5 g)N�
test_run_mainz%Py_RunMain(): sys.argv=['-c', 'arg2']rr�r�s   r r��EmbeddingTests.test_run_mainjs;���0�0��A����������'N�O�����b�!r"c�|�SnURS5up#URUSU-5 URUS5 g)Nrh�test_run_main_loopz&Py_RunMain(): sys.argv=['-c', 'arg2']
rr�)r=�nlooprarbs    r r��!EmbeddingTests.test_run_main_looposB�����0�0�1E�F�������G�%�O�P�����b�!r"c���[R"S5n[USS9nUR5nSSS5 UR	SW5upEURUS[-5 g!,(df   N<=f)Nz_test_embed_structseq.pyr���encoding�test_repeated_init_exec�
Tests passed
)r�findfile�open�readrcr]r�)r=�script�fp�coderarbs      r �test_finalize_structseq�&EmbeddingTests.test_finalize_structseqwse���!�!�"<�=��
�&�7�
+�r��7�7�9�D�,��0�0�1J�D�Q�������.��;�<�,�
+�s�A(�(
A6c�\�URS5upURUS[-5 g)N�test_repeated_simple_initz
Finalized
�rcr]r�r�s   r �test_simple_initialization_api�-EmbeddingTests.test_simple_initialization_api�s,���0�0�1L�M�������m�j�8�9r"zrequires test modulesc��[R"S5nURnU"SU5up4URUS[-5 g)Na            import dis
            import importlib._bootstrap
            import opcode
            import test.test_dis

            def is_specialized(f):
                for instruction in dis.get_instructions(f, adaptive=True):
                    opname = instruction.opname
                    if (
                        opname in opcode._specialized_opmap
                        # Exclude superinstructions:
                        and "__" not in opname
                    ):
                        return True
                return False

            func = importlib._bootstrap._handle_fromlist

            # "copy" the code to un-specialize it:
            func.__code__ = func.__code__.replace()

            assert not is_specialized(func), "specialized instructions found"

            for i in range(test.test_dis.ADAPTIVE_WARMUP_DELAY):
                func(importlib._bootstrap, ["x"], lambda *args: None)

            assert is_specialized(func), "no specialized instructions found"

            print("Tests passed")
        r�r���textwrap�dedentrcr]r�)r=r�r�rarbs     r �>test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE�MEmbeddingTests.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE�sI��
��� �
��>�+�+���0�$�7�������.��;�<r"c�b�SnURSU5up#URUS[-5 g)Nzprint('\N{digit nine}')r�z9
r��r=r�rarbs    r �test_ucnhash_capi_reset�&EmbeddingTests.test_ucnhash_capi_reset�s1��)���0�0�1J�D�Q�������e�j�0�1r"c�b�SnURSU5up#URUS[-5 g)Nzdimport datetime;d = datetime.datetime.strptime('2000-01-01', '%Y-%m-%d');print(d.strftime('%Y%m%d'))r�z	20000101
r�r�s    r �test_datetime_reset_strptime�+EmbeddingTests.test_datetime_reset_strptime�s8��
*�	
�
�0�0�1J�D�Q�������l�Z�7�8r"c��[R"S5n0n[XU5 USnAU[R"S5-
nURSX5upEUR	S5SSnUVs/sHowRS5SPM nnSUl[USS	9H�up�[R"U	5n
UR5H?up�URX�S
9 U
RU5n
URX�5 SSS5 MA URU
05 M� URUS5 gs snf!,(df   M�=f)Na 
            import test.support

            results = {}
            def add(cls, slot, own):
                value = getattr(cls, slot)
                try:
                    subresults = results[cls.__name__]
                except KeyError:
                    subresults = results[cls.__name__] = {}
                subresults[slot] = [repr(value), own]

            for cls in test.support.iter_builtin_types():
                for slot, own in test.support.iter_slot_wrappers(cls):
                    add(cls, slot, own)
            �resultsz�
            import json
            import sys
            text = json.dumps(results)
            print(text, file=sys.stderr)
            r�z
--- Loop #rz ---
���)�start)�loop�clsr)r�r��execrc�split�
rpartitionr�r��json�loads�items�subTest�popr])r=r��ns�all_expectedrarbr�resr��text�result�	classname�expected�slotss              r �!test_static_types_inherited_slots�0EmbeddingTests.test_static_types_inherited_slots�s=�����"���"���V����)�}����(�/�/�#��	���0�0�)�6�;����)�)�L�)�!�"�-��;B�C�7�C�>�>�(�+�B�/�7��C���� ���2�G�A��Z�Z��%�F�'3�'9�'9�';�#�	��\�\�q�\�8�"�J�J�y�1�E��$�$�U�5�9�8�(<�
���V�R�(�
3�	
����b�!��D�9�8�s�0D7�#D<�<
Ec��[R"S5nURSU5up#URUS[-5 g)Na�
            try:
                import _ssl
            except ModuleNotFoundError:
                _ssl = None
            if _ssl is not None:
                _ssl.txt2obj(txt='1.3')
            print('1')

            import _queue
            _queue.SimpleQueue().put_nowait(item=None)
            print('2')

            import _zoneinfo
            _zoneinfo.ZoneInfo.clear_cache(only_keys=['Foo/Bar'])
            print('3')
        r�z1
2
3
r�r�s    r � test_getargs_reset_static_parser�/EmbeddingTests.test_getargs_reset_static_parser�sC����� �
��"�0�0�1J�D�Q�������k�J�6�7r"rb�mod_name�returnc���[R(dU$SUS3nUR5R5Vs/sHnX#;dM
UPM nnSR	U5$s snf)NzSRuntimeWarning: The global interpreter lock (GIL) has been enabled to load module '�'r�)rrr�rir6)rbr�expected_runtime_warningry�filtered_err_liness     r r��"EmbeddingTests._nogil_filtered_errst���&�&��J�

1�19�
�!�
=�	!��	�	��.�.�0�
�0��'�3�
�0�	�
�
�y�y�+�,�,��
s�	A$�A$)r�N)#r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�requires_specializationr��
skipUnless�TEST_MODULES_ENABLEDr�r�r�rr�staticmethodr�r�r�r�r"r r�r��s����G�+�>�?�*%�	��)7�V"�&"�*"�"�"�"�
"�
=�:�
�$�$�
����5�5�7N�O�$=�P�%�$=�L2�9�*"�X8�.�-��-��-��-��-r"r��requires _testinternalcapic�R�\rSrSrSr\(aSOSr\"5r\"5r	\
\SSSSSS.r\(a\RSS05 \"\\S\\S	9r\"\\SSSSSSS
9r/SQr0S\
_S
S_SS_SS_SS_SS_SS_S\R*R,_SS_SS_SS_SS_SS_SS_SS_SS_SS _0S!S_S"\_S#\_S$S _S%\_S&S_S'S(/_S)/_S*/_S+/_S,S _S-S _S.\_S/\_S0\_S1\_S2\_E0S3\_S4\_S5S_S6\R._S7\_S8S_S9S_S:S_S;S_S<S_S=S_S>S_S?S_S@S_SAS_SBS_SCS_ES\\SS S S S SSDSS\R2(+S\	SE.Er\(aS\SF'\R2(aS \SG'\R8(aS\SH'\(a\RSIS05 \"\\SSSJ9r\"\\SSSSSSSSSSSSK9
r\(aS\SI'SSSSL.rSM/r /SNQr!\(a"\ RESO5 \!RESP5 S r#\$SQ5r%SRr&SSr'STr(S�SUjr)SVr*SWr+SXr,S�S S SS SY.SZjjr-S[r.S\r/S]r0S^r1S_r2S`r3Sar4Sbr5Scr6Sdr7Ser8Sfr9Sgr:Shr;Sir<Sjr=Skr>Slr?Smr@SnrA\BR�"So5Sp5rDSqrESrrFSsrGStrHSurISvrJSwrKSxrLS�SyjrM\NR�S�Szj5rPS{rQS|rRS}rS\BR�"\S~5S5rU\BR�"\S�5S�5rWS�rX\BR�"\S�5S�5rYS�rZS�r[S�r\S�r]S�r^S�r_\`R�"5S�5rbS�rcg )��InitConfigTestsii�
surrogatepassr�rr)�_config_init�	allocator�
parse_argv�configure_locale�coerce_c_locale�coerce_c_locale_warn�	utf8_mode�legacy_windows_fs_encoding)r)r+r-r/)r)r,�isolated�use_environmentr/�dev_moder-)r3r1r2r)r1Fr2Tr3�install_signal_handlers�
use_hash_seed�	hash_seed�int_max_str_digits�	cpu_countr�faulthandler�tracemalloc�perf_profiling�import_time�code_debug_ranges�show_ref_count�	dump_refs�dump_refs_fileN�malloc_stats�filesystem_encoding�filesystem_errors�pycache_prefix�program_namer+�argvr�	orig_argv�xoptions�warnoptions�pythonpath_env�homer5�base_executable�prefix�base_prefix�exec_prefix�base_exec_prefix�module_search_paths�module_search_paths_set�
platlibdir�
stdlib_dir�site_import�
bytes_warning�warn_default_encoding�inspect�interactive�optimization_level�parser_debug�write_bytecoder[�quiet�user_site_directory�configure_c_stdio�default)�buffered_stdio�stdio_encoding�stdio_errors�skip_source_first_line�run_command�
run_module�run_filename�
sys_path_0�_install_importlib�check_hash_pycs_mode�pathconfig_warnings�
_init_main�use_frozen_modules�	safe_path�_is_python_build�_pystats�run_presite�
enable_gil�legacy_windows_stdio)r)r_r+)r)r1r2r^rnr3r4r5r9r:r;rk)�Py_HasFileSystemDefaultEncoding�Py_HashRandomizationFlag�$_Py_HasFileSystemDefaultEncodeErrors)�Py_UTF8Moder/))�Py_BytesWarningFlagrV)�Py_DebugFlagr[)�Py_DontWriteBytecodeFlagr\T)� Py_FileSystemDefaultEncodeErrorsrC)�Py_FileSystemDefaultEncodingrB)�
Py_FrozenFlagrkT)�Py_IgnoreEnvironmentFlagr2T)�Py_InspectFlagrX)�Py_InteractiveFlagrY)�Py_IsolatedFlagr1)�
Py_NoSiteFlagrUT)�Py_NoUserSiteDirectoryr^T)�Py_OptimizeFlagrZ)�Py_QuietFlagr])�Py_UnbufferedStdioFlagraT)�Py_VerboseFlagr[))�Py_LegacyWindowsFSEncodingFlagr0))�Py_LegacyWindowsStdioFlagrsc��SUlgrF)�EXPECTED_CONFIG)rs r �
tearDownClass�InitConfigTests.tearDownClass�s��#��r"c�d�0nUH'nSU;aURSS5upEXRU'M#SX#'M) U$)N�=rT)r)r=�
xoptions_listrH�optr*�values      r �
main_xoptions�InitConfigTests.main_xoptions�s?���� �C��c�z� �Y�Y�s�A�.�
�� %��
� $��
�!��r"c��[5n[R"S5n[RSSU/n[
R"X1[
R[
RS9nUR(a'[SUR<SUR<35eURRS5n[R"U5$![Ra UR!SU<35 gf=f)	Na4
            import json
            import sys
            import _testinternalcapi

            configs = _testinternalcapi.get_configs()

            data = json.dumps(configs)
            data = data.encode('utf-8')
            sys.stdout.buffer.write(data)
            sys.stdout.buffer.flush()
        z-S�-c)r)rPrQz)failed to get the default config: stdout=z stderr=r��fail to decode stdout: )r+r�r�r4r5rUr�rWrK�	ExceptionrPrQ�decoderr	�JSONDecodeError�fail)r=r)r�r^�procrPs      r �_get_expected_config_impl�)InitConfigTests._get_expected_config_impl�s���#�%����� �
������d�D�1���~�~�d�%/�_�_�%/�_�_�6���?�?��&�&*�k�k�_�H�T�[�[�O�M�N�
N����#�#�G�,��	<��:�:�f�%�%���#�#�	<��I�I�/��z�:�;�	<�s�;C�)C=�<C=c�0�[nURcUR5Ul0nURR5HMup40nUR5H.upg[	U[
5(aUR
5nXuU'M0 XRU'MO U$rF)r'r�r�r
�
isinstancer'rT)r=r�configs�
config_key�config_value�configr*r�s        r �_get_expected_config�$InitConfigTests._get_expected_configs��������&�"&�"@�"@�"B�C����(+�(;�(;�(A�(A�(C�$�J��F�*�0�0�2�
���e�T�*�*�!�J�J�L�E�#�s��3�#)�J��
)D��r"c��UR5nUSnUR5Hup�X�RLdMXxX'M US(a
U[:XaSHnURX('M US(dURUS'USS:XafUSURLaSUS'USURLaUR
US'US	URLaSUS	'US
URLaSUS
'[(a
URn
OhUSURLa#[RRUS5n
O3[RR[R"5S
5n
USURLaX�S'USURLaX�S'USURLaSUS'USnUR5Hup�X�RLdMX�X('M USURLaaUSnUb5UR[RR5n
/U
QUSQUS'Ub!USR5US'U"US5 UR HnX�;dM
X(X'M g)N�
pre_configr,)rBrCrbrcr/rrBr�rCrbrcr�rEr0r5rLz./_testembedr�rQrJ)r�r
�GET_DEFAULT_CONFIG�
API_COMPAT�
IGNORE_CONFIG�UTF8_MODE_ERRORSrr7rr�abspathr6r:rr�rT�COPY_PRE_CONFIG)r=�expected_preconfigrr)�api�modify_path_cbr�r�r*r��default_executabler�rJ�pathss              r �get_expected_config�#InitConfigTests.get_expected_configs����+�+�-���\�*�
�,�2�2�4�J�C��/�/�/�*4�/�"�'�5�"�"4�5��
�9J�:�� $� 2� 2��
�:�"�"4�5�/3�.@�.@��{�+��k�*�a�/��-�.�$�2I�2I�I�29��.�/��+�,��0G�0G�G�04�0E�0E��,�-��(�)�T�-D�-D�D�-4��)�*���'�4�+B�+B�B�+<���(��:�!%����
�n�
%�T�-D�-D�
D�!#������.�1I�!J��!#�����b�i�i�k�<�!H���L�!�T�%<�%<�<�%7�\�"��%�&�$�*A�*A�A�*<�&�'��N�#�t�'>�'>�>�'5�H�^�$���"��"�.�.�*�J�C��/�/�/� &���
�+��)�*�$�2D�2D�D�%�&6�7�N��)�&�,�,�R�W�W�_�_�=��2\�E�2\�H�EZ�<[�2\��.�/��)�2:�;P�2Q�2V�2V�2X��.�/��x�(=�>�?��'�'�C��,�*2�-�"�'�(r"c���[US5n[UR55H)upEXPRLdMUR	US5 X$	M+ URX25 g)Nr�)r%r'r
r�rr])r=r�rr�r*r�s      r �check_pre_config� InitConfigTests.check_pre_configWsX���'�,�/�0�
��x�~�~�/�0�J�C��*�*�*����s�D�)��M�1�	
����.r"c���[US5n[(a�URS=n5nU(a�[U[5(axUS[UR
5RS55n[[R5(a+US[UR
5RS55nXSU'[UR55H�upEXPRLaURUS5 X$	[U[[ 45(dMD[URU5[[ 45(dMp[#X45"X$5X$'M� UR%X25 g)Nr�rEr1r)r%r�getr�r�rk�lower�removesuffixr!r4r5r'r
r�r�boolr��typer])r=r�rr�r*r�s      r �check_config�InitConfigTests.check_config_s���g�h�'�(���:��J�J�n�4�s�5�E���E�3�/�/��F�s�5�;�;�=�#=�#=�f�#E�F�G���s�~�~�.�.�!�"H�3�u�{�{�}�'A�'A�$�'G�#H�I�E�#�s���x�~�~�/�0�J�C��*�*�*��
�
�3��%��M��%�$���-�-�*�V�Z�Z��_�t�UX�k�2Z�2Z� $�V�[� 1�(�-� @��
�
1�	
����*r"c�t�USnUSn[UR5nURH2n[U5S:XaUupgnX7(aSOSXF'M(UupgX7XF'M4 URH2n[U5S:XaUupgnX'(aSOSXF'M(UupgX'XF'M4 URUSU5 g)Nr�r�rrr�
global_config)r%�DEFAULT_GLOBAL_CONFIG�COPY_GLOBAL_CONFIGrk�COPY_GLOBAL_PRE_CONFIGr])	r=r�r�r�r�item�
global_key�core_key�opposites	         r �check_global_config�#InitConfigTests.check_global_configqs����\�*�
���"����2�2�3���+�+�D��4�y�A�~�15�.�
�h�,2�,<�q�!��$�'+�$�
�'-�'7��$�
,��/�/�D��4�y�A�~�15�.�
�h�,6�,@�q�a��$�'+�$�
�'1�';��$�
0�	
�����1�8�<r")�
preconfig_apir)�
ignore_stderrrMc�0�[5nUbURU5 UnUcUnU[:Xa
URnO#U[:Xa
UR
nOURnUc0n[U40UD6nUc0nU[:Xa
URn
O#U[:Xa
URn
OURn
[U
40UD6nURUUUXd5 URUX�S9up�UcUS(dSnUb'U	(d URUR5U5 [R "U5nUR'WU5 UR)UU5 UR+U5 U$![R"a UR%SU<35 Nbf=f)N)r)rMr[rr�)r+�update�API_ISOLATED�PRE_CONFIG_ISOLATED�
API_PYTHON�PRE_CONFIG_PYTHON�PRE_CONFIG_COMPATr%�
CONFIG_PYTHON�CONFIG_ISOLATED�
CONFIG_COMPATr�rcr]r�rr	r�r�r�r�r�)r=�testname�expected_configr�r�rQr�r�r)r�rM�new_env�default_preconfig�default_configrarbr�s                 r �check_all_configs�!InitConfigTests.check_all_configs�s���
(�)���?��N�N�3����� ��M��L�(� $� 8� 8��
�j�
(� $� 6� 6�� $� 6� 6���%�!#��!�"3�J�7I�J���"� �O��*��!�/�/�N�
�L�
 �!�1�1�N�!�/�/�N��~�A��A��� � �!3�!0�!$�!$�	6�
�0�0��58�1�C����>�/�)�"<��F���m����S�Z�Z�\�6�2�	9��j�j��o�G�	
���g�'9�:����'�?�3�� � ��)����
�#�#�	9��I�I�/��w�7�8�	9�s�E)�))F�Fc�,�URS[S9 g)N�test_init_initialize_config�r��r�r�rGs r �test_init_default_config�(InitConfigTests.test_init_default_config�s�����<�*��Mr"c�,�URS[S9 g)N�test_preinit_compat_configr�r�rGs r r��*InitConfigTests.test_preinit_compat_config�������;���Lr"c�,�URS[S9 g)N�test_init_compat_configr�r�rGs r r��'InitConfigTests.test_init_compat_config�������8�j��Ir"c�X�SS0nSSSS/SSSSSSSSSS.
nURSX![S	9 g)
Nr/rz./globalvarr�default::BytesWarningr
)
rErUrVrIrXrYrZr\r[r]rar^rk�test_init_global_configr�r��r=�	preconfigr�s   r r��'InitConfigTests.test_init_global_config�s^����
�	�*���3�4���"#�����#$�#$�
�� 	
���8�&�#-�	�	/r"c�f�[SS.n0SS_SS_SS_S	S
_SS_SS_S
S_SS_SS_SS_SS_SS_SS_SSS/_S/SQ_SS_S/SQ_0S /S!Q_S"S#_S$S_S%S_S&S_S'S_S(S
_S)S_S*S_S+S_S,S_S-S_S.S_S/S_S0S1_S2UR_S3S_ES4S5S6SS7.En[(aSUS8'URS9X![S:9 g);Nr�r*r/r4Fr5Tr6�{r:r
r;r<r=r>rArb�	iso8859-1rc�replacerD�conf_pycache_prefixrEz./conf_program_namerFr��arg2rG)�python3�-W�cmdline_warnoption�-X�cmdline_xoptionr��passr�r+rH)zconfig_xoption1=3zconfig_xoption2=�config_xoption3r�rI)r�r��config_warnoptionre�pass
rUrVrXrYrZr\r[r]r_rar^r9rS�
my_platlibdirrQrniizi��always)r7r8rjrkrp�test_init_from_configr���ALLOCATOR_FOR_CONFIGr��Py_STATSr�r�r�s   r r�%InitConfigTests.test_init_from_config�s!��-��
�	�8
�%�u�8
��T�8
�
��8
�
�1�	8
�

�e�8
�
�4�
8
�
 ��8
�
�d�8
�
�D�8
�
�k�8
�
�I�8
�
�3�8
�
�1�8
� 
�T�6�N�!8
�"
�"�#8
�,
�$�-8
�.
��/8
�:
��;8
�D
�8�E8
�H
�5�I8
�J
�Q�K8
�L
�t�M8
�N
�4�O8
�P
!�!�Q8
�R
�e�S8
�T
�q�U8
�V
�T�W8
�X
 ��Y8
�Z
�e�[8
�\
"�5�]8
�^
�D�_8
�`
�/�a8
�b
"�4�#5�#5�c8
�d
��e8
�f#(��$,�#(�o8
��r�8�!"�F�:�����6��#-�	�	/r"c���S[0n0SS_SS_SS_SS	_S
S_SS	_SS_S
S_SS_SS_SS_SS	_SS_SS	_SS_SS_SS	_SS/SURSSS.En[(aSUS 'URS!X![S"9 g)#Nr*r5Tr6�*r:r
r;Fr<r=rArXrZrJ�/my/pathrD�env_pycache_prefixr\r[rrarbr�rcr�r^�EnvVar�env_platlibdir���r9rIrSrQrnr7rp�test_init_compat_envr�rr�s   r r�$InitConfigTests.test_init_compat_env s,���-�
�	�
��T�
���
�
�1�
�
�e�	
�

�4�
�
 ��

�
�D�
�
�t�
�
!�!�
�
�j�
�
�2�
�
�e�
�
�q�
�
�e�
�
�k�
� 
�I�!
�"
"�5�#
�$!�$�:�*�#'�#5�#5��"&�/
��2�8�!"�F�:�����5�v�#-�	�	/r"c���[SS.n0SS_SS_SS_S	S
_SS_SS
_S
S_SS_SS_SS_SS_SS
_SS_SS
_SS_SS_SS
_SS/SURSSS.En[(aSUS 'URS!X![S"9 g)#Nrr�r5Tr6rr:r
r;Fr<r=rArXrZrJrrDr
r\r[rarbr�rcr�r^rrrrrp�test_init_python_envr�)rr�rr�r�r�s   r r�$InitConfigTests.test_init_python_envBs,��-��
�	�
��T�
���
�
�1�
�
�e�	
�

�4�
�
 ��

�
�D�
�
�t�
�
!�!�
�
�j�
�
�2�
�
�e�
�
�q�
�
�e�
�
�k�
� 
�I�!
�"
"�5�#
�$!�$�:�*�#'�#5�#5��"&�/
��2�8�!%�F�:�����5�v�#-�	�	/r"c�`�[[S9n[SSS/S9nURSX![S9 g)N�r*rr`�r3r9rI�test_init_env_dev_moder�)r%�PYMEM_ALLOCATOR_DEBUGr�r�r�s   r r�&InitConfigTests.test_init_env_dev_modees>���#8�9�	��q�#$�#,�+�/��	
���7��#-�	�	/r"c�`�[[S9n[SSS/S9nURSX![S9 g)Nrrr`r�test_init_env_dev_mode_allocr�)r%rr�r�r�s   r r�,InitConfigTests.test_init_env_dev_mode_allocms>���#7�8�	��q�#$�#,�+�/��	
���=�v�#-�	�	/r"c�L�S[0nSSS/S.nURSX![S9 g)Nr*Tr`)r9r3rI�test_init_dev_moder�)rr�r�r�s   r r!�"InitConfigTests.test_init_dev_modeus@���.�
�	�!��%�;�
��
	
���3�V�#-�	�	/r"c	��S[0nS//SQ[RRS5SSS/S/SS.nUR	SX![
S	9 g)
Nr*�	script.py)r�r��dev�-Pr$Tr`r%)rFrGrgr3r9rIrHrn�test_preinit_parse_argvr�)rrrr�r�r�r�s   r r'�'InitConfigTests.test_preinit_parse_argv�sb��
�.�
�	�!�M�D��G�G�O�O�K�8�� �%�;����	
��	
���8�&�#-�	�	/r"c�J�SS0n/SQnUUSS.nURSX1[S9 g)Nr1r)	r��-E�-Ir&r�r%r��utf8r$)rFrGr1�test_preinit_dont_parse_argvr��r�r�)r=r�rFr�s    r r-�,InitConfigTests.test_preinit_dont_parse_argv�sF��
��
�	������
��
	
���=�v�#/�	�	1r"c�<�SSSSS.nURSU[S9 g)NTF�r1rnr2r^�test_init_isolated_flagr��r�r��r=r�s  r r2�'InitConfigTests.test_init_isolated_flag�s-����$�#(�	
��	
���8�&�j��Qr"c�<�SSSSS.nURSU[S9 g)NTFr1�test_preinit_isolated1r�r�r4s  r r7�&InitConfigTests.test_preinit_isolated1��/����$�#(�	
��	
���7��Z��Pr"c�<�SSSSS.nURSU[S9 g)NTFr1�test_preinit_isolated2r�r�r4s  r r;�&InitConfigTests.test_preinit_isolated2�r9r"c�,�URS[S9 g)N�test_preinit_isolated_configr�r.rGs r r>�,InitConfigTests.test_preinit_isolated_config�s�����=�<��Pr"c�,�URS[S9 g)N�test_init_isolated_configr�r.rGs r rA�)InitConfigTests.test_init_isolated_config�s�����:���Mr"c�,�URS[S9 g)N�test_preinit_python_configr�r3rGs r rD�*InitConfigTests.test_preinit_python_config�r�r"c�,�URS[S9 g)N�test_init_python_configr�r3rGs r rG�'InitConfigTests.test_init_python_config�r�r"c�:�SSS.nURS0U[S9 g)Nr)r,r-�test_init_dont_configure_localer�r3)r=r�s  r rJ�/InitConfigTests.test_init_dont_configure_locale�s0��!"� �
�	�	
���@�"�i�#-�	�	/r"zSas of 3.11 this test no longer works because path calculations do not occur on readc�B�SSSS.nSnURSU[US9 g)Nz./init_read_set�
my_executable)rEr5rLc�J�URSS5 URS5 g)Nr�test_path_insert1�test_path_append)�insertru)rs r �modify_path�7InitConfigTests.test_init_read_set.<locals>.modify_path�s���K�K��.�/��K�K�*�+r"�test_init_read_set)r�r�r3)r=r�rRs   r rT�"InitConfigTests.test_init_read_set�s9��.�)�.�
��
	,�	
���3�V�#-�.9�	�	;r"c�H�S/SQ/SQ/SQS.nURSU[S9 g)Nr)�config_xoptionr��sysadd_xoptionr9)�ignore:::cmdline_warnoptionzignore:::sysadd_warnoptionzignore:::config_warnoption)r�r�rYr�r�)r9rHrIrG�test_init_sys_addr�r3r4s  r rZ�!InitConfigTests.test_init_sys_add�s3�����
3�
��"	
���2�F�
��Kr"c�V�SnSS/SSUS/SUS-SSS	.nURS
U[S9 g)N�Rimport _testinternalcapi, json; print(json.dumps(_testinternalcapi.get_configs()))r�r�r��	./python3r�Tr)rFrGrErer+rh�test_init_run_mainr�r3�r=r�r�s   r r_�"InitConfigTests.test_init_run_main�sN��E���6�N�#�T�4��8�'��$�;���

��	
���3�V���Lr"c�Z�SnSS/SSUS/SUS-SSS	S
.nURSU[SS
9 g)Nr]r�r�r�r^r�Trr)rFrGrErer+rlrh�test_init_mainz)Run Python code before _Py_InitializeMain)r�rQr3r`s   r rc�InitConfigTests.test_init_mains`��E���6�N�#��� �"�(��$�;����

��	
���/��#-�&Q�	�	Sr"c�H�S/SQ/SQSSSS.nURSU[S	9 g)
NT)r��arg1�-v�arg3��./argv0r*r�r�rfrgrhrjrF)r+rFrGrErer2�test_init_parse_argvr�r3r4s  r rk�$InitConfigTests.test_init_parse_argvs3���0�N�%�#�$�

��	
���5�v�:��Nr"c�L�SS0nS/SQ/SQSS.nURSX![S9 g)	Nr+rFrirj)r+rFrGrE�test_init_dont_parse_argvr�r3)r=r�r�s   r rn�)InitConfigTests.test_init_dont_parse_argv%s@���!�
�
� �I�N�%�	
��	
���:�F�#-�	�	/r"c���[(aSnURnO9Sn[(a
URnO[R"U5=(d SnURUUUS.5 g)Nrr�r)rErLr5)rr7�MACOS�shutil�whichr�)r=r�rEr5s    r �default_program_name�$InitConfigTests.default_program_name2sU���:�#�L����J�$�L��u�!�]�]�
�#�\�\�,�7�=�2�
��
�
�(�)�$�
�	r"c���UR5nUSSnUSSSSSS.nURU5 S[RRRU50nUR
SU[USS9 g)	Nr�rQr)rQrMrNrOrPrT�TESTPATH�test_init_setpathT�r�r)r�)r�rtrrr�r6r�r��r=r�r�r)s    r rx�!InitConfigTests.test_init_setpathBs����*�*�,���x� �!6�7��$)���� "��	
��	
�!�!�&�)��2�7�7�?�?�/�/��6�7�����2�F�#-�3�-1�	�	3r"c��UR5nUSSnUSSSSS[R(+SSSS.
nS[RR
R
U50nURSU[US	S
9 g)Nr�rQr�conf_program_name�conf_executable)
rQrMrNrOrPrTrmrErLr5rw�test_init_setpath_configTry)	r�r�Py_DEBUGrrr�r6r�r�rzs    r r�(InitConfigTests.test_init_setpath_configXs����*�*�,���x� �!6�7��$)���� "��&-�&6�&6�"6�/�0�+�
�� �2�7�7�?�?�/�/��6�7�����9�6�#-�3�d�	�	Lr"c�n�UR5nUcUSSnUcUSSn[(aUSS$[Rn[R
R
U[RSURUR[S35[R
R
U[RSURSUR[35[R
R
U[RSURSUR[3S5/$)Nr�rMrQrz.zipr�lib-dynload)r�rr4�version_inforrr6rS�major�minor�
ABI_THREAD)r=rMrOr��vers     r rQ�#InitConfigTests.module_search_pathsqs���*�*�,���>��H�%�h�/�F��� ��*�8�4�K��:��(�#�$9�:�:��"�"�C������V�S�^�^�%�c�i�i�[�����J�<�t�L�N������V�S�^�^�%�c�i�i�[��#�)�)��Z�L�I�K������[�#�.�.�%�c�i�i�[��#�)�)��Z�L�I�=�Z��
r"c	#�# �[R"5n[RR	U5nU(aR[RR[RR
X!55n[R"U5 [(a�SSK	n[RRUR5n[R"U5HmnURUS5(dM[R"[RR
XE5[RR
X%55 Mo [RR
U[RRUR55n[R"URU5 [R "URU5 X`lUv� SSS5 g!,(df   g=f7f)Nrz*.dll)�tempfile�TemporaryDirectoryrr�realpath�normpathr6�makedirsr�fnmatchr3r7�listdirrr�copyfiler�copystat)r=�subdir�tmpdirr��exedir�f�	exec_copys       r �tmpdir_with_python�"InitConfigTests.tmpdir_with_python�s'����
(�
(�
*�f��W�W�%�%�f�-�F�����)�)�"�'�'�,�,�v�*F�G�����F�#��z����������7�����F�+�A����q�'�2�2���������V�(?������f�AX�Y�,�
�����V�R�W�W�-=�-=�d�m�m�-L�M�I��O�O�D�M�M�9�5��O�O�D�M�M�9�5�%�M��L�/+�
*�
*�s$�G=�CG,�;C(G,�#	G=�,
G:�6G=c	���UR5nUSSn[RRR	U5nUH�n[RRU5(dM)[RR
[RR	US55(dMm[RRU5n O URSU<35 W=pg[(aG[RR	US5nUS[RR	US5U/n	O~[RRS[RR3n
[RR	U[RS	U
[35nUR!XUS
9n	UU	UUUUUUS.nUR#U5 XSS.nUR%S
U[&US9 g)Nr�rQr�Unable to find home in �Libr�DLLsrr�rMrO�rKrQrMrNrOrPrJrT��TESTHOMEr��test_init_setpythonhome�r�r))r�rrr�r6�isdirr8r3r�rr4r�r�r�rSr�rQrtr�r�)r=r�r��	paths_strrrKrMrO�stdlib�expected_paths�versionr)s            r r��'InitConfigTests.test_init_setpythonhome�s����*�*�,���x� �!6�7���G�G�O�O�(�(��/�	��D��7�7�=�=��&�&���w�w�~�~�b�g�g�l�l�4��9�:�:��w�w���t�,����
�I�I�/��y�9�:�#�#���:��W�W�\�\�$��.�F�$�A�h������T�6�(B�F�K�N��)�)�/�/�0��#�2B�2B�2H�2H�1I�J�G��W�W�\�\�$����&��	�*��8V�W�F�!�5�5�T�5�T�N��#1��!�&� +�'� �	
��	
�!�!�&�)��9�����8�&�#-�3�	�	8r"c	�T�UR5nUSSn[RRR	U5nUH�n[RRU5(dM)[RR
[RR	US55(dMm[RRU5n O URSU<35 W=pg[(aG[RR	US5nUS[RR	US5U/n	O~[RRS[RR3n
[RR	U[RS	U
[35nUR!XUS
9n	UU	UUUUUUS.nXSS.nS
US'SUS'UR#SU[$US9 SUS'SUS'[RR[R&5n[)[RR	US5SS9n
[RR+[RR	X�R-5S3R/5S55U	[(aSOS'SSS5 [(d6[R0=pgUR!US9SU	S'UR3XfXwS9 UR#SU[$US9 g!,(df   Nf=f)Nr�rQrr�r�rr�rrr�r�r��1�NEGATIVE_ISPYTHONBUILDro�test_init_is_python_buildr�r�r�pybuilddir.txtr,r�z
$r
)rM)rMrNrOrP)r�rrr�r6r�r8r3r�rr4r�r�r�rSr�rQr�r�r5r�r�r�rirMr�)r=r�r�r�rrKrMrOr�r�r�r)r�r�s              r �#test_init_is_python_build_with_home�3InitConfigTests.test_init_is_python_build_with_home�s����*�*�,���x� �!6�7���G�G�O�O�(�(��/�	��D��7�7�=�=��&�&���w�w�~�~�b�g�g�l�l�4��9�:�:��w�w���t�,����
�I�I�/��y�9�:�#�#���:��W�W�\�\�$��.�F�$�A�h������T�6�(B�F�K�N��)�)�/�/�0��#�2B�2B�2H�2H�1I�J�G��W�W�\�\�$����&��	�*��8V�W�F�!�5�5�T�5�T�N��#1��!�&� +�'� �	
�� �9��(+��$�%�%&��!�"����:�F�#-�3�	�	8�),��$�%�%&��!�"���������0��
�"�'�'�,�,�v�'7�8�6�
J�a�57�W�W�5E�5E������V����z��%5�%@�%@�%B�1�%E�F�6H�N�
�
�1��2�K��z�#&�:�:�-�F� $� 8� 8�� 8� G�� J�N�1���M�M��&1�
�
Q����:�F�#-�3�	�	8�K�
J�s
�
A/L�
L'c��UR5nUSSn[RRR	U5nXAS'SU0nU$)Nr�rQrJr�)r�rrr�r6)r=r��all_configsr�r�r)s      r �copy_paths_by_env�!InitConfigTests.copy_paths_by_envsP���/�/�1���H�%�&;�<���G�G�O�O�(�(��/�	�#,�� ��Y�'���
r"zSee test_init_pybuilddir_win32c
�&�UR5n[R"S5=(d SnSn[RRX5n[RR
[RRXS55n[R"U5 [RRUS5n[USSS9nURU5 SSS5 UR5nXXS	'XHS
'URn	[R"S5[R"S5U	U	UUS
.n
URU
5nURSU
[USUS9 SSS5 g!,(df   N�=f!,(df   g=f)N�VPATHr�libdirr�r��wr,r����rrOrM)rPrNrLr5rQrTr�T�r�r)r�rM)r��	sysconfig�get_config_varrrr6r��mkdirr��writerQr7r�r�r�)r=r��vpathr�r��	stdlibdir�filenamer�rQr5r�r)s            r �test_init_pybuilddir�$InitConfigTests.test_init_pybuilddir
sK���
$�
$�
&�&��,�,�W�5�;��E��F��W�W�\�\�&�1�F����(�(������f�U�)K�L�I��H�H�V���w�w�|�|�F�,<�=�H��h��f�5������ �6�#'�":�":�"<��&/��#�&,��#����J�$-�$<�$<�]�$K�(�7�7��A�#-�(�':�'�
�F��(�(��0�C��"�"�#<�f�'1�s�15�6�
#�
C�9'�
&�6�5��'�
&�s%�B?F�E1�"BF�1
E?	�;F�
FzSee test_init_pybuilddirc
��[R"S5nSn[RR	U5R[R5S:Xa [RRUS5nURU5n[RR	[RRX155n[RR	[RRX1S55n[RRUS5n[USSS	9nURU5 SSS5 UR5n[RRU[RRUS
55US
'X8S'XXS'URn	UUU	U	UUUUS
.n
URU
5nURSU
[ USUS9 SSS5 g!,(df   N�=f!,(df   g=f)Nr�zPCbuild\archr
�instrumentedr�r�r�r,r����r�r)rPrNrLr5rMrOrQrTr�Fr�)r�r�rrr��count�sepr6r�r�r�rQrr7r�r�r�)r=r�r�r�rMr�r�r�rQr5r�r)s            r �test_init_pybuilddir_win32�*InitConfigTests.test_init_pybuilddir_win321s����(�(��1�� ��
�7�7���E�"�(�(����0�A�5��W�W�\�\�&�.�9�F�
�
$�
$�V�
,���W�W�%�%�b�g�g�l�l�6�&A�B�F����(�(������f�U�)K�L�I��w�w�|�|�F�,<�=�H��h��f�5������ �6�#'�":�":�"<��&(�g�g�l�l�6�2�7�7�;K�;K�L_�`b�Lc�;d�&e���#�&,��#�&/��#����J�$*�%�#-�(� �%�':�'�	�F��(�(��0�C��"�"�#<�f�'1�s�16�F�
#�
D�7-�
,�6�5��-�
,�s&�
B%G>�/G-�B#G>�-
G;	�7G>�>
Hc���UR5n[R"5n[Rn[
(dg[RRU[RSURSUR[3S5n[R"U5 O�[RRUS5n[R"U5 [R"[RR[ R"S5[RRUS55 [RRUS5n[%USSS	9n['S
U-US9 ['SUS9 SSS5 UR)5n[
(dWUS
'Oa[RRU[RR+US55U[RRUS5/nUR,n	[RRU[RR+U	55n
Un[.R0"S5UUU
U	US.n[
(aMX,S'X,S'[RRUS5US'[3[ R4(+5US'O0UR6US'[3[ R4(+5US'UR9U5n
UR;SU[<U
SUS9 SSS5 SSS5 g!,(df   GN�=f!,(df   N)=f!,(df   g=f)Nrrr�r�rz
pyvenv.cfgr�r,r�z	home = %s��filez$include-system-site-packages = falserrrM)rNrPrOrLr5rQrNrTrmr�Tr�)r�r�r�r4r�rrrr6rSr�r�r�r�rrr�r�
STDLIB_DIRr�r\rQrr7r�r�r�r�r�r�r�r�)r=r��pyvenv_homer��lib_dynload�
lib_folderr�r�r�r5rLrOr�r)s              r �test_init_pyvenv_cfg�$InitConfigTests.test_init_pyvenv_cfgYs����
$�
$�
&�&�
�
(�
(�
*�k��"�"�C��:� �g�g�l�l�;�+.�>�>�-3�C�I�I�;�a��	�	�{�:�,�+W�+8�:�����K�(��W�W�\�\�+�u�=�
����J�'�����G�G�L�L��!3�!3�W�=��G�G�L�L��W�5��
�w�w�|�|�F�L�9�H��h��f�5���k�K�/�b�9��<�2�F�6��,�,�.�E��:�'��b�	��G�G�L�L�����)9�)9�%��(�)C�D���G�G�L�L��e�4������J� �g�g�l�l�;����8H�8H��8T�U�O�%�K�(�7�7��A�$/�*�#2�(�',�
�F��z�(3�}�%�#.�x� �')�w�w�|�|�K��'G��|�$�/2�w�7G�7G�3G�/H��+�,�(,�'9�'9��|�$�/2�w�7G�7G�3G�/H��+�,��(�(��0�C��"�"�#<�f�'1�s�15�6�
#�
C�q+�'�
&�(6�5��'+�
*��'�
&�s<�M�EM
�,L8�F#M
�'M�8
M�M
�

M	�M�
M)zspecific to Windowsc	���SSSSSS[R"5S34/nURS0[5ES	[RR
R
S
U550ES9up#URUS5 [R"U5nUSSn[X5HuupVnURXv5 M g![Ra URS
U<35 N\f=f)N)z	C:/a. . .�	C:\a. . .)r�r�)z\\?\C:////a////b. . .z\\?\C:\a\b. . .)z//a/b/c. . .�\\a\b\c. . .)r�r�za. . .z\ar�r�c3�*# �UH	oSv� M g7f)rNr�)�.0�cs  r �	<genexpr>�=InitConfigTests.test_getpath_abspath_win32.<locals>.<genexpr>�s���3H�%�Q�a�D�%�s�r�rr�r�rQ)
rr:rcr+rr�r6r]rr	r�r��zip)r=�CASESrarbrr�rrs        r �test_getpath_abspath_win32�*InitConfigTests.test_getpath_abspath_win32�s��
)�(�@�0�4�
�"�)�)�+��c�*�+�

���0�0�)�J�(�*�J��r�w�w���3�3�3H�%�3H�H�J�1�
���
	
����b�!�	9��*�*�S�/�C��h�-� 5�6��%(��%8�!�M�Q�6����V�.�&9��	�#�#�	9��I�I�/��w�7�8�	9�s�C	�	)C5�4C5c�T^	�[R"S5m	U	4SjnU"S5nU"S5nU"S5nU"S5nU"S5nU"S5n[R"5S	nUR	U"5R[RR5US
5 UR	U"5US5 UR	U"5US5 UR	U"5US
5 UR	U"5US5 UR	U"5US5 g)N�ctypesc�d>�[TRU5nSUlTRUlU$)Nr�)�getattr�	pythonapi�argtypes�	c_wchar_p�restype)r�funcr�s  �r �get_func�8InitConfigTests.test_global_pathconfig.<locals>.get_func�s.����6�+�+�T�2�D��D�M�!�+�+�D�L��Kr"�
Py_GetPath�Py_GetPrefix�Py_GetExecPrefix�Py_GetProgramName�Py_GetProgramFullPath�Py_GetPythonHomer�rQrMrOrEr5rK)	r�
import_module�_testinternalcapi�get_configsr]rrrr�)
r=r�r�r�r�r�r�r�r�r�s
         @r �test_global_pathconfig�&InitConfigTests.test_global_pathconfig�s����,�,�X�6��	��l�+�
���/��#�$6�7��$�%8�9�� (�)@� A��#�$6�7��"�.�.�0��:�������+�+�B�G�G�O�O�<�� 5�6�	8��������)9�:����)�+�V�M�-B�C����*�,�f�^�.D�E����.�0�&��2F�G����)�+�V�F�^�<r"c�d�/SQn[[S9nSSSU/SQS.nURSX2[S9 g)N)zignore:::PyConfig_Insert0r`z
ignore:::env1z
ignore:::env2zignore:::cmdline1zignore:::cmdline2r�zignore:::PySys_AddWarnOption1zignore:::PySys_AddWarnOption2zignore:::PyConfig_BeforeReadzignore:::PyConfig_AfterReadrr)r�z-Wignore:::cmdline1z-Wignore:::cmdline2)r3r9rVrIrG�test_init_warnoptionsr�)r%rr�r�)r=rIr�r�s    r r��%InitConfigTests.test_init_warnoptions�sK��+���#8�9�	����&�1�
��	
���6��#-�	�	/r"c�<�SSS/S.nURSU[S9 g)Nrr
zerror::BytesWarning)rlrVrI�test_init_set_configr�r.r4s  r r��$InitConfigTests.test_init_set_config�s2����1�2�
��
	
���5�v�#/�	�	1r"c�&�URS5 g)N�test_get_argc_argv�rcrGs r r��"InitConfigTests.test_get_argc_argv�s���%�%�&:�;r"c
��1SknUHeup#SU3nSS/SSUSS/SSSU/US	.nU(aS
USS0OSnUR[U55 URSU[US
9 SSS5 Mg g!,(df   My=f)N>�z=onT�z=offF�rT�r�T�frozen_modulesTr�rjr�r�r)r+rFrGrErer2rHrm�
TESTFROZENr�test_init_use_frozen_modulesr�)r�reprr�r�)r=�tests�rawr�optvalr�r)s       r r�,InitConfigTests.test_init_use_frozen_moduless���
��#�M�C�%�c�U�+�F�"���'��v�t�V�D� )�'�#'�#�H�&.�	�F�.1�<��Q�R��)�d�C����d�3�i�(��&�&�'E�v�+5�3�'�@�)�(�#�)�(�s�
A1�1
B	c�4�SnSnSnSnSnSnX-U-U-U-SS.nURS	5up�URU	S
5 [R"U5nURX�5 g![Ra URSU<35 N=f=f)N� �iii�iT)�
feature_flags�own_gil�#test_init_main_interpreter_settingsrr�)rcr]rr	r�r�)
r=�OBMALLOC�
EXTENSIONS�THREADS�DAEMON_THREADS�FORK�EXECrrarbs
          r r�3InitConfigTests.test_init_main_interpreter_settingss������
�����������$�&��0�>�A��	
���0�0�1�
���	
����b�!�	9��*�*�S�/�C�	
����'���#�#�	9��I�I�/��w�7�8�	9�s�A+�+)B�Bc�N�URS5upURUS5 g)N�test_init_in_background_threadrr�r�s   r r�.InitConfigTests.test_init_in_background_thread2s'���0�0�1Q�R�������b�!r")r7rF)NNNN)NN)dr}r~rr�r�rr��objectr�r�r��PYMEM_ALLOCATOR_NOT_SETr�r�r%r�r�r�r�r�r4�int_info�default_max_str_digitsrSrr�r�rrr�r�r�r�r�rSr��classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr!r'r-r2r7r;r>rArDrGrJr��skiprTrZr_rcrkrnrtrxrrQ�
contextlib�contextmanagerr�r�r�r��skipIfr�r"r�r�r�r�r�r�r�rrr�requires_working_threadingrr�r�r"r r'r's����G�+5��;L�� ����H�M�#�,���� !������ � �(�!�"
�	��.���*�$�	���0�!����������O�M��
�M��E�M�	�4�M�	�E�	M�	"�4�
M�	��M�	�Q�M�	�c�l�l�A�A�M�	�R�M�	��M�	�q�M�	�%�M�	�u�M�	�T�M� 	�%�!M�"	�U�#M�$	�$�%M�&	��'M�*	�1�+M�,	�/�-M�0	�$�1M�2	�*�3M�4	�e�5M�6	���7M�8	�R�9M�<	�B�=M�>	�r�?M�B	�$�CM�D	��EM�F	�(�GM�H	�-�IM�L	�$�MM�N	�)�OM�P	�)�QM�R	�.�SM�T	�1�UM�V	"�4�WM�X	�c�n�n�YM�Z	�(�[M�^	�t�_M�`	��aM�b	 ��cM�d	�5�eM�f	�u�gM�h	�a�iM�j	��kM�l	�$�mM�n	�1�oM�p	��qM�r	�t�sM�t	�U�uM�v�,�*�"'�����"� )�#��")�"2�"2�2��)�YM�M�\�$%�
�j�!����'+�
�m�$����&(�
�l�#�����"�A�
�	�������M�
�=�!���!��� %�����!�
�O��23��.�/�,-�$%�01���	%�����(��%�%�'
�	�	�!�!�#
�	��O��#��#��<�>�"6:�=8�~/�+�$=�,;?�-1�)-�!%�4�>B�"�%�T�	4�lN�M�J�/�.A/�F /�D!/�F/�/�
/�/�&1�$R�Q�Q�Q�N�M�J�/��]�]�<�=�;�=�;�L�(M�S�$	O�/�� 3�,L�2�&������6'8�R:8�x��_�_�Z�!A�B�!C�C�!C�F����%?�@�%D�A�%D�N>C�@����%:�;�/�<�/�6#=�J/�61�<�@�0(�0�0�0�2�"�3�"r"r'c��\rSrSrSrSrg)�SetConfigTestsi:c���[R"S5 [RSSSSS/n[R
"U[R[RSSS	9nUR(a?[R(a*[UR5 [UR5 URURS
URURUR45 g)N�	_testcapir�r,r+z-mztest._test_embed_set_configr��backslashreplace)rPrQr�r�r)rr�r4r5rUr�rWrKrr[r\rPrQr])r=r_r�s   r �test_set_config�SetConfigTests.test_set_config;s����#�#�K�0��~�~�t�V�T�4�9V�W���~�~�c�%/�_�_�%/�_�_�'.�7I�K���?�?�w����$�+�+���$�+�+��������!��/�/�4�;�;����D�	Fr"r�N)r}r~rr�r-r�r�r"r r)r):s��Fr"r)c�P�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�
AuditingTestsiJc�&�URS5 g)N�test_open_code_hookr�rGs r r2�!AuditingTests.test_open_code_hookKs���%�%�&;�<r"c�&�URS5 g)N�
test_auditr�rGs r r5�AuditingTests.test_auditNs���%�%�l�3r"c�&�URS5 g)N�test_audit_tupler�rGs r r8�AuditingTests.test_audit_tupleQs���%�%�&8�9r"c�&�URS5 g)N�test_audit_subinterpreterr�rGs r r;�'AuditingTests.test_audit_subinterpreterT����%�%�&A�Br"c�B�URS[RSS9 g)N�test_audit_run_commandr�rJrK�rcr�
SHORT_TIMEOUTrGs r r?�$AuditingTests.test_audit_run_commandWs$���%�%�&>�.5�.C�.C�12�	&�	4r"c�B�URS[RSS9 g)N�test_audit_run_filerr@rArGs r rE�!AuditingTests.test_audit_run_file\s$���%�%�&;�.5�.C�.C�12�	&�	4r"c��[RRUR[R
5S-n[
USSS9n[SUS9 [SUS9 SSS5 0[5ESU0EnURS	[RS
US9 [R"U5 g!,(df   NV=f![R"U5 f=f)N�.pyr�r�r�z
import sysr�z&sys.__interactivehook__ = lambda: None�
PYTHONSTARTUP�test_audit_run_interactivehook�
�rJrKr)�
rrr6r;r�TESTFNr�r\r+rcrrB�unlink�r=�startupr�r)s    r rJ�,AuditingTests.test_audit_run_interactivehookas����'�'�,�,�t�{�{�I�,<�,<�=��E��
�'�3��
1�Q��,�Q�'��:��C�2�	�G�*�,�G�o�w�G�C��)�)�*J�29�2G�2G�57�S�
*�
B�
�I�I�g��2�
1��
�I�I�g��s�B,�%0B=�,
B:�=Cc��[RRUR[R
5S-n[
USSS9n[SUS9 SSS5 0[5ESU0EnURS[RS	US
9 [R"U5 g!,(df   NV=f![R"U5 f=f)NrHr�r�r�r�r�rI�test_audit_run_startuprKrLrMrPs    r rT�$AuditingTests.test_audit_run_startupns����'�'�,�,�t�{�{�I�,<�,<�=��E��
�'�3��
1�Q��&�q�!�2�	�G�*�,�G�o�w�G�C��)�)�*B�29�2G�2G�57�S�
*�
B�
�I�I�g��2�
1��
�I�I�g��s�B"�0B3�"
B0�3Cc�B�URS[RSS9 g)N�test_audit_run_stdinrr@rArGs r rW�"AuditingTests.test_audit_run_stdinzs$���%�%�&<�.5�.C�.C�12�	&�	4r"c�&�URS5 g)N�test_get_incomplete_framer�rGs r rZ�'AuditingTests.test_get_incomplete_framer=r"r�N)r}r~rr�r2r5r8r;r?rErJrTrWrZr�r�r"r r0r0Js6��=�4�:�C�4�
4�
�
�4�
Cr"r0c�"�\rSrSrSr\R"\RS:HS5\R"\	SLS5S55r
\R"\RS5S	5r\R"\RS
5S5rSrg)
�	MiscTestsi�c�&�URS5 g)N�test_unicode_id_initr�rGs r r_�MiscTests.test_unicode_id_init�s��	
�%�%�&<�=r"�ntz(Py_FrozenMain is not exported on WindowsNr%c��[[R5nSUS'URSUS9up#[RRS5n[R"SUS35R5nURX%5 g)Nr��PYTHONUNBUFFERED�test_frozenmainr�rjz�
            Frozen Hello World
            sys.argv ['./argv0', '-E', 'arg1', 'arg2']
            config program_name: ./argv0
            config executable: z�
            config use_environment: True
            config configure_c_stdio: True
            config buffered_stdio: False
        )
r%rr&rcrr�r�r��lstripr])r=r)rarbr5rs      r rd�MiscTests.test_frozenmain�s����2�:�:���"%�����0�0�1B��0�L����W�W�%�%�i�0�
��?�?�( �!+�|�,	�	$�
��V�X�	�	
����'r"z--X showrefcount requires a Python debug buildc	��SnUGH1up#SU3n[RSSSSUSU/n[R"U[R[R
SS9nUR
URS	5 URR5n[R"S
U5nU(dURSU<35 [URS55n	[URS
55n
URX#S9 UR
U	S	U5 UR
U
S	U5 SSS5 GM4 g!,(df   GMG=f)N))�offr�)�onr�)rh�import __hello__)rirjzfrozen_modules=r+r��showrefcountr�T�rPrQrrz!^\[(-?\d+) refs, (-?\d+) blocks\]zunexpected output: rr
)r�stmt)r4r5rUr�rW�STDOUTr]rKrPr�rmrnr�r��groupr)r=r
�flagrm�xoptr_r�rarn�refs�blockss           r �test_no_memleak�MiscTests.test_no_memleak�s��
�� �J�D�$�T�F�+�D��>�>�4��~�t�T�4�QU�V�C��>�>�#�)3���)3�):�):�'+�-�D�
���T�_�_�a�0��+�+�$�$�&�C��H�H�A�3�G�E���	�	�/��w�7�8��u�{�{�1�~�&�D�����Q��(�F����T��=�� � ��q�#�.�� � ���C�0�>�=� �>�=�s�'D<�<
E	z(-X presite requires a Python debug buildc�n�[RSSSSS/n[R"U[R[R
SS9nUR
URS5 URR5nURS	U5 URS
U5 URSU5 g)Nr+r�zpresite=test.reperfr�zprint('cmd')Trlrz10 times subzCPU secondsr_)r4r5rUr�rWrnr]rKrPr�r�)r=r_r�ras    r �test_presite�MiscTests.test_presite�s����~�~�t�T�+@�$��W���~�~���?�?��$�$��	
��	
������!�,��k�k���!���
�
�n�c�*��
�
�m�S�)��
�
�e�S�!r"r�)r}r~rr�r_r�r&rrr�rdr"rr�rtrwr�r�r"r r]r]�s���>��_�_�R�W�W��_�?�A�
�_�_�&�$�.�0L�M�(�N�A�(� ����)�)�H�J�1�J�1�4����)�)�C�E�"�E�"r"r]�__main__)@�testr�test.supportrrrrr��collectionsrr$�iorr�os.pathrmrrrUr4r�r�r��has_subprocess_supportr�r��ImportError�platformrqrr�PYMEM_ALLOCATOR_MALLOC�PYMEM_ALLOCATOR_MIMALLOCrr�hasattrrr�r�r�r��
MAX_HASH_SEEDr�r�rr6rMrSr�r�r��STDLIB_INSTALL�isfiler!r+r-�TestCaser�r&r'r)r0r]r}rzr�r"r �<module>r�s'���O�O��"��	��	��	�
��
�����%�%�
�
�
�=�
>�>���


����	!����������
���3��1���3��$���
�
�
���
�
��
��,�,�->�?�?�S�R�
�
�����c�j�j�#�.�.��S�
�
�
#�
#�$�A�c�&6�&6�&<�&<�%=�>�@��	�w�w�~�~�b�g�g�l�l�>�7�;�<�<��N�5��k!�k!�\X-�(�(�*;�*;�X-�v

���"�d�*�,H�I�`"�)�8�+<�+<�`"�J�`"�F)
F�X�&�&�
F� 6C�'��):�):�6C�rD"�#�X�%6�%6�D"�N�z���M�M�O���a=�����s�1H�H%�$H%

Youez - 2016 - github.com/yon3zu
LinuXploit