+
    Bi,                    D   ^ RI Ht ^ RIHtHtHtHt ^ RIt^ RIH	t	 ^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt]P*                  '       g   ]P,                  ! R4      h ^ RIt]P2                  R8H  t^ t^t^t^t]P>                  '       d   ]t M]t ]!! ]R4      t"^t#^t$^t%^t&Rt']P>                  '       d   R	MR
t(]PR                  R8X  d   ]PT                   t+MC]PX                  PZ                  t.]PX                  P^                  t0]PT                   R]. R]0 ]( R2t+]P>                  '       d   ^M^ t1]P>                  '       d   ^M^ t2]Pf                  Pi                  ]Pj                  ]PT                  R]PX                  PZ                   R]PX                  P^                   24      t6]Pf                  Po                  ]Pf                  Pi                  ]6R4      4      '       g   Rt6R t8R t9 ! R R4      t: ! R R]:]Pv                  4      t<R t=]P|                  ! ]RJ R4       ! R R]:]Pv                  4      4       t? ! R R]:]Pv                  4      t@ ! R R]:]Pv                  4      tA]BR8X  d   ]P                  ! 4        R# R#   ] d    Rt EL,i ; i)     )support)import_helper	os_helperthreading_helper
MS_WINDOWSN)
namedtupleztest module requires subprocessdarwin	_stats_onl    t ntz/python.z/lib-dynloadpythonos.pyc                     \         P                  P                  V 4      p \         P                  P                  V 4      ^ ,          pVP	                  4       P                  RP	                  4       4      # )r   _d)ospathbasenamesplitextcasefoldendswith)programnames   & &/usr/lib/python3.14/test/test_embed.pydebug_buildr   G   sL    ggw'G77G$Q'D==?##DMMO44    c                      \        \        P                  4      p \        V 4       F  pVP	                  R 4      '       g   K  W K   	  V # )PYTHON)dictr   environlist
startswith)envkeys     r   remove_python_envvarsr&   M   s9    
rzz
CCy>>(##  Jr   c            
       P   a  ] tR t^Vt o R tR tRRRRR^ RRRR/R	 ltR
 tRtV t	R# )EmbeddingTestsMixinc                L   R p\         P                  P                  \        P                  4      p\
        '       d6   \        \        P                  4      '       d   RMRR,           pW,          pTpM \         P                  P                  VR4      p\         P                  P                  WA4      ;V n        p\         P                  P                  V4      '       g   V P                  RV,          4       \         P                  ! 4       V n        \         P                  ! V4       R# )
_testembedr   r   .exeProgramsz%r doesn't existN)r   r   dirnamesys
executabler   r   jointest_exeexistsskipTestgetcwdoldcwdchdir)selfexenamebuilddirextexepathexes   &     r   setUpEmbeddingTestsMixin.setUpW   s    77??3>>2:&s~~664B&HCNGGggll8Z8G ggll7<<ww~~c""MM,s23 iik
r   c                F    \         P                  ! V P                  4       R # N)r   r6   r5   r7   s   &r   tearDownEmbeddingTestsMixin.tearDowni   s    
r   r$   Ntimeout
returncodeinputcwdc          	        V P                   .pVP                  V4       Ve7   \        '       d+   VP                  4       p\        P
                  R,          VR&   \        P                  ! V\        P                  \        P                  RVVR7      p VP                  WBR7      w  rTP                  T8w  dM   \        P                  '       d7   \        RT R24       \        RT	 24       \        RT
 24       \        R	4       T P!                  TP                  TR
TP                  T
3,          4       Y3#    TP                  4        TP                  4        h ; i)z'Runs a test in the embedded interpreter
SYSTEMROOTT)stdoutstderruniversal_newlinesr$   rG   )rF   rD   z--- z failed ---zstdout:
zstderr:
z------zbad returncode %d, stderr is %r)r1   extendr   copyr   r!   
subprocessPopenPIPEcommunicate	terminatewaitrE   r   verboseprintassertEqual)r7   r$   rD   rE   rF   rG   argscmdpouterrs   &$$$$$*    r   run_embedded_interpreter,EmbeddingTestsMixin.run_embedded_interpreterl   s    }}o

4?zz ((*C "

< 8CS$.OO$.OO04!$!$&	UDJS
 <<:%'///D[)*IcU#$IcU#$(Oz:,,,-	. x	KKMFFHs   D6 6#Ec              #    "   V P                  R 4      w  rV P                  VR4       Rp\        RR4      p^p. pVP                  4        EFo  pVRP	                  V4      8X  dG   V P                  \        V4      ^ 4       \        P                  ^8  d   \        V4       V^,          pK`  V P                  \        V4      ^4       \        P                  ! W74      pVf   V P                  Ws4       V! VP                  4       !  p	\        P                  ^8  d   \        V	4       V P                  V	P                  4       V P                  V	P                   4       V P                  V	P"                  4       VP%                  V	4       \        V4      ^8X  g   EKO  V^ ,          p
V P                  W4       Vx  . pEKr  	  R# 5i)&test_repeated_init_and_subinterpretersr   zS^interp (\d+) <(0x[\dA-F]+)>, thread state <(0x[\dA-F]+)>: id\(modules\) = ([\d]+)$Interpzid interp tstate modulesz--- Pass {} ---N)r]   rW   r   
splitlinesformatlenr   rU   rV   
assertLessrematchassertRegexgroups
assertTrueinterptstatemodulesappend)r7   r[   r\   
interp_patra   numloopscurrent_runlinerg   rk   mains   &          r   %run_repeated_init_and_subinterpreters9EmbeddingTestsMixin.run_repeated_init_and_subinterpreters   si    001YZb!2
 H&@ANN$D(//99  [!115??Q&$KAOOC,a0HHZ.E}  2 U\\^,F"fOOFMM*OOFMM*OOFNN+v& ;1$"1~  .!! ; %s   FG 'G )r5   r1   )
__name__
__module____qualname____firstlineno__r=   rB   r]   rt   __static_attributes____classdictcell____classdict__s   @r   r(   r(   V   sF     $!$ !)-!:;!CG!%)!F2! 2!r   r(   c                      a  ] tR t^t o RtR tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR tR t]P(                  ]P,                  ! ]P.                  R4      R 4       4       tR tR tR tR tRtV tR# )EmbeddingTestsc                ~    V P                  4        F(  pV^ ,          pV P                  VP                  R4       K*  	  R# )r   0N)rt   rW   id)r7   runrs   s   &  r   test_subinterps_main#EmbeddingTests.test_subinterps_main   s3    ==?Cq6DTWWc* @r   c           	         V P                  4        Fc  pVEvr#p\        VP                  4      p\        V4       F7  w  rgV P	                  VP                  \        WV,           ^,           4      4       K9  	  Ke  	  R# )   N)rt   intr   	enumeraterW   str)r7   r   rs   subs_mainidisubs   &       r   test_subinterps_different_ids,EmbeddingTests.test_subinterps_different_ids   s[    ==?C ND\F#D/  VZ!^)<= *	 @r   c                n   V P                  4        F  pVEvr#pR V9   d   \        P                  ! R4      hV Fu  pV P                  VP                  VP                  4       V P                  VP
                  VP
                  4       V P                  VP                  VP                  4       Kw  	  K  	  R# )0x0zplatform prints pointers as 0x0N)rt   unittestSkipTestassertNotEqualrk   rl   rm   )r7   r   rs   r   r   r   s   &     r   test_subinterps_distinct_state-EmbeddingTests.test_subinterps_distinct_state   s    ==?C ND}
 ''(IJJ ##CJJ<##CJJ<##CKK>  @r   c                    V P                  R 4      w  rV P                  VR4       \        ^\        ^,           4       Uu. uF	  pRV R2NK  	  ppRP	                  V4      R,           pV P                  W4       R# u upi )test_repeated_init_and_inittabr   z	--- Pass z ---
N)r]   rW   range
INIT_LOOPSr0   )r7   r[   r\   r   liness   &    r   r   -EmbeddingTests.test_repeated_init_and_inittab   sv    001QRb!.3Az!|.DE.D9QCt$.DE		% 4'$ Fs   A;c                t   \        \        P                  R R7      pV P                  RVR7      w  r#\        P
                  ^8  d!   \        4        \        V4       \        V4       RpRpRP                  . R	O4      pVP                  VVVR7      pRV n	        V P                  VP                  4       V4       R# )
zutf-8:surrogateescape)PYTHONIOENCODINGtest_forced_io_encodingr$   utf-8surrogateescaper   )in_encodingout_encodingerrorsN)z--- Use defaults ---Expected encoding: defaultExpected errors: defaultzstdin: {in_encoding}:{errors}zstdout: {out_encoding}:{errors}'stderr: {out_encoding}:backslashreplacez--- Set errors only ---r   zExpected errors: ignorezstdin: {in_encoding}:ignorezstdout: {out_encoding}:ignorer   z--- Set encoding only ---Expected encoding: iso8859-1r   zstdin: iso8859-1:{errors}zstdout: iso8859-1:{errors}"stderr: iso8859-1:backslashreplacez--- Set encoding and errors ---r   zExpected errors: replacezstdin: iso8859-1:replacezstdout: iso8859-1:replacer   )r    r   r!   r]   r   rU   rV   r0   rc   maxDiffrW   strip)r7   r$   r[   r\   expected_stream_encodingexpected_errorsexpected_outputs   &      r   r   &EmbeddingTests.test_forced_io_encoding   s    2::0GH001JPS0T??QG#J#J#* +)) %. /2 *00,D-E'6 1 8
 o6r   c                   \        \        P                  \        P                  P	                  \
        P                  4      R7      pV P                  RVR7      w  r#\        P                  ^8  d!   \        4        \        V4       \        V4       \        '       d   V P                  pM3\        P                  P	                  \        P                  ! 4       R4      pRV R2pV P                  WR4       V P                  VR4       R# )	zo
