XPSSKJr SSKJrJrJrJr SSKrSSKJ r SSK r SSK r SSK r SSK r SSKr SSKrSSKrSSKrSSKrSSKrSSKrSSKr\R,(d\R."S5eSSKr\R4S:HrSrSrSrS r\R@(a\r!O\r!\""\S 5r#S r$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 SrGNf=f)$)support) import_helper os_helperthreading_helper MS_WINDOWSN) namedtupleztest module requires subprocessdarwin _stats_onlPy_GIL_DISABLEDtpython.os.pyc[RRU5n[RRU5SnUR 5R SR 55$)Nr_d)ospathbasenamesplitextcasefoldendswith)programnames 6/opt/alt/python313/lib64/python3.13/test/test_embed.py debug_buildr!>sLggw'G 77  G $Q 'D ==? # #DMMO 44c[[R5n[U5HnUR S5(dMX M U$)NPYTHON)dictrenvironlist startswith)envkeys r remove_python_envvarsr+Ds9 rzz CCy >>( # # Jr"c<\rSrSrSrSrSSSSSS.SjrSrS rg) EmbeddingTestsMixinMc,Sn[RR[R5n[ (a,[ [R5(aSOSS-nX- nUnO [RRUS5n[RRXA5=Uln[RRU5(dURSU-5 [R"5Ul [R"U5 g)N _testembedrr.exeProgramsz%r doesn't exist)rrdirnamesys executablerr!jointest_exeexistsskipTestgetcwdoldcwdchdir)selfexenamebuilddirextexepathexes r setUpEmbeddingTestsMixin.setUpNs77??3>>2 :&s~~664B&HC NGGggll8Z8G ggll7<< ww~~c"" MM,s2 3iik  r"cD[R"UR5 gN)rr<r;r=s r tearDownEmbeddingTestsMixin.tearDown`s r"Nr)r)timeout returncodeinputcwdc UR/nURU5 Ub1[(a&UR5n[R SUS'[ R"U[ R[ RSUUS9nURXBS9upURU:waK[R(a6[SUS35 [SU 35 [SU 35 [S 5 UR!URUS URU 4-5 X4$! UR5 UR5 e=f) z'Runs a test in the embedded interpreter SYSTEMROOTT)stdoutstderruniversal_newlinesr)rM)rLrJz--- z failed ---zstdout: zstderr: z------zbad returncode %d, stderr is %r)r7extendrcopyrr& subprocessPopenPIPE communicate terminatewaitrKrverboseprint assertEqual) r=r)rJrKrLrMargscmdpouterrs r run_embedded_interpreter,EmbeddingTestsMixin.run_embedded_interpretercs}}o 4 ?zz((*C " < 8C    S$.OO$.OO04!$!$  &  UDJS <<: %'// D[) * IcU# $ IcU# $ (O z:,,,- .x  KKM FFH 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 URX5 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 {} ---rr )rcr]r splitlinesformatlenrr[r\ assertLessrematch assertRegexgroups assertTrueinterptstatemodulesappend) r=rarb interp_patrgnumloops current_runlinernrrmains r %run_repeated_init_and_subinterpreters9EmbeddingTestsMixin.run_repeated_init_and_subinterpreterssi001YZ b!2 H&@A NN$D(//99  [!115??Q&$KA  OOC ,a 0HHZ.E}  2U\\^,F"f OOFMM * OOFMM * OOFNN +   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 r S r S r S rS rSrSrSr\R(\R,"\R.S5S55rSrSrSrSrSrg)EmbeddingTestsictUR5H$nUSnURURS5 M& g)Nr0)r{r]id)r=runrzs r test_subinterps_main#EmbeddingTests.test_subinterps_mains3==?Cq6D   TWWc *@r"c UR5H[nUGtp#n[UR5n[U5H/upgUR UR[ XV-S-55 M1 M] g)Nr)r{intr enumerater]str)r=rrzsubs_mainidisubs r test_subinterps_different_ids,EmbeddingTests.test_subinterps_different_idss[==?C ND\F#D/  VZ!^)<=* @r"cjUR5HnUGtp#nSU;a[R"S5eUHunURURUR5 URUR UR 5 URUR UR 5 Mw M g)N0x0zplatform prints pointers as 0x0)r{unittestSkipTestassertNotEqualrrrsrt)r=rrzrrrs r test_subinterps_distinct_state-EmbeddingTests.test_subinterps_distinct_states==?C ND} ''(IJJ ##CJJ <##CJJ <##CKK>@r"cURS5upURUS5 [S[S-5Vs/sH nSUS3PM nnSR U5S-nURX5 gs snf)Ntest_repeated_init_and_inittabrrz --- Pass z --- )rcr]range INIT_LOOPSr6)r=rarbrliness r r-EmbeddingTests.test_repeated_init_and_inittabsv001QR b!.3Az!|.DE.D9QCt$.DE % 4' $FsA3c^[[RSS9nURSUS9up#[R S:a [ 5 [ U5 [ U5 SnSnSR/S Q5nURUUUS 9nSUl URUR5U5 g) Nzutf-8:surrogateescape)PYTHONIOENCODINGtest_forced_io_encodingr)rutf-8surrogateescaper)z--- Use defaults ---Expected encoding: defaultExpected errors: defaultzstdin: {in_encoding}:{errors}zstdout: {out_encoding}:{errors}'stderr: {out_encoding}:backslashreplacez--- Set errors only ---rzExpected errors: ignorezstdin: {in_encoding}:ignorezstdout: {out_encoding}:ignorerz--- Set encoding only ---Expected encoding: iso8859-1rzstdin: iso8859-1:{errors}zstdout: iso8859-1:{errors}"stderr: iso8859-1:backslashreplacez--- Set encoding and errors ---rzExpected errors: replacezstdin: iso8859-1:replacezstdout: iso8859-1:replacer) in_encoding out_encodingerrors) r%rr&rcrr[r\r6rjmaxDiffr]strip)r=r)rarbexpected_stream_encodingexpected_errorsexpected_outputs r r&EmbeddingTests.test_forced_io_encodings2::0GH001JPS0T ??Q  G #J #J#* +))%./2*00,D-E'618   o6r"c[[R[RR [ R 5S9nURSUS9up#[RS:a [5 [U5 [U5 [(a URnO3[R R [R"5S5nSUS3nURXR5 URUS5 g ) zo Checks some key parts of the C-API that need to work before the runtime is initialized (via Py_Initialize()). ) PYTHONPATHtest_pre_initialization_apirrspamzsys.executable: rrN)r%rr&pathsepr6r4rrcrr[r\rr7r:assertInr])r=r)rarb expected_pathrs r r*EmbeddingTests.test_pre_initialization_apis 2::"**//#((*CD001NTW0X ??Q  G #J #J : MMMGGLLf=M,]O2> o+ b!r"cN[5n[RR[R 5US'UR SUS9up#[RS:a [5 [U5 [U5 SnURXB5 URUS5 g)z Checks that sys.warnoptions and sys._xoptions can be set before the runtime is initialized (otherwise they won't be effective). r#test_pre_initialization_sys_optionsrrzsys.warnoptions: ['once', 'module', 'default'] sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'} warnings.filters[:3]: ['default', 'module', 'once'] rN) r+rrr6r4rrcrr[r\rr])r=r)rarbrs r r2EmbeddingTests.test_pre_initialization_sys_options's $%JJOOCHH5L00=31H ??Q  G #J #J D  o+ b!r"crURS5upURUS5 URUS5 g)zM bpo-20891: Calling PyGILState_Ensure in a non-Python thread must not crash. test_bpo20891rNrcr]r=rarbs r rEmbeddingTests.test_bpo20891<s6 00A b! b!r"crURS5upURUS5 URUS5 g)zN bpo-33932: Calling Py_Initialize() twice should do nothing (and not crash!). test_initialize_twicerNrrs r r$EmbeddingTests.test_initialize_twiceEs7 001HI b! b!r"cURS5upURUR5S5 URUS5 g)zC bpo-34008: Calling Py_Main() after Py_Initialize() must not fail. test_initialize_pymainz6Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']rNrcr]rstriprs r r%EmbeddingTests.test_initialize_pymainNs>001IJ '_` b!r"cURS5upURUR5S5 URUS5 g)N test_run_mainz%Py_RunMain(): sys.argv=['-c', 'arg2']rrrs r rEmbeddingTests.test_run_mainVs;00A 'NO b!r"c|SnURS5up#URUSU-5 URUS5 g)Nrhtest_run_main_loopz&Py_RunMain(): sys.argv=['-c', 'arg2'] rr)r=nlooprarbs r r!EmbeddingTests.test_run_main_loop[sB001EF G%OP b!r"c[R"S5n[USS9nUR5nSSS5 UR SW5upEUR US[ -5 g!,(df  N<=f)Nz_test_embed_structseq.pyrencodingtest_repeated_init_exec Tests passed )rfindfileopenreadrcr]r)r=scriptfpcoderarbs r test_finalize_structseq&EmbeddingTests.test_finalize_structseqcse !!"<= &7 +r779D,001JDQ .;<, +s A(( A6c\URS5upURUS[-5 g)Ntest_repeated_simple_initz Finalized rcr]rrs r test_simple_initialization_api-EmbeddingTests.test_simple_initialization_apios,001LM mj89r"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") rrtextwrapdedentrcr]r)r=rrrarbs r >test_specialized_static_code_gets_unspecialized_at_Py_FINALIZEMEmbeddingTests.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZEusI   >++0$7 .;>(+B/7C  2GAZZ%F'3'9'9';# \\q\8"JJy1E$$U598(<   VR ( 3 b!D 98s0D7#D<< E c[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') rz1 2 3 rrs r test_getargs_reset_static_parser/EmbeddingTests.test_getargs_reset_static_parsersC  "001JDQ kJ67r")rN)r}r~rrrrrrrrrrrrrrrrrrrequires_specializationr skipUnlessTEST_MODULES_ENABLEDrrrr rrrr"r rrsG+ >?*%)7V"&"*"""" " =:  $$ 557NO$=P%$=L2 9*"X8r"rrequires _testinternalcapicR\rSrSrSr\(aSOSr\"5r\"5r \ \ SSSSSS.r \(a\ RSS05 \"\ \S\\S 9r\"\ \SSSSSSS 9r/S Qr0S \ _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_SS_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(SSUjr)SVr*SWr+SXr,SS S SS SY.SZjjr-S[r.S\r/S]r0S^r1S_r2S`r3Sar4Sbr5Scr6Sdr7Ser8Sfr9Sgr:Shr;SirSlr?Smr@SnrA\BR"So5Sp5rDSqrESrrFSsrGStrHSurISvrJSwrKSxrLSSyjrM\NRSSzj5rPS{rQS|rRS}rS\BR"\S~5S5rU\BR"\S5S5rWSrX\BR"\S5S5rYSrZSr[Sr\Sr]Sr^Sr_\`R"5S5rbSrcg )InitConfigTestsii surrogatepassrrr) _config_init allocator parse_argvconfigure_localecoerce_c_localecoerce_c_locale_warn utf8_modelegacy_windows_fs_encoding)rrrr)rrisolateduse_environmentrdev_moder)r#r!r"rr!Fr"Tr#install_signal_handlers use_hash_seed hash_seedint_max_str_digits cpu_countr faulthandler tracemallocperf_profiling import_timecode_debug_rangesshow_ref_count dump_refsdump_refs_fileN malloc_statsfilesystem_encodingfilesystem_errorspycache_prefix program_namerargvr orig_argvxoptions warnoptionspythonpath_envhomer5base_executableprefix base_prefix exec_prefixbase_exec_prefixmodule_search_pathsmodule_search_paths_set platlibdir stdlib_dir site_import bytes_warningwarn_default_encodinginspect interactiveoptimization_level parser_debugwrite_bytecoder[quietuser_site_directoryconfigure_c_stdiodefault)buffered_stdiostdio_encoding stdio_errorsskip_source_first_line run_command run_module run_filename sys_path_0_install_importlibcheck_hash_pycs_modepathconfig_warnings _init_mainuse_frozen_modules safe_path_is_python_build_pystats run_presite enable_gillegacy_windows_stdio)rrOr) rr!r"rNr^r#r$r%r)r*r+r[)Py_HasFileSystemDefaultEncodingPy_HashRandomizationFlag$_Py_HasFileSystemDefaultEncodeErrors) Py_UTF8Moder))Py_BytesWarningFlagrF) Py_DebugFlagrK)Py_DontWriteBytecodeFlagrLT) Py_FileSystemDefaultEncodeErrorsr3)Py_FileSystemDefaultEncodingr2) Py_FrozenFlagr[T)Py_IgnoreEnvironmentFlagr"T)Py_InspectFlagrH)Py_InteractiveFlagrI)Py_IsolatedFlagr!) Py_NoSiteFlagrET)Py_NoUserSiteDirectoryrNT)Py_OptimizeFlagrJ) Py_QuietFlagrM)Py_UnbufferedStdioFlagrQT)Py_VerboseFlagr[))Py_LegacyWindowsFSEncodingFlagr ))Py_LegacyWindowsStdioFlagrccSUlgrF)EXPECTED_CONFIG)rs r tearDownClassInitConfigTests.tearDownClasss #r"cd0nUH'nSU;aURSS5upEXRU'M#SX#'M) U$)N=rT)r)r= xoptions_listr8optr*values r main_xoptionsInitConfigTests.main_xoptionss? Ccz YYsA.  % $ ! 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=rfail to decode stdout: )r+rrr4r5rUrrWrK ExceptionrPrQdecoderrJSONDecodeErrorfail)r=r)rr^procrPs r _get_expected_config_impl)InitConfigTests._get_expected_config_impls#%  dD1~~d%/__%/__6 ??&&*kk_HT[[OMN N##G, <::f% %## < II/z: ; '> >'5H^ $""..*JC/// &  + ) *$2D2D D%&67N)&,,RWW__=2\E2\HEZ<[2\./)2:;P2Q2V2V2X./x(=>?''C,*2-"'(r"c[US5n[UR55H)upEXPRLdMUR US5 X$ M+ UR X25 g)Nr)r%r'rrrr])r=rr rr*rs r check_pre_config InitConfigTests.check_pre_config1sX',/0 x~~/0JC***sD)M1 .r"c[US5n[(aURS=n5nU(a[U[5(axUS[ UR 5RS55n[[R5(a+US[ UR 5RS55nXSU'[UR55HupEXPRLaURUS5 X$ [U[[ 45(dMD[URU5[[ 45(dMp[#X45"X$5X$'M UR%X25 g)Nrr5r1r)r%rgetrrrklower removesuffixr!r4r5r'rrrboolrtyper])r=rr rr*rs r check_configInitConfigTests.check_config9sgh'( :JJn4s5EE3//Fs5;;=#=#=f#EFGs~~..!"H3u{{}'A'A$'G#HIE#s x~~/0JC*** 3%M%$--*VZZ_tUXk2Z2Z $V[ 1(- @ 1 *r"ctUSnUSn[UR5nURH2n[U5S:XaUupgnX7(aSOSXF'M(UupgX7XF'M4 URH2n[U5S:XaUupgnX'(aSOSXF'M(UupgX'XF'M4 UR USU5 g)Nrrr rr global_config)r%DEFAULT_GLOBAL_CONFIGCOPY_GLOBAL_CONFIGrkCOPY_GLOBAL_PRE_CONFIGr]) r=rrrr item global_keycore_keyopposites r check_global_config#InitConfigTests.check_global_configKs\* "223++D4yA~15. h,2,/)"<F  m   SZZ\6 2 9jjoG g'9: '?3   ) ## 9 II/w7 8 9sE)))FFc,URS[S9 g)Ntest_init_initialize_configrrrrGs r test_init_default_config(InitConfigTests.test_init_default_configs <*Mr"c,URS[S9 g)Ntest_preinit_compat_configrrrGs r r*InitConfigTests.test_preinit_compat_config ;Lr"c,URS[S9 g)Ntest_init_compat_configrrrGs r r'InitConfigTests.test_init_compat_config 8jIr"cXSS0nSSSS/SSSSSSSSSS. nURSX![S 9 g) Nrrz ./globalvarrdefault::BytesWarningr ) r5rErFr9rHrIrJrLr[rMrQrNr[test_init_global_configrrr= preconfigrs r r'InitConfigTests.test_init_global_configs^  *34"##$#$  8&#-  /r"cf[SS.n0SS_SS_SS_S S _S S_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);Nrrrr$Fr%Tr&{r*r r+r,r-r.r1rR iso8859-1rSreplacer4conf_pycache_prefixr5z./conf_program_namer6rarg2r7)python3-Wcmdline_warnoption-Xcmdline_xoptionrpassrrr8)zconfig_xoption1=3zconfig_xoption2=config_xoption3rr9)rrconfig_warnoptionrUpass rErFrHrIrJrLr[rMrOrQrNr)rC my_platlibdirrAr^iizialways)r'r(rZr[r`test_init_from_configrALLOCATOR_FOR_CONFIGrPy_STATSrrrs r r%InitConfigTests.test_init_from_configs!- 8 %u8 T8  8  1 8 e 8 4 8  8  d8  D8  k8  I8  38  18 T6N!8 " "#8 , $-8 . /8 : ;8 D 8E8 H 5I8 J QK8 L tM8 N 4O8 P !!Q8 R eS8 T qU8 V TW8 X Y8 Z e[8 \ "5]8 ^ D_8 ` /a8 b "4#5#5c8 d e8 f#($,#(o8 r 8!"F:  6#-  /r"cS[0n0SS_SS_SS_SS _S S_S S _S S_S S_SS_SS_SS_SS _SS_SS _SS_SS_SS _SS/SURSSS.En[(aSUS 'URS!X![S"9 g)#Nrr%Tr&*r*r r+Fr,r-r1rHrJr:/my/pathr4env_pycache_prefixrLr[rrQrRrrSrrNEnvVarenv_platlibdirr)r9rCrAr^r'r`test_init_compat_envrrrs r r$InitConfigTests.test_init_compat_envs, -  T   1  e  4     D  t  !!  j  2  e  q  e  k I! " "5# $!$:*#'#5#5"&/ 2 8!"F:  5v#-  /r"c[SS.n0SS_SS_SS_S S _S S_S S _S S_SS_SS_SS_SS_SS _SS_SS _SS_SS_SS _SS/SURSSS.En[(aSUS 'URS!X![S"9 g)#Nrrr%Tr&rr*r r+Fr,r-r1rHrJr:rr4rrLr[rQrRrrSrrNrrrrr`test_init_python_envr)rrrrrrs r r$InitConfigTests.test_init_python_envs,-  T   1  e  4     D  t  !!  j  2  e  q  e  k I! " "5# $!$:*#'#5#5"&/ 2 8!%F:  5v#-  /r"c`[[S9n[SSS/S9nURSX![S9 g)NrrrPr#r)r9test_init_env_dev_moder)r%PYMEM_ALLOCATOR_DEBUGrrrs r r &InitConfigTests.test_init_env_dev_mode?s>#89 q#$#,+/ 7#-  /r"c`[[S9n[SSS/S9nURSX![S9 g)NrrrPr test_init_env_dev_mode_allocr)r%rrrrs r r,InitConfigTests.test_init_env_dev_mode_allocGs>#78 q#$#,+/ =v#-  /r"cLS[0nSSS/S.nURSX![S9 g)NrTrP)r)r#r9test_init_dev_moder)r rrrs r r"InitConfigTests.test_init_dev_modeOs@ . !%;  3V#-  /r"c S[0nS//SQ[RRS5SSS/S/SS.nUR SX![ S 9 g) Nr script.py)rrdev-PrTrPr)r6r7rWr#r)r9r8r^test_preinit_parse_argvr)r rrrrrrs r r'InitConfigTests.test_preinit_parse_argv[sb . !MDGGOOK8 %;   8&#-  /r"cJSS0n/SQnUUSS.nURSX1[S9 g)Nr!r) r-E-Irrrrutf8r)r6r7r!test_preinit_dont_parse_argvrrr)r=rr6rs r r,InitConfigTests.test_preinit_dont_parse_argvnsF     =v#/  1r"c<SSSSS.nURSU[S9 g)NTFr!r^r"rNtest_init_isolated_flagrrrr=rs r r"'InitConfigTests.test_init_isolated_flags-$#(   8&jQr"c<SSSSS.nURSU[S9 g)NTFr!test_preinit_isolated1rrr$s r r'&InitConfigTests.test_preinit_isolated1/$#(   7ZPr"c<SSSSS.nURSU[S9 g)NTFr!test_preinit_isolated2rrr$s r r+&InitConfigTests.test_preinit_isolated2r)r"c,URS[S9 g)Ntest_preinit_isolated_configrrrGs r r.,InitConfigTests.test_preinit_isolated_configs =<Pr"c,URS[S9 g)Ntest_init_isolated_configrrrGs r r1)InitConfigTests.test_init_isolated_configs : Mr"c,URS[S9 g)Ntest_preinit_python_configrr#rGs r r4*InitConfigTests.test_preinit_python_configrr"c,URS[S9 g)Ntest_init_python_configrr#rGs r r7'InitConfigTests.test_init_python_configrr"c:SSS.nURS0U[S9 g)Nr)rrtest_init_dont_configure_localerr#)r=rs r r:/InitConfigTests.test_init_dont_configure_locales0!"   @"i#-  /r"zSas of 3.11 this test no longer works because path calculations do not occur on readcBSSSS.nSnURSU[US9 g)Nz./init_read_set my_executable)r5r5r<cJURSS5 URS5 g)Nrtest_path_insert1test_path_append)insertru)rs r modify_path7InitConfigTests.test_init_read_set..modify_paths KK. / KK* +r"test_init_read_set)rrr#)r=rrBs r rD"InitConfigTests.test_init_read_sets9.).   , 3V#-.9  ;r"cHS/SQ/SQ/SQS.nURSU[S9 g)Nr)config_xoptionrsysadd_xoptionr))ignore:::cmdline_warnoptionzignore:::sysadd_warnoptionzignore:::config_warnoption)rrrIrr)r)r8r9r7test_init_sys_addrr#r$s r rJ!InitConfigTests.test_init_sys_adds3  3 " 2F Kr"cVSnSS/SSUS/SUS-SSS .nURS U[S 9 g) NRimport _testinternalcapi, json; print(json.dumps(_testinternalcapi.get_configs()))rrr ./python3rTr)r6r7r5rUrrXtest_init_run_mainrr#r=rrs r rO"InitConfigTests.test_init_run_mainsNE6N#T48'$;   3VLr"cZSnSS/SSUS/SUS-SSS S .nURS U[S S 9 g)NrMrrrrNrTrr)r6r7r5rUrr\rXtest_init_mainz)Run Python code before _Py_InitializeMain)rrQr#rPs r rSInitConfigTests.test_init_mains`E6N# "($;   /#-&Q  Sr"cHS/SQ/SQSSSS.nURSU[S 9 g) NT)rarg1-varg3./argv0rrrrVrWrXrZrF)rr6r7r5rUr"test_init_parse_argvrr#r$s r r[$InitConfigTests.test_init_parse_argvs30N%#$   5v:Nr"cLSS0nS/SQ/SQSS.nURSX![S9 g) NrrFrYrZ)rr6r7r5test_init_dont_parse_argvrr#)r=rrs r r^)InitConfigTests.test_init_dont_parse_argvs@ !  IN%   :F#-  /r"c[(aSnURnO9Sn[(a URnO[R"U5=(d SnUR UUUS.5 g)Nrrr)r5r<r5)rr7MACOSshutilwhichr)r=rr5r5s r default_program_name$InitConfigTests.default_program_name sU :#LJ$Lu!]] #\\,7=2  ()$  r"cUR5nUSSnUSSSSSS.nURU5 S[RRR U50nUR SU[USS9 g) NrrAr)rAr=r>r?r@rDTESTPATHtest_init_setpathTrr)r)rrdrrrr6rrr=rrr)s r rh!InitConfigTests.test_init_setpaths**,x !67$) "   !!&)277??//67 2F#-3-1  3r"c UR5nUSSnUSSSSS[R(+SSSS. nS[RR R U50nURSU[US S 9 g) NrrArconf_program_nameconf_executable) rAr=r>r?r@rDr]r5r<r5rgtest_init_setpath_configTri) rrPy_DEBUGrrrr6rrrjs r ro(InitConfigTests.test_init_setpath_config2s**,x !67$) "&-&6&6"6/0+  277??//67 96#-3d  Lr"c nUR5nUcUSSnUcUSSn[(aUSS$[Rn[R R U[RSURUR[S35[R R U[RSURSUR[35[R R U[RSURSUR[3S5/$)Nrr=rArz.zipr lib-dynload) rrr4 version_inforrr6rCmajorminor ABI_THREAD)r=r=r?rvers r rA#InitConfigTests.module_search_pathsKs**, >H%h/F   *84K :(#$9: :""C VS^^%cii[ Jr?r@r:rDTESTHOMErtest_init_setpythonhomerr))rrrrr6isdirr8r3rrr4rtrurvrCrwrArdrr) r=rr paths_strrr;r=r?stdlibexpected_pathsversionr)s r r'InitConfigTests.test_init_setpythonhomezs**,x !67GGOO((/ D77==&&ww~~bggll49::wwt,  II/y9 :## :WW\\$.F$Ah T6(BFKN))//0#2B2B2H2H1IJGWW\\$& *8VWF!55T5TN#1!& +'    !!&)9 8&#-3  8r"c TUR5nUSSn[RRR U5nUHn[RR U5(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 .n S U S'SUS'UR#SU[$U S9 SU S'SUS'[RR[R&5n [)[RR U S5SS9n [RR+[RR XR-5S3R/5S55U [(aSOS'SSS5 [(d6[R0=pgUR!US9SU S'UR3XfXwS9 UR#SU[$U S9 g!,(df  Nf=f)NrrArrrrrrrrrr1NEGATIVE_ISPYTHONBUILDr_test_init_is_python_buildrrrpybuilddir.txtrrz $r )r=)r=r>r?r@)rrrrr6rr8r3rrr4rtrurvrCrwrArrr5rr~rrir=r)r=rrrrr;r=r?rrrr)rrs r #test_init_is_python_build_with_home3InitConfigTests.test_init_is_python_build_with_homes**,x !67GGOO((/ D77==&&ww~~bggll49::wwt,  II/y9 :## :WW\\$.F$Ah T6(BFKN))//0#2B2B2H2H1IJGWW\\$& *8VWF!55T5TN#1!& +'    9(+ $%%&!" :F#-3  8), $%%&!"0 "'',,v'786 Ja57WW5E5E Vz%5%@%@%B1%EF6HN 1 2Kz#&:: -F $ 8 8 8 G JN1  MM&1  Q :F#-3  8K Js A/L L'cUR5nUSSn[RRR U5nXAS'SU0nU$)NrrAr:r)rrrrr6)r=r all_configsrrr)s r copy_paths_by_env!InitConfigTests.copy_paths_by_envsP//1 H%&;<GGOO((/ #, Y' r"zSee test_init_pybuilddir_win32c &UR5n[R"S5=(d SnSn[RR X5n[RR [RR XS55n[R"U5 [RR US5n[USSS9nURU5 SSS5 UR5nXXS 'XHS 'URn [R"S 5[R"S 5U U UUS .n URU 5n URSU [U SUS9 SSS5 g!,(df  N=f!,(df  g=f)NVPATHrlibdirrrwrrrr?r=)r@r>r<r5rArDrTrr)rrM)r sysconfigget_config_varrrr6r~mkdirrwriterAr7rrr) r=rvpathrr stdlibdirfilenamerrAr5rr)s r test_init_pybuilddir$InitConfigTests.test_init_pybuilddirsK $ $ &&,,W5;EFWW\\&1F((fU)KLI HHV ww||F,<=Hhf5 6#'":":"< &/ #&, #J$-$<$<]$K(77A#-(':' F((0C  " "#r<r5r=r?rArDrFr)rrrrr~countsepr6rrrrArr7rrr) r=rrrr=rrrrAr5rr)s r test_init_pybuilddir_win32*InitConfigTests.test_init_pybuilddir_win32 s((1  77  E " ( ( 0A 5WW\\&.9F  $ $V ,WW%%bggll6&ABF((fU)KLIww||F,<=Hhf5 6#'":":"< &(ggll6277;K;KL_`bLc;d&e  #&, #&/ #J$*%#-( %':' F((0C  " "#/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-US 9 ['S US 9 SSS5 UR)5n[ (dWUS 'Oa[ RRU[ RR+US55U[ RRUS5/nUR,n [ RRU[ RR+U 55n Un [.R0"S5U U U 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)Nrrrsrrz pyvenv.cfgrrrz home = %sfilez$include-system-site-packages = falserrr=)r>r@r?r<r5rAr>rDr]rTr)rr{r|r4rtrrrr6rCrurvrwrrbrr STDLIB_DIRrr\rArr7rrrrprrrr)r=r pyvenv_homerx lib_dynload lib_folderrrrr5r<r?rr)s r test_init_pyvenv_cfg$InitConfigTests.test_init_pyvenv_cfg3s $ $ &&  ( ( *k""C: ggll;+.>>-3CII;a {:,+W+8:  K(WW\\+u=  J'GGLL!3!3W=GGLLW5 ww||FL9Hhf5kK/b9<2F6,,.E:'b GGLL)9)9%()CDGGLLe4 J ggll;8H8H8TUO%K(77A$/*#2(', Fz(3}%#.x ')ww||K'G|$/2w7G7G3G/H+,(,'9'9|$/2w7G7G3G/H+,((0C  " "#=InitConfigTests.test_getpath_abspath_win32..s3H%QaD%srrrrrA) rr:rcr+rrr6r]rrrrzip)r=CASESrarbrrr r s r test_getpath_abspath_win32*InitConfigTests.test_getpath_abspath_win32ss ) ( @ 0 4 "))+c* +  00 )J(*Jrww333H%3HHJ1  b! 9**S/Ch- 56%(%8 !MQ6   V .&9 ## 9 II/w7 8 9sC )C54C5cT^ [R"S5m U 4SjnU"S5nU"S5nU"S5nU"S5nU"S5nU"S5n[R"5S nUR U"5R [ RR5US 5 UR U"5US 5 UR U"5US 5 UR U"5US 5 UR U"5US5 UR U"5US5 g)Nctypescd>[TRU5nSUlTRUlU$)Nr)getattr pythonapiargtypes c_wchar_prestype)rfuncrs r get_func8InitConfigTests.test_global_pathconfig..get_funcs.6++T2DDM!++DLKr" Py_GetPath Py_GetPrefixPy_GetExecPrefixPy_GetProgramNamePy_GetProgramFullPathPy_GetPythonHomerrAr=r?r5r5r;) r import_module_testinternalcapi get_configsr]rrrr) r=rrrrrrrrrs @r test_global_pathconfig&InitConfigTests.test_global_pathconfigs,,X6  l+ / #$67$%89 ()@ A#$67"..0: ++BGGOO< 56 8 )9: )+VM-BC *,f^.DE .0&2FG )+VF^z=onTz=offFrTrTfrozen_modulesTrrZrrr)rr6r7r5rUr"r8r] TESTFROZENrtest_init_use_frozen_modulesr)rreprrr)r=testsrawr optvalrr)s r r,InitConfigTests.test_init_use_frozen_moduless  #MC%cU+F"'vtVD )'#'#H&. F.1<QR)dCd3i(&&'Ev+53'@)(#)(s A11 B c4SnSnSnSnSnSnX-U-U-U-SS.nURS 5upURU S 5 [R"U5nURX5 g![Ra UR S U<35 N=f=f) N iiiiT) feature_flagsown_gil#test_init_main_interpreter_settingsrr)rcr]rrrr) r=OBMALLOC EXTENSIONSTHREADSDAEMON_THREADSFORKEXECr rarbs r r3InitConfigTests.test_init_main_interpreter_settingss $&0>A   00 1  b! 9**S/C '## 9 II/w7 8 9sA++)BBcNURS5upURUS5 g)Ntest_init_in_background_threadrrrs r r .InitConfigTests.test_init_in_background_thread s'001QR b!r")r7rF)NNNN)NN)dr}r~rrrrrobjectrrrPYMEM_ALLOCATOR_NOT_SETrrr%rrrrrr4int_infodefault_max_str_digitsrCrrprrrrrrrrrSr{ classmethodr|rrrrrrrrrrrrrrrr rrrrr"r'r+r.r1r4r7r:rskiprDrJrOrSr[r^rdrhrorA contextlibcontextmanagerrrrrskipIfrrrrrrrrrrrrrequires_working_threadingr rrr"r rrsG+5;L HM#, !  (!"  .*$  0!O M MEM 4M E M "4 M M QM cllAAM RM M qM %M uM TM %!M" U#M$ $%M& 'M* 1+M, /-M0 $1M2 *3M4 e5M6 7M8 R9M< B=M> r?MB $CMD EMF (GMH -IML $MMN )OMP )QMR .SMT 1UMV "4WMX cnnYMZ ([M^ t_M` aMb cMd 5eMf ugMh aiMj kMl $mMn 1oMp qMr tsMt UuMv,*"'" )#")"2"22)YMM\$% j!'+ m$&( l# "A  M =!! %! O23./,-$%01 %(%%'   !!#  O##<>"6:=8~/+$=,;?-1)-!%4>B"%T 4lNMJ/.A/F /D!/F// //&1$RQQQNMJ/]]<= ;= ;L( MS$ O / 3,L2&6'8R:8x__Z!AB!CC!CF%?@%DA%DN>C@%:;/</6#=J/61<@0(0002"3"r"rc\rSrSrSrSrg)SetConfigTestsic[R"S5 [RSSSSS/n[R "U[R [R SSS 9nUR(a?[R(a*[UR5 [UR5 URURS URURUR45 g) N _testcapirrrz-mztest._test_embed_set_configrbackslashreplace)rPrQrrr)rrr4r5rUrrWrKrr[r\rPrQr])r=r_rs r test_set_configSetConfigTests.test_set_configs##K0~~tVT49VW~~c%/__%/__'.7IK ??w $++  $++  !//4;; D Fr"rN)r}r~rrrrrr"r rrs Fr"rcP\rSrSrSrSrSrSrSrSr Sr S r S r S r S rg ) AuditingTestsi$c&URS5 g)Ntest_open_code_hookrrGs r r"!AuditingTests.test_open_code_hook%s %%&;.5.C.C12 & 4r"cBURS[RSS9 g)Ntest_audit_run_filerr0r1rGs r r5!AuditingTests.test_audit_run_file6s$ %%&;.5.C.C12 & 4r"c[RRUR[R 5S-n[ USSS9n[SUS9 [SUS9 SSS5 0[5ESU0EnURS [RS US 9 [R"U5 g!,(df  NV=f![R"U5 f=f) N.pyrrrz import sysrz&sys.__interactivehook__ = lambda: None PYTHONSTARTUPtest_audit_run_interactivehook rJrKr) rrr6r;rTESTFNrr\r+rcrr2unlinkr=startuprr)s r r:,AuditingTests.test_audit_run_interactivehook;s'',,t{{I,<,<=E '3 1Q ,Q ' : C2 G*,GowGC  ) )*J292G2G57S * B IIg 2 1 IIg sB,%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) Nr8rrrrrr9test_audit_run_startupr;r<r=r@s r rD$AuditingTests.test_audit_run_startupHs'',,t{{I,<,<=E '3 1Q &q !2 G*,GowGC  ) )*B292G2G57S * B IIg 2 1 IIg s B"0B3" B03C cBURS[RSS9 g)Ntest_audit_run_stdinrr0r1rGs r rG"AuditingTests.test_audit_run_stdinTs$ %%&<.5.C.C12 & 4r"c&URS5 g)Ntest_get_incomplete_framerrGs r rJ'AuditingTests.test_get_incomplete_frameYr-r"rN)r}r~rrr"r%r(r+r/r5r:rDrGrJrrr"r r r $s6=4:C4 4  4 Cr"r c"\rSrSrSr\R "\RS:HS5\R "\ SLS5S55r \R"\ RS5S 5r\R"\ RS 5S 5rS rg) MiscTestsi]c&URS5 g)Ntest_unicode_id_initrrGs r rOMiscTests.test_unicode_id_init^s %%&<=r"ntz(Py_FrozenMain is not exported on WindowsNrc[[R5nSUS'URSUS9up#[RR S5n[ R"SUS35R5nURX%5 g)NrPYTHONUNBUFFEREDtest_frozenmainrrZz 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}rrlstripr])r=r)rarbr5r s r rTMiscTests.test_frozenmainds2::"% 001B0LWW%%i0 ??( !+|, $  VX  'r"z--X showrefcount requires a Python debug buildc SnUGH1up#SU3n[RSSSSUSU/n[R"U[R[R SS9nUR URS 5 URR5n[R"S U5nU(dURS U<35 [URS 55n [URS 55n URX#S9 UR U S U5 UR U S U5 SSS5 GM4 g!,(df  GMG=f)N))offr)onr)rXimport __hello__)rYrZzfrozen_modules=rr showrefcountrTrPrQrrz!^\[(-?\d+) refs, (-?\d+) blocks\]zunexpected output: rr )rstmt)r4r5rUrrWSTDOUTr]rKrPrrmrnrrgroupr) r=rflagr]xoptr_rrarnrefsblockss r test_no_memleakMiscTests.test_no_memleakws   JD$TF+D>>4~tT4QUVC>>#)3)3):):'+-D   T__a 0++$$&CHHA3GE /w78u{{1~&DQ(FT=  q#.  C0>= >=s 'D<< E z(-X presite requires a Python debug buildcn[RSSSSS/n[R"U[R[R SS9nUR URS5 URR5nURS U5 URS U5 URS U5 g) Nrrzpresite=test.reperfrz print('cmd')Tr\rz 10 times subz CPU secondsr_) r4r5rUrrWr^r]rKrPrr)r=r_rras r test_presiteMiscTests.test_presites~~tT+@$W~~ ??$$   !,kk! nc* mS) eS!r"r)r}r~rrrOrrrrrrTrrrprdrgrrr"r rMrM]s> __RWW_?A __&$.0LM(NA( ))HJ1J14))CE "E "r"rM__main__)@testr test.supportrrrrr collectionsrriorros.pathrmrbrUr4rr{rhas_subprocess_supportrr ImportErrorplatformrarr PYMEM_ALLOCATOR_MALLOCPYMEM_ALLOCATOR_MIMALLOCrrhasattrrrrrr MAX_HASH_SEEDrrwrr6r=rCrtrurvSTDLIB_INSTALLisfiler!r+r-TestCaserrrrr rMr}rzrr"r rys'OO"   %%   = >>  ! 31 3 $     ,,->??SR cjj#.. S   # # $Ac&6&6&<&<%=>@ ww~~bggll>7;<<N5 k!k!\r8((*;*;r8j  "d*,HI`")8+<+<`"J`"F) FX&& F 6C'):):6CrD"#X%6%6D"N z MMOU<s1HH%$H%