bg6UdZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z mZddlmZddlmZdd lmZdd lmZeZeeeej<dd ZddZdZdZeed<dZdZGddZ dZ!gdZ"dS)z We acquire the python information by running an interrogation script via subprocess trigger. This operation is not cheap, especially not on Windows. To not have to pay this hefty cost every time we apply multiple levels of caching. N) OrderedDict)Path)quote)ascii_lowercaseascii_uppercasedigits)Popen)AppDataDisabled) PythonInfo) subprocessTFc| tjn|}t|||||}t|tr|r|t jd|d}|S)N) ignore_cachez%s)osenviron_get_from_cache isinstance Exceptionlogginginfo)clsapp_dataexeenvraise_on_errorrresults t/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/virtualenv/discovery/cached_py_info.pyfrom_exersd "**C S(C< P P PF&)$$  'L Lv & & & Mct|}|s|tvrt|}nt|||||}|x}t|<t|tr||_|SN)r_CACHE_get_via_file_cacherr executable)rrrrrexe_pathrpy_infos rrr&spCyyH ,H..!%c8XsCHH$++!&*%%  MrcBt|} |j}n#t$rd}YnwxYw|t }d||}}|5|r|} | d| d| d} } } | |krl| |krf| | }|j } | 5tj | s|d}n||Gt||||\}}|.|||d} || n|}dddn #1swxYwY|S)Npathst_mtimecontent)r)r(r*)strstatr)OSErrorr r%lockedexistsread _from_dictcopysystem_executablerr(remove_run_subprocess_to_dictwrite)rrr(rr path_text path_modifiedr% py_info_storedataof_path of_st_mtime of_contentsys_exefailures rr"r"5sD I ,  "$$!8#3#3D#9#9]G     ""    ! ! ' %%''D/3F|T*=MtT]*[G)## }(D(D..):):;;!3&rw~~g/F/F&!((***"G$$&&& ?.sC3GG GW$19QXQaQaQcQcdd##D))))!%"""""""""""""""& Ns+ ::8DFFF COOKIE_LENGTHcdddttDS)Nc3K|]=}tjdttt fV>dS)rDN)randomchoicejoinrrr).0_s r zgen_cookie..Xs@ttZ[6=/?F)S!T!TUUttttttr)rHrangerBrr gen_cookierNWs- 77tt_der_s_sttt t ttrc ttjtjdz }t }t }||5}|t|||g}| }| ddtj dt| t|dtjtjtj|d}|\} } |j} n'#t&$r} d| j| j} } } Yd} ~ nd} ~ wwxYwdddn #1swxYwYd\} }| d kr| |ddd }|d kr=| d|}|rt.j|| |t4zd} | |ddd }|d kr=| |t4zd}|rt.j|| d|} || } || _n+|d | | rd | nd| rd | nd}t;d|}|| fS)Nz py_info.py__PYVENV_LAUNCHER__z get interpreter info via cmd: %sTzutf-8)universal_newlinesstdinstderrstdoutrencodingrD)NNrr'z with code z out: z err: zfailed to query )rrr(abspath__file__parentrNensure_extractedr+r2poprdebugLogCmdr r PIPE communicate returncoder-strerrorerrnofindsysrTr7rB _from_jsonr# RuntimeError)rrrrpy_info_script start_cookie end_cookiecmdprocessouterrcodeos_errorrr@ out_starts pre_cookieout_ends post_cookiemsgs rr5r5[s"'//(3344;lJN< 2 2CnC''zBhhjj %t,,, 8&++FFF C#' o!! G**,,HC%DD C C C!2HNdCCCCCC C%CCCCCCCCCCCCCCC(!OFG qyyXXl44R4011 ??[j[)J -   ,,,j=0223C88Jttt,-- b==h6889K .   ---ixi.C$$iii3'F'7'7'7'7Bi\_HgHXQTHXHXHXegii7#7788 F?s>+A E ADE E)D>9E>EEEEceZdZddZdZdS)r\Nc"||_||_dSr )rir)selfrirs r__init__zLogCmd.__init__srctdd|jD}|j |d|j}|S)N c3NK|] }tt|V!dSr )rr+)rIcs rrKz"LogCmd.__repr__..s.<rs ######;;;;;;;;;;//////333333111111 )z||ttCN        > suuu;;;|             r