Checks some key parts of the C-API that need to work before the runtime
is initialized (via Py_Initialize()).
)
PYTHONPATHtest_pre_initialization_apir   spamzsys.executable: r   r   N)r    r   r!   pathsepr0   r.   r   r]   r   rU   rV   r   r1   r4   assertInrW   )r7   r$   r[   r\   expected_pathr   s   &     r   r   *EmbeddingTests.test_pre_initialization_api  s    
 2::"**//#((*CD001NTW0X??QG#J#J: MMMGGLLf=M,]O2>o+b!r   c                X   \        4       p\        P                  P                  \        P
                  4      VR&   V P                  RVR7      w  r#\        P                  ^8  d!   \        4        \        V4       \        V4       RpV P                  WB4       V P                  VR4       R# )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_optionsr   zsys.warnoptions: ['once', 'module', 'default']
sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}
warnings.filters[:3]: ['default', 'module', 'once']
r   N)r&   r   r   r0   r.   r   r]   r   rU   rV   r   rW   )r7   r$   r[   r\   r   s   &    r   r   2EmbeddingTests.test_pre_initialization_sys_options0  s    
 $%JJOOCHH5L00=3 1 H??QG#J#JD 	
 	o+b!r   c                t    V P                  R4      w  rV P                  VR4       V P                  VR4       R# )zM
bpo-20891: Calling PyGILState_Ensure in a non-Python thread must not
crash.
test_bpo20891r   Nr]   rW   r7   r[   r\   s   &  r   r   EmbeddingTests.test_bpo20891E  s6    
 00Ab!b!r   c                t    V P                  R4      w  rV P                  VR4       V P                  VR4       R# )zN
bpo-33932: Calling Py_Initialize() twice should do nothing (and not
crash!).
test_initialize_twicer   Nr   r   s   &  r   r   $EmbeddingTests.test_initialize_twiceN  s7    
 001HIb!b!r   c                    V P                  R4      w  rV P                  VP                  4       R4       V P                  VR4       R# )zC
bpo-34008: Calling Py_Main() after Py_Initialize() must not fail.
test_initialize_pymainz6Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']r   Nr]   rW   rstripr   s   &  r   r   %EmbeddingTests.test_initialize_pymainW  s>     001IJ'_`b!r   c                    V P                  R 4      w  rV P                  VP                  4       R4       V P                  VR4       R# )test_run_mainz%Py_RunMain(): sys.argv=['-c', 'arg2']r   Nr   r   s   &  r   r   EmbeddingTests.test_run_main_  s;    00A'NOb!r   c                    ^pV P                  R4      w  r#V P                  VRV,          4       V P                  VR4       R# )   test_run_main_loopz&Py_RunMain(): sys.argv=['-c', 'arg2']
r   Nr   )r7   nloopr[   r\   s   &   r   r   !EmbeddingTests.test_run_main_loopd  sB     001EFG%OPb!r   c                   \         P                  ! R 4      p\        VRR7      ;_uu_ 4       pVP                  4       pRRR4       V P	                  RX4      w  rEV P                  VR\        ,          4       R#   + '       g   i     LC; i)z_test_embed_structseq.pyr   encodingNtest_repeated_init_execTests passed
)r   findfileopenreadr]   rW   r   )r7   scriptfpcoder[   r\   s   &     r   test_finalize_structseq&EmbeddingTests.test_finalize_structseql  sh     !!"<=&7++r779D ,001JDQ.;< ,+s   A88B	c                f    V P                  R 4      w  rV P                  VR\        ,          4       R# )test_repeated_simple_initz
Finalized
Nr]   rW   r   r   s   &  r   test_simple_initialization_api-EmbeddingTests.test_simple_initialization_apix  s,     001LMmj89r   zrequires test modulesc                    \         P                  ! R 4      p\        P                  ! RVP                   R24      pV P
                  pV! RV4      w  rEV P                  VR\        ,          4       R# )_testinternalcapia              import dis
            import importlib._bootstrap
            import opcode
            import test.test_dis
            import test.support

            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
                        # LOAD_CONST_IMMORTAL is "specialized", but is
                        # inserted during quickening.
                        and opname != "LOAD_CONST_IMMORTAL"
                    ):
                        return True
                return False

            func = importlib._bootstrap._handle_fromlist

            # "copy" the code to un-specialize it:
            test.support.reset_code(func)

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

            for _ in range(z):
                func(importlib._bootstrap, ["x"], lambda *args: None)

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

            print("Tests passed")
        r   r   N)r   import_moduletextwrapdedentSPECIALIZATION_THRESHOLDr]   rW   r   )r7   r   r   r   r[   r\   s   &     r   >test_specialized_static_code_gets_unspecialized_at_Py_FINALIZEMEmbeddingTests.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE~  su    
 *778KL $8 .FFG H	9"  "F ++0$7.;<r   c                l    R pV P                  RV4      w  r#V P                  VR\        ,          4       R# )zprint('\N{digit nine}')r   z9
Nr   r7   r   r[   r\   s   &   r   test_ucnhash_capi_reset&EmbeddingTests.test_ucnhash_capi_reset  s1    )001JDQej01r   c                l    R pV P                  RV4      w  r#V P                  VR\        ,          4       R# )zdimport datetime;d = datetime.datetime.strptime('2000-01-01', '%Y-%m-%d');print(d.strftime('%Y%m%d'))r   z	20000101
Nr   r   s   &   r   test_datetime_reset_strptime+EmbeddingTests.test_datetime_reset_strptime  s8    * 	
 001JDQlZ78r   c           	     >   \         P                  ! R 4      pR p/ p\        WV4       V! VR,          4      p?V\         P                  ! R4      ,          pV P                  RW4      w  rVVP	                  R4      R,          pV Uu. uF/  p\
        P                  ! VP                  R4      R,          4      NK1  	  upw  rV! V	4      pV! V
4      pVP                  4        Fd  w  rVw  ppRV3R	V33 FN  w  ppV P                  VVVR
7      ;_uu_ 4        VP                  V4      pV P                  VV4       RRR4       KP  	  Kf  	  RV n        V P                  V/ 4       V P                  V/ 4       V P                  VR4       R# u upi   + '       g   i     K  ; i)a  
            import test.support
            results = []
            for cls in test.support.iter_builtin_types():
                for attr, _ in test.support.iter_slot_wrappers(cls):
                    wrapper = getattr(cls, attr)
                    res = (cls, attr, wrapper)
                    results.append(res)
            results = ((repr(c), a, repr(w)) for c, a, w in results)
            c                 N    / pV  F  w  r#pW#3pWQ9  g
   Q WV34       hWAV&   K  	  V# r@    )rawresultsclsattrwrapperr%   s   &     r   collate_resultsIEmbeddingTests.test_static_types_inherited_slots.<locals>.collate_results  sA    G&)"7i)BG'+BB)& '* Nr   r   z
            import json
            import sys
            text = json.dumps(list(results))
            print(text, file=sys.stderr)
            r   z
--- Loop #r   NNz ---
embeddedreinit)r   slotattrNr   )r   r   execr]   splitjsonloads
rpartitionitemssubTestpoprW   r   )r7   r   r   nsmain_resultsr[   r\   _resultsres	_embedded_reinitembedded_resultsreinit_resultsr%   expectedr   r   srcr   actuals   &                   r   !test_static_types_inherited_slots0EmbeddingTests.test_static_types_inherited_slots  s    	" 		 V&r)}5(// #  	 00)6;99\*2.BJK(3djj1"56(K	*95(1)//1MCIC-.>*!W \\#3\>>$[[-F$$VX6 ?>	! 2 )2.,b!# L ?>>s   5F$F	Fc                    \         P                  ! R 4      pV P                  RV4      w  r#V P                  VR\        ,          4       R# )a  
            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   z1
2
3
N)r   r   r]   rW   r   r   s   &   r    test_getargs_reset_static_parser/EmbeddingTests.test_getargs_reset_static_parser  sC        " 001JDQkJ67r   )r   Ni  )rv   rw   rx   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   requires_specializationr   
skipUnlessTEST_MODULES_ENABLEDr   r   r   r  r  rz   r{   r|   s   @r   r   r      s     G+>?*%)7V"&"*""""
"
=: $$557NO*= P %*=X293"j8 8r   r   c                 B    \         V R &   ^V R&   ^VR&   R.VR&   ^VR&   R# )	allocatordev_modedefaultwarnoptionsfaulthandlerN)PYMEM_ALLOCATOR_DEBUG)	preconfigconfigs   &&r   config_dev_moder(    s6    2IkIjF:&KF=F>r   requires _testinternalcapic                   $  a  ] tR tRt o Rt]'       d   RMRt]! 4       t]! 4       t	R]
R]RRR	R
RRRRRR/t]'       d   ]P                  RR/4       ]! ]]R
]]R7      t]! ]]RR
RRRRR7      t. ROt/ R]
bRRbRR
bRRbRR
bRRbR^ bR]P*                  P,                  bRRbRRbR^ bR^ bR^ bR]bR]bRR
bR Rb/ R!RbR"R#bR$RbR%]bR&]bR'R#bR(]bRRbR)R*.bR+. bR,/ bR-. bR.R#bR/R#bR0]bR1]bR2]bC/ R3]bR4]bR5]bR6]bR7R
bR8]P2                  bR9]bR:R
bR;^ bR<RbR=RbR>RbR?^ bR@RbRAR
bRB^ bRCRbC/ RDR
bRER
bRFRbRGR
bRH]bRI]bRJRbRKR#bRLR#bRMR#bRNR#bROR
bRPRQbRRR
bRSR
bRT]P6                  '       * bRURbCRV]	/Ct]'       d   R]RW&   ]P6                  '       d   R#]RX&   ]P<                  '       d   R]RY&   ]]RZ&   ]'       d   ]P                  R[R/4       ]P>                  '       d   R]R\&   ]! ]]R
R
R]7      t ]! ]]R
RRR
RRRRR^ RR^7      t!]'       d   R]!R[&   R_^ R`^Ra^ /t"R.t#. ROt$]'       d#   ]#PK                  R4       ]$PK                  R4       R#t&]'Rb 4       t(Rc t)Rd t*Re t+RRf lt,Rg t-Rh t.Ri t/RRjR#RkR#RlRRmR#/Rn llt0]1Pd                  ! ]Pf                  Ro4      Rp 4       t4Rq t5Rr t6Rs t7Rt t8]1Pd                  ! ]Pf                  Ro4      Ru 4       t9]1Pd                  ! ]Pf                  Ro4      Rv 4       t:Rw t;Rx t<Ry t=Rz t>R{ t?R| t@R} tAR~ tBR tCR tDR tER tFR tG]1P                  ! R4      R 4       tIR tJR tKR tLR tMR tNR tOR tPRR ltQ]RP                  RR l4       tTR tUR tVR tW]1Pd                  ! ]R4      R 4       tX]1P                  ! ]R4      R 4       tZR t[]1P                  ! ]R4      R 4       t\R t]R t^]1Pd                  ! ]Pf                  Ro4      R 4       t_R t`R taR tbR tcR tdR te]fP                  ! 4       R 4       thRtiV tjR## )InitConfigTestsi  i   surrogatepassr   _config_initr   
parse_argvFconfigure_localeTcoerce_c_localecoerce_c_locale_warn	utf8_modelegacy_windows_fs_encoding)r-  r.  r0  r2  )r-  r/  isolateduse_environmentr2  r!  r0  r!  r4  r5  install_signal_handlersuse_hash_seed	hash_seedint_max_str_digits	cpu_countr$  tracemallocperf_profilingimport_timethread_inherit_contextcontext_aware_warningscode_debug_rangesshow_ref_count	dump_refsdump_refs_fileNmalloc_statsfilesystem_encodingfilesystem_errorspycache_prefixprogram_nameargvr   	orig_argvxoptionsr#  pythonpath_envhomer/   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_bytecoderU   quietremote_debuguser_site_directoryconfigure_c_stdiobuffered_stdiostdio_encodingstdio_errorsskip_source_first_linerun_command
run_modulerun_filename
sys_path_0_install_importlibcheck_hash_pycs_moder"  pathconfig_warnings
_init_mainuse_frozen_modules	safe_path_is_python_build_pystatsrun_presite
enable_giltlbc_enabledlegacy_windows_stdiouse_system_logger)r-  rb  r.  )r-  r4  r5  ra  rp  r!  r6  r7  r$  r;  r<  rm  Py_HasFileSystemDefaultEncodingPy_HashRandomizationFlag$_Py_HasFileSystemDefaultEncodeErrorsc                    R V n         R # r@   )EXPECTED_CONFIG)r   s   &r   tearDownClassInitConfigTests.tearDownClass  s     #r   c                f    / pV F(  pR V9   d   VP                  R ^4      w  rEWRV&   K$  RW#&   K*  	  V# =T)r  )r7   xoptions_listrK  optr%   values   &&    r   main_xoptionsInitConfigTests.main_xoptions  s?     Ccz YYsA.
 % $ ! r   c                   \        4       p\        P                  ! R 4      p\        P                  RRV.p\
        P                  ! W1\
        P                  \
        P                  R7      pVP                  '       d(   \        RVP                  : RVP                  : 24      hVP                  P                  R4      p \        P                  ! V4      #   \        P                   d    T P!                  RT: 24        R# i ; i)	a4  
            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$   rJ   rK   z)failed to get the default config: stdout=z stderr=r   fail to decode stdout: N)r&   r   r   r.   r/   rO   r   rQ   rE   	ExceptionrJ   rK   decoder  r  JSONDecodeErrorfail)r7   r$   r   rX   procrJ   s   &     r   _get_expected_config_impl)InitConfigTests._get_expected_config_impl  s    #%    dD1~~d%/__%/__6 ??? &&*kk_HT[[OM N N##G,	<::f%%## 	<II/z:;	<s   ?C *DDc                4   \         pVP                  f   V P                  4       Vn        / pVP                  P                  4        FN  w  r4/ pVP                  4        F/  w  rg\	        V\
        4      '       d   VP                  4       pWuV&   K1  	  WRV&   KP  	  V# r@   )r+  r|  r  r	  
isinstancer"   rN   )r7   r   configs
config_keyconfig_valuer'  r%   r  s   &       r   _get_expected_config$InitConfigTests._get_expected_config  s    &"&"@"@"BC (+(;(;(A(A(C$JF*002
eT**!JJLE#s 3 #)J )D r   c                   V P                  4       pVR ,          pVP                  4        F   w  rWP                  J g   K  Wx,          W&   K"  	  VR,          '       d   V\        8X  d   R F  pV P                  W(&   K  	  VR,          '       g   V P                  VR&   VR,          ^8X  d{   VR,          V P                  J d   RVR&   VR,          V P                  J d   V P
                  VR&   VR,          V P                  J d   RVR&   VR,          V P                  J d   RVR&   \        '       d   V P                  p
MqVR	,          V P                  Jd(   \        P                  P                  VR	,          4      p
M3\        P                  P                  \        P                  ! 4       R
4      p
VR,          V P                  J d   WR&   VR,          V P                  J d   WR&   VR	,          V P                  J d   RVR	&   VR,          pVP                  4        F   w  rWP                  J g   K  W,          W(&   K"  	  VR,          V P                  Jdt   VR,          pVe:   VP                  \        P                  P                  4      p. VOVR,          OVR&   Ve*   VR,          P                  4       VR&   V! VR,          4       V P                    F  pW9  g   K  W(,          W&   K  	  R# )
pre_configr/  rE  rF  rd  re  r2  r   r   rH  r*   r/   rN  z./_testembedr'  rS  rL  N)rE  rF  rd  re  )r  r	  GET_DEFAULT_CONFIG
API_COMPATIGNORE_CONFIGUTF8_MODE_ERRORSr   r1   r   r   abspathr0   r4   r  r   rN   COPY_PRE_CONFIG)r7   expected_preconfigr  r$   apimodify_path_cbr  r  r%   r  default_executabler'  rL  pathss   &&&&&&        r   get_expected_config#InitConfigTests.get_expected_config  s   ++-\*
,224JC///*4/"' 5 ""455
9J: $ 2 2: ""455 /3.@.@{+k*a/-.$2I2II29./+,0G0GG040E0E,-()T-D-DD-4)*'4+B+BB+<(:!%n%T-D-DD!#.1I!J!#biik<!HL!T%<%<<%7\"%&$*A*AA*<&'N#t'>'>>'5H^$""..*JC/// & + )*$2D2DD%&67N)&,,RWW__=2\E2\HEZ<[2\./)2:;P2Q2V2V2X./x(=>?''C,*2-"' (r   c                    \        VR ,          4      p\        VP                  4       4       F*  w  rEWPP                  J g   K  VP	                  VR4       W$ K,  	  V P                  W24       R# )r  N)r    r"   r	  r  r  rW   )r7   r  r  r  r%   r  s   &&&   r   check_pre_config InitConfigTests.check_pre_configW  sX    ',/0
x~~/0JC***sD)M 1 	.r   c                   \        VR ,          4      p\        '       d   VP                  R;p4      pV'       d   \        V\        4      '       dz   VR\        VP                  4       P                  R4      4       p\        \        P                  4      '       d,   VR\        VP                  4       P                  R4      4       pWSV&   \        VP                  4       4       F  w  rEWPP                  J d   VP                  VR4       W$ \        V\        \         34      '       g   KF  \        VP                  V4      \        \         34      '       g   Ks  \#        W4,          4      ! W$,          4      W$&   K  	  V P%                  W24       R# )r'  rH  Nr+   r   )r    r   getr  r   rd   lowerremovesuffixr   r.   r/   r"   r	  r  r  boolr   typerW   )r7   r  r  r'  r%   r  s   &&&   r   check_configInitConfigTests.check_config_  s   gh'(:JJn4s5EE3//Fs5;;=#=#=f#EFGs~~..!"H3u{{}'A'A$'G#HIE#sx~~/0JC***

3%M%$--*VZZ_tUXk2Z2Z $V[ 1(- @ 1 	*r   c                   VR ,          pVR,          p\        V P                  4      pV P                   F<  p\        V4      ^8X  d   Vw  rgpW7,          '       d   ^ M^WF&   K.  Vw  rgW7,          WF&   K>  	  V P                   F<  p\        V4      ^8X  d   Vw  rgpW',          '       d   ^ M^WF&   K.  Vw  rgW',          WF&   K>  	  V P                  VR,          V4       R# )r  r'  global_configN)r    DEFAULT_GLOBAL_CONFIGCOPY_GLOBAL_CONFIGrd   COPY_GLOBAL_PRE_CONFIGrW   )	r7   r  r  r'  r  item
global_keycore_keyopposites	   &&       r   check_global_config#InitConfigTests.check_global_configq  s    \*
"223++D4yA~15.
h,2,<,<q!$'+$
'-'7$ , //D4yA~15.
h,6,@,@qa$'+$
'1';$ 0 	18<r   preconfig_apir$   ignore_stderrrG   c               X   \        4       pVe   VP                  V4       TpVf   TpV\        8X  d   V P                  pM$V\        8X  d   V P
                  pMV P                  pVf   / p\        V3/ VB pVf   / pV\        8X  d   V P                  pM$V\        8X  d   V P                  pMV P                  p\        V3/ VB pV P                  VVVWd4       V P                  VWR7      w  rVf   VR,          '       g   RpVe)   V	'       g!   V P                  VP                  4       V4        \        P                   ! V4      pV P'                  XV4       V P)                  VV4       V P+                  V4       V#   \        P"                   d    T P%                  RT: 24        Lci ; i)N)r$   rG   rU   r   r  )r&   updateAPI_ISOLATEDPRE_CONFIG_ISOLATED
API_PYTHONPRE_CONFIG_PYTHONPRE_CONFIG_COMPATr    CONFIG_PYTHONCONFIG_ISOLATEDCONFIG_COMPATr  r]   rW   r   r  r  r  r  r  r  r  )r7   testnameexpected_configr  r  rK   r  r  r$   r  rG   new_envdefault_preconfigdefault_configr[   r\   r  s   &&&&&&$$$$$      r   check_all_configs!InitConfigTests.check_all_configs  s   
 ()?NN3 ML( $ 8 8j( $ 6 6 $ 6 6%!#!"3J7IJ" O*!//NL !11N!//N~AA  !3!0!$!$	6
 0058 1 C>/)"<"<FmSZZ\62	9jjoG 	g'9:'?3  ) ## 	9II/w78	9s   /E< <*F)(F)z'segfaults on BOLT instrumented binariesc                4    V P                  R \        R7       R# )test_init_initialize_configr  Nr  r  rA   s   &r   test_init_default_config(InitConfigTests.test_init_default_config  s    <*Mr   c                4    V P                  R \        R7       R# )test_preinit_compat_configr  Nr  rA   s   &r   r  *InitConfigTests.test_preinit_compat_config      ;Lr   c                4    V P                  R \        R7       R# )test_init_compat_configr  Nr  rA   s   &r   r  'InitConfigTests.test_init_compat_config      8jIr   c                |    R R/pRRRRRRRR.R	RR
RR^RRRRRRRRRRRRRR/pV P                  RW!\        R7       R# )r2  TrH  z./globalvarrW  FrX  r#  default::BytesWarningrZ  r[  r\  r^  rU   r_  rc  r`  ra  rm  test_init_global_configr  Nr  r7   r&  r'  s   &  r   r  'InitConfigTests.test_init_global_config  s~    
	 M5T34t4 !etTeD!5!5
  	8&#- 	 	/r   c                   R \         RR/p/ RRbRRbR^{bR^bR^ bR	^bR
RbRRbRRbRRbRRbRRbRRbRRR.bR. R@ObRRbRRRRRR RRR/b/ R!. RAObR"R#bR$RbR%^bR&RbR'RbR(^bR)RbR*^bR+RbR,RbR-RbR.RbR/RbR0RbR1R2bR3V P                  bCR4RR5R6R7R8R9R:R;R/Cp\        '       d   ^VR<&   V P                  R=W!\        R>7       R?# )Br   r2  Tr6  Fr7  r8  r;  r<  r=  r@  rA  rD  rd  	iso8859-1re  replacerG  conf_pycache_prefixrH  z./conf_program_namerI  r  arg2rJ  cmdline_xoptionr.  rK  config_xoption13config_xoption2r   config_xoption3r#  rg  pass
rW  rX  rZ  r[  r\  r^  rU   r_  r`  rb  rc  ra  r$  rU  my_platlibdirrS  rp  r9  iiz  r:  i  rl  alwaysrm  rr  test_init_from_configr  N)python3-Wcmdline_warnoption-Xr  r  passr  )r  r  config_warnoptionALLOCATOR_FOR_CONFIGr  Py_STATSr  r  r  s   &  r   r  %InitConfigTests.test_init_from_config  sG   -
	9
%u9
T9
 9
 1	9

 a9
 19
  9
 d9
 D9
 k9
 I9
 39
 19
  T6N!9
"  "#9
, $-9
. !3!2!4!4	/9
:  ;9
D 8E9
H 5I9
J QK9
L tM9
N 4O9
P !!Q9
R eS9
T qU9
V TW9
X DY9
Z  [9
\ e]9
^ "5_9
` Da9
b /c9
d "4#5#5e9
f  %"H!5q9
t 8!"F:6#- 	 	/r   c                   R \         /p/ RRbR^*bR^bR^bRRbRRbR	RbR
^bRRbRRbRRbR^bRRbRRbRRbRRbRRbRR.RRRV P                  RRRRR ^/Cp\        '       d   ^VR!&   V P                  R"W!\        R#7       R$# )%r   r7  Tr8  r;  r=  r@  FrD  rZ  r\  rL  /my/pathrG  env_pycache_prefixr^  rU   rc  rd  r  re  r  ra  r$  r#  EnvVarrU  env_platlibdirrS  rp  r9    r<  rr  test_init_compat_envr  Nr  r  s   &  r   r  $InitConfigTests.test_init_compat_env"  s;    -
	
T

 1
 1	

  
 D
 t
 !!
 j
 2
 e
 q
 e
 k
 I
  "5!
" D#
$ H:*!4#5#5 $a/
2 8!"F:5v#- 	 	/r   c                   R \         R^/p/ RRbR^*bR^bR^bRRbR	RbR
RbR^bRRbRRbRRbR^bRRbRRbRRbRRbRRbRR.RRRV P                  RRRR R!^/Cp\        '       d   RVR"&   V P                  R#W!\        R$7       R%# )&r   r2  r7  Tr8  r;  r=  r@  FrD  rZ  r\  rL  r  rG  r  r^  rU   rc  rd  r  re  r  ra  r$  r#  r  rU  r  rS  rp  r9  r   r<  rr  test_init_python_envr  N)r  r  r  r  r  r  s   &  r   r  $InitConfigTests.test_init_python_envE  s@    -
	
T

 1
 1	

  
 D
 t
 !!
 j
 2
 e
 q
 e
 k
 I
  "5!
" D#
$ H:*!4#5#5 $a/
2 8!%F:5v#- 	 	/r   c                t    \        \        R 7      p\        ^^R.R7      pV P                  RW!\        R7       R# )r   r"  r!  r$  r#  test_init_env_dev_moder  N)r    r%  r  r  r  s   &  r   r	  &InitConfigTests.test_init_env_dev_modei  s>    #89	q#$#,+/ 	7#- 	 	/r   c                t    \        \        R 7      p\        ^^R.R7      pV P                  RW!\        R7       R# )r  r"  r  test_init_env_dev_mode_allocr  N)r    r  r  r  r  s   &  r   r  ,InitConfigTests.test_init_env_dev_mode_allocq  s>    #78	q#$#,+/ 	=v#- 	 	/r   c                b    / pR RRRRR./p\        W4       V P                  RW!\        R7       R# )r$  Tr!  r#  r"  test_init_dev_moder  Nr(  r  r  r  s   &  r   r  "InitConfigTests.test_init_dev_modey  sD    	DI;

 		*3V#- 	 	/r   c                    / pR R.R. ROR\         P                  P                  R4      RRRRRR	.R
RR/RR/p\        W4       V P	                  RW!\
        R7       R# )rI  	script.pyrJ  devri  r!  Tr$  r#  r"  rK  rp  test_preinit_parse_argvr  N)r  r  r  -Pr  )r   r   r  r(  r  r  r  s   &  r   r  'InitConfigTests.test_preinit_parse_argv  ss     	[MDBGGOOK8DI;	
 		*8&#- 	 	/r   c                V    R R/p. ROpRVRVR R/pV P                  RW1\        R7       R# )r4  FrI  rJ  test_preinit_dont_parse_argvr  N)	r  -E-Ir  r  r  r  utf8r  r  r  )r7   r&  rI  r'  s   &   r   r  ,InitConfigTests.test_preinit_dont_parse_argv  sL     
	 D

 	=v#/ 	 	1r   c                J    R RRRRRRR/pV P                  RV\        R7       R# )	r4  Trp  r5  Fra  test_init_isolated_flagr  Nr  r  r7   r'  s   & r   r   'InitConfigTests.test_init_isolated_flag  s5    u!5	
 	8&jQr   c                J    R RRRRRRR/pV P                  RV\        R7       R# )	r4  Trp  r5  Fra  test_preinit_isolated1r  Nr  r"  s   & r   r%  &InitConfigTests.test_preinit_isolated1  7     u!5	
 	7ZPr   c                J    R RRRRRRR/pV P                  RV\        R7       R# )	r4  Trp  r5  Fra  test_preinit_isolated2r  Nr  r"  s   & r   r)  &InitConfigTests.test_preinit_isolated2  r'  r   c                4    V P                  R \        R7       R# )test_preinit_isolated_configr  Nr  rA   s   &r   r,  ,InitConfigTests.test_preinit_isolated_config  s    =<Pr   c                4    V P                  R \        R7       R# )test_init_isolated_configr  Nr  rA   s   &r   r/  )InitConfigTests.test_init_isolated_config  s    :Mr   c                4    V P                  R \        R7       R# )test_preinit_python_configr  Nr!  rA   s   &r   r2  *InitConfigTests.test_preinit_python_config  r  r   c                4    V P                  R \        R7       R# )test_init_python_configr  Nr!  rA   s   &r   r5  'InitConfigTests.test_init_python_config  r  r   c                D    R ^ R^ /pV P                  R/ V\        R7       R# )r/  r0  test_init_dont_configure_localer  Nr!  )r7   r&  s   & r   r8  /InitConfigTests.test_init_dont_configure_locale  s4     q
	 	@"i#- 	 	/r   zSas of 3.11 this test no longer works because path calculations do not occur on readc                N    R RRRRR/pR pV P                  RV\        VR7       R# )	rH  z./init_read_setr/   my_executablerN  c                 L    V P                  ^R4       V P                  R4       R# )r   test_path_insert1test_path_appendN)insertrn   )r   s   &r   modify_path7InitConfigTests.test_init_read_set.<locals>.modify_path  s    KK./KK*+r   test_init_read_set)r  r  Nr!  )r7   r'  r@  s   &  r   rB  "InitConfigTests.test_init_read_set  s@     -/

	, 	3V#-.9 	 	;r   c                b    R ^RRRRRRRR R/R. ROR. RO/pV P                  RV\        R	7       R
# )r$  rK  config_xoptionTr  sysadd_xoptionr#  rJ  test_init_sys_addr  N)ignore:::cmdline_warnoptionzignore:::sysadd_warnoptionzignore:::config_warnoption)r  r  rH  r  r  r!  r"  s   & r   rG  !InitConfigTests.test_init_sys_add  sV    A $!4 $	  
  3
" 	2F
Kr   c                p    R pRRR.RRRVR.RRRVR	,           R
RRR/pV P                  RV\        R7       R# )zRimport _testinternalcapi, json; print(json.dumps(_testinternalcapi.get_configs()))rI  r  r  rJ  r  rH  z	./python3rg  r   r.  Trj  r   test_init_run_mainr  Nr!  )r7   r   r'  s   &  r   rK  "InitConfigTests.test_init_run_main  sZ    E T6N)T48K4$;$"
 	3VLr   c                Z    R RR. ROR. RORRRRRR	/pV P                  R
V\        R7       R# )r.  TrI  rJ  ./argv0rH  rg  r  r5  Ftest_init_parse_argvr  N)r  arg1-varg3rN  r  r  r  rP  rQ  rR  r!  r"  s   & r   rO  $InitConfigTests.test_init_parse_argv
  sA    $0NI8u
 	5v:Nr   c                Z    R ^ /pR RR. R	OR. R	ORR/pV P                  RW!\        R7       R# )
r.  FrI  rN  rJ  rH  test_init_dont_parse_argvr  NrS  r!  )r7   r  r'  s   &  r   rV  )InitConfigTests.test_init_dont_parse_argv  sJ    !

 %INI	
 	:F#- 	 	/r   c                    \         '       d   R pV P                  pM;Rp\        '       d   V P                  pM \        P                  ! V4      ;'       g    RpVP                  RVRVRV/4       R# )r   r  r   rH  rN  r/   N)r   r1   MACOSshutilwhichr  )r7   r'  rH  r/   s   &&  r   default_program_name$InitConfigTests.default_program_name"  s^    :#LJ$Lu!]]
#\\,7==2
Lz*
 	r   c                   V P                  4       pVR ,          R,          pRVRRRRRRRRRR/pV P                  V4       R\        P                  P                  P                  V4      /pV P                  R	V\        VR
R7       R# )r'  rS  rO  r   rP  rQ  rR  rV  TESTPATHtest_init_setpathTr  r$   r  N)r  r\  r   r   r   r0   r  r  r7   r'  r  r$   s   &   r   r`  !InitConfigTests.test_init_setpath2  s    **,x !67 "5b22 "	
 	!!&)277??//672F#-3-1 	 	3r   c                "   V P                  4       pVR ,          R,          pRVRRRRRRRRRRR\        P                  '       * R	R
RRRR/
pR\        P                  P
                  P                  V4      /pV P                  RV\        VRR7       R# )r'  rS  rO  r   rP  rQ  rR  rV  ro  rH  conf_program_namerN  conf_executabler/   r_  test_init_setpath_configTra  N)	r  r   Py_DEBUGr   r   r   r0   r  r  rb  s   &   r   rg  (InitConfigTests.test_init_setpath_configH  s    **,x !67 "5b22 " g&6&6"6/0+
  277??//6796#-3d 	 	Lr   c                   V P                  4       pVf   VR,          R,          pVf   VR,          R,          p\        '       d   VR,          R,          # \        P                  p\        P
                  P                  V\        P                  RVP                   VP                   \         R24      \        P
                  P                  V\        P                  RVP                   RVP                   \         24      \        P
                  P                  V\        P                  RVP                   RVP                   \         2R4      .# )Nr'  rO  rS  r   z.zipr   lib-dynload)r  r   r.   version_infor   r   r0   rU  majorminor
ABI_THREAD)r7   rO  rQ  r'  vers   &&&  r   rS  #InitConfigTests.module_search_pathsa  s   **,>H%h/F *84K:(#$9::""CVS^^%cii[J<tLNVS^^%cii[#))ZLIK[#..%cii[#))ZLI=Z r   c           
   #    "   \         P                  ! 4       ;_uu_ 4       p\        P                  P	                  V4      pV'       dS   \        P                  P                  \        P                  P                  W!4      4      p\        P                  ! V4       \        '       d   ^ RI	p\        P                  P                  V P                  4      p\        P                  ! V4       Fn  pVP                  VR4      '       g   K  \        P                  ! \        P                  P                  WE4      \        P                  P                  W%4      4       Kp  	  \        P                  P                  V\        P                  P                  V P                  4      4      p\        P                  ! V P                  V4       \        P                   ! V P                  V4       W`n        Vx  RRR4       R#   + '       g   i     R# ; i5i)r   Nz*.dll)tempfileTemporaryDirectoryr   r   realpathnormpathr0   makedirsr   fnmatchr-   r1   listdirrZ  copyfiler   copystat)r7   subdirtmpdirrx  exedirf	exec_copys   &&     r   tmpdir_with_python"InitConfigTests.tmpdir_with_pythont  s-     ((**f WW%%f-F))"'',,v*FGF#z7F+Aq'22V(?fAXY ,
 VRWW-=-=dmm-LMIOODMM95OODMM95%ML/ +***s+   HBG8&AG8C(G8.
H8H			Hc                $   V P                  4       pVR ,          R,          p\        P                  P                  P	                  V4      pV F  p\        P                  P                  V4      '       g   K*  \        P                  P                  \        P                  P	                  VR4      4      '       g   Ko  \        P                  P                  V4      p M	  V P                  RV: 24       X;rg\        '       dL   \        P                  P	                  VR4      pV^ ,          \        P                  P	                  VR4      V.p	M\        P                  P                   R\        P                  P                   2p
\        P                  P	                  V\        P                  RV
 \         24      pV P!                  WUR7      p	R	VRV	R
VRVRVRVRVRV/pV P#                  V4       RVRV/pV P%                  RV\&        VR7       R# )r'  rS  r   Unable to find home in LibDLLsr   r   rO  rQ  rM  rO  rP  rQ  rR  rL  rV  TESTHOMEr   test_init_setpythonhomer  r$   N)r  r   r   r   r0   isdirr2   r-   r  r   r.   rl  rm  rn  rU  ro  rS  r\  r  r  )r7   r'  r  	paths_strr   rM  rO  rQ  stdlibexpected_pathsversionr$   s   &           r   r  'InitConfigTests.test_init_setpythonhome  s   **,x !67GGOO((/	D77==&&ww~~bggll49::wwt,  II/y9:##:WW\\$.F $AhT6(BFKN))//0#2B2B2H2H1IJGWW\\$&	*8VWF!55T5TN D!>f6;i&	
 	!!&)4y98&#-3 	 	8r   c                   V P                  4       pVR ,          R,          p\        P                  P                  P	                  V4      pV F  p\        P                  P                  V4      '       g   K*  \        P                  P                  \        P                  P	                  VR4      4      '       g   Ko  \        P                  P                  V4      p M	  V P                  RV: 24       X;rg\        '       dL   \        P                  P	                  VR4      pV^ ,          \        P                  P	                  VR4      V.p	M\        P                  P                   R\        P                  P                   2p
\        P                  P	                  V\        P                  RV
 \         24      pV P!                  WUR7      p	R	VRV	R
VRVRVRVRVRV/pRVRV/pRVR&   ^ VR&   V P#                  RV\$        VR7       RVR&   ^VR&   \        P                  P                  \        P&                  4      p\)        \        P                  P	                  VR4      RR7      ;_uu_ 4       p\        P                  P+                  \        P                  P	                  WP-                  4        R2P/                  4       ^ ,          4      4      T	\        '       d   ^M^&   RRR4       \        '       gA   \        P0                  ;rgV P!                  VR7      ^ ,          V	^ &   VP3                  WfWwR7       V P#                  RV\$        VR7       R#   + '       g   i     Lw; i)r'  rS  r   r  r  r  r   r   r  rM  rO  rP  rQ  rR  rL  rV  r  r   1NEGATIVE_ISPYTHONBUILDrq  test_init_is_python_buildr  r   pybuilddir.txtr  r   z
$N)rO  )rO  rP  rQ  rR  )r  r   r   r   r0   r  r2   r-   r  r   r.   rl  rm  rn  rU  ro  rS  r  r  r/   r   rv  r   rb   rO  r  )r7   r'  r  r  r   rM  rO  rQ  r  r  r  r$   r~  r  s   &             r   #test_init_is_python_build_with_home3InitConfigTests.test_init_is_python_build_with_home  s   **,x !67GGOO((/	D77==&&ww~~bggll49::wwt,  II/y9:##:WW\\$.F $AhT6(BFKN))//0#2B2B2H2H1IJGWW\\$&	*8VWF!55T5TN D!>f6;i&	
 4y9(+$%%&!":F#-3 	 	8 ),$%%&!"0"'',,v'786JJa57WW5E5EVz%5%@%@%B1%EF6HN

12 K z#&::-F $ 8 8 8 G JN1MM&1  Q:F#-3 	 	8 KJs   3A4MM&	c                    V P                  4       pVR ,          R,          p\        P                  P                  P	                  V4      pWAR&   RV/pV# )r'  rS  rL  r   )r  r   r   r   r0   )r7   r'  all_configsr  r  r$   s   &&    r   copy_paths_by_env!InitConfigTests.copy_paths_by_env  sP    //1H%&;<GGOO((/	#, Y'
r   zSee test_init_pybuilddir_win32c                j   V P                  4       ;_uu_ 4       p\        P                  ! R 4      ;'       g    RpRp\        P                  P                  W4      p\        P                  P                  \        P                  P                  WR4      4      p\        P                  ! V4       \        P                  P                  VR4      p\        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       V P                  4       pWXR&   WHR&   V P                  p	R	\        P                  ! R
4      R\        P                  ! R4      RV	RV	RVRV/p
V P                  V
4      pV P                  RV
\        VRVR7       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)VPATHr   libdirr  r  wr  r   NrR  rQ  rP  rO  rN  r/   rS  rV  r  Tr  r$   r  rG   r  )r  	sysconfigget_config_varr   r   r0   rv  mkdirr   writerS  r1   r  r  r  )r7   r}  vpathr|  r  	stdlibdirfilenamer   rS  r/   r'  r$   s   &           r   test_init_pybuilddir$InitConfigTests.test_init_pybuilddir  sd    $$&&& ,,W5;;EFWW\\&1F((fU)KLIHHVww||F,<=Hhf55  6 #'":":"<&/#&,#J"I$<$<]$Ky77A!:j%':iF ((0C""#<f'1s156 # C9 '& 65 '&&s%   CF!$F	6BF!FF!!F2	zSee test_init_pybuilddirc                n   \         P                  ! R 4      pRp\        P                  P	                  V4      P                  \        P                  4      ^8X  d!   \        P                  P                  VR4      pV P                  V4      ;_uu_ 4       p\        P                  P	                  \        P                  P                  W14      4      p\        P                  P	                  \        P                  P                  W1R4      4      p\        P                  P                  VR4      p\        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       V P                  4       p\        P                  P                  V\        P                  P                  VR,          4      4      VR&   W8R&   WXR&   V P                  p	R	VR
VRV	RV	RVRVRVRV/p
V P                  V
4      pV P                  RV
\         VRVR7       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r  zPCbuild\archinstrumentedr  r  r  r  r   NrR  rP  rN  r/   rO  rQ  rS  rV  r  Fr  r  r  )r  r  r   r   rv  countsepr0   r  r   r  rS  r   r1   r  r  r  )r7   r  r|  r}  rO  r  r  r   rS  r/   r'  r$   s   &           r   test_init_pybuilddir_win32*InitConfigTests.test_init_pybuilddir_win32!  s    ((1 77E"((0A5WW\\&.9F$$V,,WW%%bggll6&ABF((fU)KLIww||F,<=Hhf55  6 #'":":"<&(ggll6277;K;KL_`bLc;d&e#&,#&/#J"Fv!:j&v%':i	F ((0C""#<f'1s16F # D7 -, 65 -,,s&   B0H#H	B1H#H H##H4	c                    V P                  4       ;_uu_ 4       p\        P                  ! 4       ;_uu_ 4       p\        P                  p\
        P                  ! R 4      p\        P                  P                  V\        4      p\        P                  P                  V4      '       * p\        '       gh   \        P                  P                  V\        P                  RVP                   RVP                   \          2R4      p\        P"                  ! V4       M\        P                  P                  VR4      p\        P"                  ! V4       \$        P&                  ! \        P                  P                  \(        P*                  R4      \        P                  P                  VR4      4       \        P                  P                  VR4      p	\-        V	RRR	7      ;_uu_ 4       p
\/        R
V,          V
R7       \/        RV
R7       RRR4       V P1                  4       p\        '       g   V'       d   XVR&   Me\        P                  P                  V\        P                  P3                  V^ ,          4      4      V\        P                  P                  VR4      .pV P4                  p\        P                  P                  V\        P                  P3                  V4      4      pRVRVR VRVRVRV/pV'       d   W.R&   \        '       dJ   W.R&   \        P                  P                  VR4      VR&   \7        \(        P8                  '       * 4      VR&   M0V P:                  VR&   \7        \(        P8                  '       * 4      VR&   V P=                  V4      pV P?                  RV\@        VRVR7       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     L.; i  + '       g   i     R# ; i)rO  r   r   rk  r  r   z
pyvenv.cfgr  r  r   z	home = %sfilez$include-system-site-packages = falseNrP  rQ  rN  r/   rS  rR  rV  ro  r  Tr  r  )!r  rs  rt  r.   rl  r  r  r   r   r0   PLATSTDLIB_LANDMARKr  r   rU  rm  rn  ro  rw  rZ  rz  r   
STDLIB_DIRr   rV   rS  r   r1   r  rh  r  r  r  r  )r7   r}  pyvenv_homerp  rP  
platstdlibchange_exec_prefixlib_dynload
lib_folderr  r   r  r/   rN  r'  r$   s   &               r   test_init_pyvenv_cfg$InitConfigTests.test_init_pyvenv_cfgI  s    $$&&&((**k""C#228<K k3FGJ%'WW]]:%>!>: ggll;+.>>-3CII;a		{:,+W+8: K(WW\\+u=
J'GGLL!3!3W=GGLLW5
 ww||FL9Hhf55kK/b9<2F 6 ,,.E:% +E"I GGLL)9)9%()CDGGLLe4 J ggll;8H8H8TUO{v&!?j%uF "-8)*z(3}%')ww||K'G|$/38H8H4H/I+, (,'9'9|$/38H8H4H/I+,((0C""#<f'1s156 # C + '&4 6553 +* '&&sU   O,F/O	&"O#O	,O	4C	O	>O	B%O	3O,O	O	O)$O,,O=	zspecific to Windowsc           	     
   RRRRRR\         P                  ! 4        R23.pV P                  R/ \        4       CR\         P                  P
                  P                  R V 4       4      /CR7      w  r#V P                  VR4        \        P                  ! V4      pVR	,          R
,          p\        W4       F  w  w  rVpV P                  Wv4       K  	  R#   \        P                   d    T P                  RT: 24        Lfi ; i)	C:/a. . .za. . .z\ar  r   c              3   2   "   T F  q^ ,          x  K  	  R# 5i)r   Nr   ).0cs   & r   	<genexpr>=InitConfigTests.test_getpath_abspath_win32.<locals>.<genexpr>  s     3H%QaDD%s   r   r   r  r'  rS  N)r  	C:\a. . .)r  r  )z\\?\C:////a////b. . .z\\?\C:\a\b. . .)z//a/b/c. . .\\a\b\c. . .)r  r  )r   r4   r]   r&   r   r   r0   rW   r  r  r  r  zip)r7   CASESr[   r\   r   r   r  results   &       r   test_getpath_abspath_win32*InitConfigTests.test_getpath_abspath_win32  s    )(@04"))+c*+
 00)J(* Jrww333H%3HHJ 1 

 	b!	9**S/C h- 56%(%8!MQ6V. &9	 ## 	9II/w78	9s   C *DDc                  a	 \         P                  ! R 4      o	V	3R lpV! R4      pV! R4      pV! R4      pV! R4      pV! R4      pV! R4      p\        P                  ! 4       R,          pV P	                  \        V! 4       P                  \        P                  P                  4      4      VR	,          4       V P	                  V! 4       VR
,          4       V P	                  V! 4       VR,          4       V P	                  V! 4       VR,          4       V P	                  V! 4       VR,          4       V P	                  V! 4       VR,          4       R# )ctypesc                 d   < \        SP                  V 4      pRVn        SP                  Vn        V# )Nr   )getattr	pythonapiargtypes	c_wchar_prestype)r   funcr  s   & r   get_func8InitConfigTests.test_global_pathconfig.<locals>.get_func  s.    6++T2DDM!++DLKr   
Py_GetPathPy_GetPrefixPy_GetExecPrefixPy_GetProgramNamePy_GetProgramFullPathPy_GetPythonHomer'  rS  rO  rQ  rH  r/   rM  N)
r   r   r   get_configsrW   tupler  r   r   r   )
r7   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:z|11"''//BC 56	8)9:)+VM-BC*,f^.DE.0&2FG)+VF^<r   c                p    . ROp/ pR^R. RO/p\        W#4       WR&   V P                  RW2\        R7       R# )	ignore:::PyConfig_Insert0rX  rJ  r#  test_init_warnoptionsr  N)r  r"  zignore:::env1zignore:::env2zignore:::cmdline1zignore:::cmdline2r  zignore:::PySys_AddWarnOption1zignore:::PySys_AddWarnOption2zignore:::PyConfig_BeforeReadzignore:::PyConfig_AfterRead)r  z-Wignore:::cmdline1z-Wignore:::cmdline2r  )r7   r#  r&  r'  s   &   r   r  %InitConfigTests.test_init_warnoptions  sQ    + 	Q 1
 		* +}6#- 	 	/r   c           
     r    R R/pRRRRR/R^
RRR^/p\        W4       V P                  R	W!\        RR
7       R# )r/  TrG  r  rK  r$  r8  r7  r<  test_initconfig_api)r  r  N)r(  r  r  r  s   &  r   r  #InitConfigTests.test_initconfig_api  sb     
	 3.Ta
 		* 	4f#/t 	 	Er   c                (    V P                  R 4       R# )test_initconfig_get_apiNr]   rA   s   &r   r  'InitConfigTests.test_initconfig_get_api  s    %%&?@r   c                (    V P                  R 4       R# )test_initconfig_exitNr  rA   s   &r   r  $InitConfigTests.test_initconfig_exit   s    %%&<=r   c                (    V P                  R 4       R# )test_initconfig_moduleNr  rA   s   &r   r  &InitConfigTests.test_initconfig_module  s    %%&>?r   c                (    V P                  R 4       R# )test_get_argc_argvNr  rA   s   &r   r  "InitConfigTests.test_get_argc_argv  s    %%&:;r   c                   0 RmpV F  w  r#RV 2pVP                  R4      '       d   VR,          pMRpRRRR.RR	R
VRR.RR	RRRRRRV/RV/pV'       d   RVR,          /MRpV P                  \        V4      4      ;_uu_ 4        V P                  RV\        VR7       RRR4       K  	  R#   + '       g   i     K  ; i)=onTr  frozen_modulesr   r.  rI  r  rJ  rN  r  r  rH  rg  r  r5  rK  ro  
TESTFROZENNtest_init_use_frozen_modulesr  >   z=offFr   Tr  r  T)r#   r
  reprr  r  )r7   testsr   r  optvalxoption_valuer'  r$   s   &       r   r  ,InitConfigTests.test_init_use_frozen_modules
  s    
 #MC%cU+F~~c"" #B $divtVD	x!4-}=$h	F .1<R)dCd3i((&&'Ev+53 ' @ )(# #" )((s   B--B>c                Z   ^ pRpR	pR
pRpRpRW,          V,          V,          V,          RR/pV P                  R4      w  rV P                  V	R4        \        P                  ! V4      pV P                  W4       R#   \        P                   d    T P                  RT: 24        L?i ; i)r   feature_flagsown_gilT#test_init_main_interpreter_settingsr   r  N   i   i   i   i   )r]   rW   r  r  r  r  )
r7   OBMALLOC
EXTENSIONSTHREADSDAEMON_THREADSFORKEXECr  r[   r\   s
   &         r   r  3InitConfigTests.test_init_main_interpreter_settings&  s    
 $&0>At	
 001
 	b!	9**S/C 	' ## 	9II/w78	9s   A= =*B*)B*c                P    V P                  R 4      w  rV P                  VR4       R# )test_init_in_background_threadr   Nr   r   s   &  r   r  .InitConfigTests.test_init_in_background_thread>  s'     001QRb!r   )r1   )r!  r4  r5  r  )Py_UTF8Moder2  ))Py_BytesWarningFlagrX  )Py_DebugFlagr]  )Py_DontWriteBytecodeFlagr^  T) Py_FileSystemDefaultEncodeErrorsrF  )Py_FileSystemDefaultEncodingrE  )Py_FrozenFlagrm  T)Py_IgnoreEnvironmentFlagr5  T)Py_InspectFlagrZ  )Py_InteractiveFlagr[  )Py_IsolatedFlagr4  )Py_NoSiteFlagrW  T)Py_NoUserSiteDirectoryra  T)Py_OptimizeFlagr\  )Py_QuietFlagr_  )Py_UnbufferedStdioFlagrc  T)Py_VerboseFlagrU   ))Py_LegacyWindowsFSEncodingFlagr3  ))Py_LegacyWindowsStdioFlagrv  r@   )NNNN)NN)krv   rw   rx   ry   r   r   r  objectr  r  r  PYMEM_ALLOCATOR_NOT_SETr  r  r    r  r  r  r  r  r.   int_infodefault_max_str_digitsDEFAULT_THREAD_INHERIT_CONTEXTDEFAULT_CONTEXT_AWARE_WARNINGSrU  r   rh  r  r  Py_GIL_DISABLEDis_appler  r  r  r  r  rM   r|  classmethodr}  r  r  r  r  r  r  r  r  r   skipIfcheck_bolt_optimizedr  r  r  r  r  r  r  r	  r  r  r  r  r   r%  r)  r,  r/  r2  r5  r8  skiprB  rG  rK  rO  rV  r\  r`  rg  rS  
contextlibcontextmanagerr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   requires_working_threadingr  rz   r{   r|   s   @r   r+  r+    s    G+5;L   HM 	
,eD5U   (%"
 	 .*$	 0!OP
PEP 	4P 	E	P 	"4P 	P 	QP 	cllAAP 	RP 	P 	qP 	!P 	qP 	!"@P  	!"@!P" 	T#P$ 	%%P& 	U'P( 	$)P* 	+P. 	1/P0 	/1P4 	$5P6 	*7P8 	e9P: 	;P< 	R=P@ 	BAPB 	rCPF 	$GPH 	IPJ 	(KPL 	-MPP 	$QPR 	)SPT 	)UPV 	.WPX 	1YPZ 	"4[P\ 	cnn]P^ 	(_Pb 	tcPd 	ePf 	 gPh 	5iPj 	ukPl 	amPn 	oPp 	$qPr 	1sPt 	uPv 	wPx 	tyPz 	U{P| 	$}P@ 	,APB 	*CPF 	!%GPH 	tIPJ 	dKPL 	MPN 	dOPR 	dSPT 		UPV 	tWPX 	dYPZ 	'"2"22[P\ 	U]P^ 	M_PMb $)j!'+m$&(l#(:n%"E
 	 -2)*M
 =!! %!O 27./ 	*1"A. 	%( %% '
 	 	!! #
 	 O# #<> =8~/+$=,4 >B4 #	4 38	4 >B	4l __W113\]N ^NMJ/.B/H __W113\] / ^ /D __W113\]!/ ^!/F//	//$1$RQQQNMJ/ ]] < =;=;L(M	O/ 3,L2&  6'8R:8x __Z!AB!C C!CF %?@%D A%DNECN %:;/ </6#=J/4 __W113\]E ^E"A>@<@8(0 002" 3"r   r+  c                   \   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )AuditingTestsiF  c                (    V P                  R 4       R# )test_open_code_hookNr  rA   s   &r   r6  !AuditingTests.test_open_code_hookG  s    %%&;<r   c                (    V P                  R 4       R# )
test_auditNr  rA   s   &r   r9  AuditingTests.test_auditJ  s    %%l3r   c                (    V P                  R 4       R# )test_audit_tupleNr  rA   s   &r   r<  AuditingTests.test_audit_tupleM  s    %%&89r   c                (    V P                  R 4       R# )test_audit_subinterpreterNr  rA   s   &r   r?  'AuditingTests.test_audit_subinterpreterP      %%&ABr   c                J    V P                  R \        P                  ^R7       R# )test_audit_run_commandrD   rE   Nr]   r   SHORT_TIMEOUTrA   s   &r   rC  $AuditingTests.test_audit_run_commandS  s$    %%&>.5.C.C12 	& 	4r   c                J    V P                  R \        P                  ^R7       R# )test_audit_run_filerD  NrE  rA   s   &r   rI  !AuditingTests.test_audit_run_fileX  s$    %%&;.5.C.C12 	& 	4r   c                   \         P                  P                  V P                  \        P
                  4      R ,           p\        VRRR7      ;_uu_ 4       p\        RVR7       \        RVR7       RRR4        / \        4       CRV/CpV P                  R	\        P                  ^
VR
7       \         P                  ! V4       R#   + '       g   i     L\; i  \         P                  ! T4       i ; i).pyr  r   r   z
import sysr  z&sys.__interactivehook__ = lambda: NoneNPYTHONSTARTUPtest_audit_run_interactivehookrD   rE   r$   r   r   r0   r5   r   TESTFNr   rV   r&   r]   r   rF  unlinkr7   startupr  r$   s   &   r   rN  ,AuditingTests.test_audit_run_interactivehook]  s    '',,t{{I,<,<=E'311Q,Q':C 2	G*,GowGC))*J292G2G57S * B IIg 21 IIgs   C:3C C	C0c                   \         P                  P                  V P                  \        P
                  4      R ,           p\        VRRR7      ;_uu_ 4       p\        RVR7       RRR4        / \        4       CRV/CpV P                  R\        P                  ^
VR	7       \         P                  ! V4       R#   + '       g   i     L\; i  \         P                  ! T4       i ; i)
rL  r  r   r   r  r  NrM  test_audit_run_startuprO  rP  rS  s   &   r   rW  $AuditingTests.test_audit_run_startupj  s    '',,t{{I,<,<=E'311Q&q! 2	G*,GowGC))*B292G2G57S * B IIg 21 IIgs   B8-3C 8C	C#c                J    V P                  R \        P                  ^R7       R# )test_audit_run_stdinrD  NrE  rA   s   &r   rZ  "AuditingTests.test_audit_run_stdinv  s$    %%&<.5.C.C12 	& 	4r   c                (    V P                  R 4       R# )test_get_incomplete_frameNr  rA   s   &r   r]  'AuditingTests.test_get_incomplete_frame{  rA  r   r   N)rv   rw   rx   ry   r6  r9  r<  r?  rC  rI  rN  rW  rZ  r]  rz   r{   r|   s   @r   r4  r4  F  s?     =4:C4
4

4
C Cr   r4  c                   .  a  ] tR tRt o R t]P                  ! ]P                  R8H  R4      ]P                  ! ]	RJ R4      R 4       4       t
]P                  ! ]P                  R4      R	 4       t]P                  ! ]P                  R
4      R 4       tRtV tR# )	MiscTestsi  c                (    V P                  R 4       R# )test_unicode_id_initNr  rA   s   &r   rb  MiscTests.test_unicode_id_init  s     	%%&<=r   r   z(Py_FrozenMain is not exported on WindowsNr)  c                   \        \        P                  4      pR VR&   V P                  RVR7      w  r#\        P                  P                  R4      p\        P                  ! RV R24      P                  4       pV P                  W%4       R# )r  PYTHONUNBUFFEREDtest_frozenmainr   rN  z
            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
        N)
r    r   r!   r]   r   ru  r   r   lstriprW   )r7   r$   r[   r\   r/   r  s   &     r   rf  MiscTests.test_frozenmain  s     2::"%001B0LWW%%i0
?? (  !+| ,		$  VX 	 	'r   z--X showrefcount requires a Python debug buildc           	        RpV EF@  w  r#RV 2p\         P                  RRRRVRV.p\        P                  ! V\        P                  \        P
                  RR7      pV P                  VP                  ^ 4       VP                  P                  4       p\        P                  ! RV4      pV'       g   V P                  R	V: 24       \        VP                  ^4      4      p	\        VP                  ^4      4      p
V P                  W#R
7      ;_uu_ 4        V P                  V	^ V4       V P                  V
^ V4       RRR4       EKC  	  R#   + '       g   i     EKY  ; i)offzfrozen_modules=r  r  showrefcountr  TrJ   rK   textz!^\[(-?\d+) refs, (-?\d+) blocks\]zunexpected output: )r  stmtN))rj  r  )onr  )rj  import __hello__)ro  rp  )r.   r/   rO   r   rQ   STDOUTrW   rE   rJ   r   rf   rg   r  r   groupr
  )r7   r  flagrn  xoptrY   r  r[   rg   refsblockss   &          r   test_no_memleakMiscTests.test_no_memleak  s   
  JD$TF+D>>4~tT4QUVC>>#)3)3):):'+-D T__a0++$$&CHHA3GE		/w78u{{1~&DQ(FT==  q#.  C0 >=   >==s   'EEz(-X presite requires a Python debug buildc                R   \         P                  R RRRR.p\        P                  ! V\        P                  \        P
                  RR7      pV P                  VP                  ^ 4       VP                  P                  4       pV P                  RV4       V P                  RV4       R	# )
r  r  z"presite=test._test_embed_structseqr  zprint('unique-python-message')Trl  zTests passedzunique-python-messageN)r.   r/   rO   r   rQ   rq  rW   rE   rJ   r   r   )r7   rY   r  r[   s   &   r   test_presiteMiscTests.test_presite  s     NN$<2

 ~~??$$	
 	!,kk!nc*-s3r   r   )rv   rw   rx   ry   rb  r   r-  r   r   r   rf  r  r   rh  rw  rz  rz   r{   r|   s   @r   r`  r`    s     > __RWW_?A__&$.0LM( NA(  ))HJ1J14 ))CE4E4r   r`  __main__)Dtestr   test.supportr   r   r   r   r   collectionsr   r0  r  r   os.pathrf   rZ  rO   r.   r  rs  r   has_subprocess_supportr   r   ImportErrorplatformrY  r%  r%  PYMEM_ALLOCATOR_MALLOCPYMEM_ALLOCATOR_MIMALLOCr*  r  hasattrr  r  r  r  r   MAX_HASH_SEEDro  r   rU  r  rl  rm  VERSION_MAJORrn  VERSION_MINORr(  r)  r   r0   rO  STDLIB_INSTALLisfiler   r&   r(   TestCaser   r(  r-  r+  r4  r`  rv   rs   r   r   r   <module>r     s    O O  "   	  	   
   %%%


=
>>
 
	!    
313$ 


+++S
77d? ^^,$$**M$$**M!nn-W]O1+_ZLF '.&=&=&=1 &-&=&=&=1  cjj#..S##$Ac&6&6&<&<%=>@	ww~~bggll>7;<<N5k! k!\A8((*;*; A8H
 
"d*,HIr")8+<+< r" Jr"j)6C'):): 6CrG4#X%6%6 G4T zMMO a=  s   .J 	JJ