QfI ddlZddlZddlZddlmZeeeZ ejZ gdZ dZ dZde vrIdZdZddl dd lmZe j'd ddlZ dd lmZddlZe j1ee[nUd e vrId Zd Zddl dd lmZe j'd ddlZddlZe j1ee[ dd lmZnedeej6d<ddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$[ e dre%Z&dZ'e(Z)e'dde'dde'dde'dde'dde'dde'dd e'd!d"e'd#d$e'd%d&e'd'd(e'd)d*e'd+d,e'd-d.e'd-d/e'd0de)Z*e(Z)e'dde)Z+e(Z)e'd1d2e'd3de'd4de'd5d6e'd5d7e'd8d9e)jYee'd:d;e'dd?e d@re dAr e'dBd@e)Z-e(Z)e'dde'dde'dde'dCdDe'dEde dFr e'dGde'dde'dHde'dIde'dde'd0de'dJde)Z.[)[[&['dZ/dKZ0dLZ1ddNZ2dOZ3dPZ4e j1gdQe5Z6ddRZ7e j'dSe8ehe*kr)e9ehe-kr"ddMddTdUZ:dZ;dKZe j'dWdXZ?dYZ@dZZAd[ZBd\ZCd]ZDe j1gd^dd_ZEdd`ZFddalmGZGmHZHGdbdceGZIddZJeJZK[JddeZLed k7ZMe j1dfeMr/dgZNeIeKjeNePeNePZQ[NddhZRe j1didjZSeS\ZTZU[Se dkrKe dlsCe dmr;dZVdKxZWZXe j1gdndoZYdpZZdqZ[drZ\dsZ]e j1gdte dlrduZ^dvZ_e j1dwdxge dyrdzZ`d{Zae j1d|d}gejd~k7rddZcGddZde j'dddZedZfe ds efZgdeg_hGddejZjed k(rGddZkdZlyy#e$rYwxYw#e$rYwxYw#e$rYWwxYw#e$rY3wxYw)N)_check_methods)altsepcurdirpardirseppathseplinesepdefpathnamepathdevnullSEEK_SETSEEK_CURSEEK_ENDfsencodefsdecode get_exec_pathfdopenextsepc|tvSN)globals)r s )/opt/alt/python312/lib64/python3.12/os.py_existsr)s 79 c t|jS#t$r+t|Dcgc] }|ddk7s |ncc}wc}cYSwxYw)Nr_)list__all__AttributeErrordir)modulens r_get_exports_listr$,sH7FNN## 7v;6;a!A$#+;667sA  AA A  A posix )*)_exitr()_have_functionsntz zno os specific module foundzos.path)rrrrr rrr r)c`|tvr&|tvrtjt|yyyr)_globalsr)_setadd)strfns r_addr1hs' (N!7 HHXb\ ""8NrHAVE_FACCESSATaccess HAVE_FCHMODATchmod HAVE_FCHOWNATchown HAVE_FSTATATstatHAVE_FUTIMESATutime HAVE_LINKATlink HAVE_MKDIRATmkdir HAVE_MKFIFOATmkfifo HAVE_MKNODATmknod HAVE_OPENATopenHAVE_READLINKATreadlink HAVE_RENAMEATrenameHAVE_SYMLINKATsymlink HAVE_UNLINKATunlinkrmdirHAVE_UTIMENSAT HAVE_FCHDIRchdir HAVE_FCHMOD HAVE_FCHOWNHAVE_FDOPENDIRlistdirscandir HAVE_FEXECVEexecveHAVE_FTRUNCATEtruncate HAVE_FUTIMENS HAVE_FUTIMESHAVE_FPATHCONFpathconfstatvfsfstatvfs HAVE_FSTATVFS HAVE_LCHFLAGSchflags HAVE_LCHMODlchown HAVE_LCHOWN HAVE_LUTIMES HAVE_LSTAT MS_WINDOWSFc tj|\}}|stj|\}}|rQ|rOtj|s: t||t }t |trtt d}||k(ry t||y#t$rYEwxYw#t$r|rtj|sYywxYw)N)exist_okASCII) r splitexistsmakedirsFileExistsErrorr isinstancebytesr?OSErrorisdir)r modermheadtailcdirs rrqrqsD!JD$ ZZ% d T[[.  TH - dE ")D 4<  dD    tzz$/  0s$ B B$ B! B!$!CCc t|tj|\}}|stj|\}}|r.|r+ t|tj|\}}|r|r)yyyy#t$rYywxYwr)rNr roru)r rxrys r removedirsr|s}  $KD!JD$ ZZ% d 4  $KZZ% d 4$4$   s A00 A<;A<c tj|\}}|r"|r tj|s t|t ||tj|\}}|r|r t |yyy#t $rYywxYwr)r rorprqrIr|ru)oldnewrxrys rrenamesrsy CJD$ T[[. 3CJD$   t t   s' A55 BB)rqr|rc#K tjd||||t|g}tjtj }}|r|j }t|tr|'g}g}g} t|} d} | 5 t| } |tur&| jdxr| j }n| j}|r|j!| j"n|j!| j"|s8|r6|rd}n | j%}| }|r| j!| jyy#t$r} ||| Yd} ~ d} ~ wwxYw#t$rYnHwxYw#t$r} ||| d} Yd} ~ n*d} ~ wwxYw#t$rd}YwxYw#t$rd}YwxYwdddn #1swYnxYw| r|r=|||ft'|D]'}|||}|s ||r|j!|)n5|j!|||ft'| D]}|j!||r w)Nzos.walkFTfollow_symlinks)sysauditfspathr islinkjoinpoprstuplerVrunext StopIteration_walk_symlinks_as_filesis_dir is_junctionappendr is_symlinkreversed)toptopdownonerror followlinksstackrrdirsnondirs walk_dirs scandir_iterrorcontentryr walk_intordirnamenew_paths rwalkrsZ:vIIigw < C[ME;; DF iik c5 !I    J    $Z 0#"&==!&e!D!`UM^M^M`I`!& KK +NN5::.6#$( /).)9)9);J )3N  !((4W1 " "  )*D ##F#$ '/*/J /IZZZ   tW$ $#D>W- fX&6LL** LL#tW- .$Y/ X&0o sA4I7 E IG E,G>FAGF.(!G I E) E$I$E))I, E85E;6G7E88E;; F FGFG F+(G*F++G. F<9G;F<<G? IG 5IA Irrdir_fdc#K tjd|||||t|}td|||dffg}t |t } |rt |||||Ed{|r|r+|j\}}|tk(r t||r*yy75#|r+|j\}}|tk(r t||r*wwxYww)Nzos.fwalkT) rrr _fwalk_walkrsrt_fwalkr _fwalk_closeclose) rrrrrrisbytesactionvalues rfwalkrs @ *c7G_fMSkfc3=>?S%( !!%'7OTTT % \)%LU % \)%Ls<ACBBB$+CCB,CCCc #K|j\}}|tk(r t|y|tk(r|y|\}}} } |s#| t | d|} n| j d} t | t tz||jtf|sB|r tj jsytj t syt} g}g}|s|rdng}| D]b} | j }|r t#|} | j%r%|j||#|j| n|j|d|r ||fn|jt||fftj(dd|"|j+fd|dddDy|j+fdt-|ddd|dddDy#t$r} |r||| Yd} ~ yd} ~ wwxYw#t$r6 | j'r|j|n#t$rYnwxYwY[wxYww) NFrr)rrc3>K|]}td|z|dffywFNr).0r topfdtoppaths r z_fwalk..2s-(&DueWt^T4HI&sc3DK|]\}}td|z||ffywrr)rr rrrs rrz_fwalk..6s2C#AKD%ueWt^T5IJ#As )rrr _fwalk_yieldr9rEO_RDONLY O_NONBLOCKrurstS_ISDIRst_moder samestatrVr rrrrextendzip)rrrrrrrisrootdirfdtopnamerorig_sterrrrrentriesr rrs @@rrrsF   \ ! %L  | #K 16.w "="7E%PG#jjj?G(Z"7FE  lE*+bjj9==$u+6U^ !_$"E::D~ <<>KK%*u-NN4( & 4%/ / LL,$(GH I))GWRa[1 ? LL( 2J( ( LLC#&tDbDz74R4=#AC C_ "   8 '')t,  sz?I>G0BIAHBI0 H9 H I HI I!H?>I? I I I  IIIIrc t||yr)execvfileargss rexeclr<s $rc0 |d}t||dd|yNr)rXrrenvs rexeclerCs$8 r(C 4crC rc t||yr)execvprs rexeclprKs@ 4rc0 |d}t||dd|yr)execvpers rexeclperRs$ r(C D$s)S!rc t||yr_execvpers rrr[s0  T4rc t|||yrrrs rrrcs0  T4r)rrrrrrc| t}||f}nt}|f}t}tj|r ||g|yd}t |}t dk7rt|}tt|}|D]"}tj||} ||g|$|| #ttf$r } | } Yd} ~ Ad} ~ wt$r} | } || }Yd} ~ Xd} ~ wwxYw)Nr*) rXrenvironr rrr rmaprFileNotFoundErrorNotADirectoryErrorru) rrr exec_funcargrest saved_exc path_listr!fullnameelast_excs rrrns  + ' ||D$!!Ic"I t|~), 99S$'  h ) ) N"#56 H H   s$ BC )B00 C <CC c ddl}|t}|j5|jdt |j d}tr2 |d}| td|}|t|tr t|}dddt}|jtS#t $rd}YjwxYw#tt f$rYdwxYw#1swYLxYw)NrignorePATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)warningsrcatch_warnings simplefilter BytesWarningget TypeErrorsupports_bytes_environ ValueErrorKeyErrorrsrtrr ror)rrr path_listbs rrrs {  "h 5 I " ' \ ($DFF& $Iu)E$Y/ ) #, ??7 ##' I  i(   # "sRC B$C B5,C $ B2/C 1B22C 5CC CC  C)MutableMappingMappingcTeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zy )_EnvironcJ||_||_||_||_||_yr) encodekey decodekey encodevalue decodevalue_data)selfdatarrrrs r__init__z_Environ.__init__s'""&& rc |j|j|}|j|S#t$r t|dwxYwr)rrrrrkeyrs r __getitem__z_Environ.__getitem__sN *JJt~~c23E&& *3-T ) *s 1Ac~|j|}|j|}t||||j|<yr)rrputenvrrs r __setitem__z_Environ.__setitem__s7nnS!  'sE 3rc|j|}t| |j|=y#t$r t|dwxYwr)runsetenvrr)rr encodedkeys r __delitem__z_Environ.__delitem__sD^^C(  * :& *3-T ) *s ,Ac#jKt|j}|D]}|j|ywr)rrr)rkeysrs r__iter__z_Environ.__iter__s-DJJC..% %s13c,t|jSr)lenrrs r__len__z_Environ.__len__s4::rctdjfdjjD}d|dS)Nz, c3nK|],\}}j|dj|.yw)z: N)rr)rrrrs rrz$_Environ.__repr__..s>$ 0 U~~c"%R(8(8(?'B C0s25z environ({z}))rritems)rformatted_itemss` r__repr__z_Environ.__repr__s=))$ "jj..0$  O,C00rct|Sr)dictrs rcopyz _Environ.copys Dzrc||vr|||<||Srrs r setdefaultz_Environ.setdefaults d?DICyrc(|j||Sr)update)rothers r__ior__z_Environ.__ior__s E rcjt|tstSt|}|j ||SrrsrNotImplementedrr rr!rs r__or__z_Environ.__or__s,%)! !4j 5 rcjt|tstSt|}|j ||Srr$r&s r__ror__z_Environ.__ror__s,%)! !5k 4 rN)__name__ __module__ __qualname__rrrr rrrrrr"r'r)rrrrrs>' *& 1 rrctdk(r:d}|t}fd}i}tjD]\}}||||<n&t j fdfd}}t}t ||||S)Nr*cht|ts!tdt|jz|S)Nstr expected, not %s)rsr/rtyper*rs r check_strz!_createenviron..check_str s,eS) 6e9M9M MNNLrc0|jSr)upper)rencodes rrz!_createenviron..encodekeys#;$$& &rct|ts!tdt|jz|j dS)Nr/surrogateescape)rsr/rr0r*r5rencodings rr5z_createenviron..encodes:eS) 6e9M9M MNN<<*;< .decodes<<*;< .fsencodeIs4 (# h $??8V4 4Orcd t|}t|tr|jS|Sr)rrsrtr;rIs rrz_fscodec..fsdecodeUs4 (# h &??8V4 4Or)rr<getfilesystemencodeerrors)rrr9rKs @@r_fscodecrNEs6((*H  * * ,F   X rforkspawnvr)P_WAITP_NOWAIT P_NOWAITOc:t|ttfs td|r|ds t dt }|s | |||n ||||yy|tk(r|S t|d\}}t|rt|S#t dYyxYw)Nzargv must be a tuple or a listrz"argv first element cannot be empty) rsrrrrrOr(rRwaitpid WIFSTOPPEDwaitstatus_to_exitcode)rwrrrfuncpidwpidstss r _spawnvefr]rs$ .<= =47AB Bf ;t$tS)%x #CO cc?-c22 c s B Bc* t|||dtSr)r]rrwrrs rrPrPs C tT477rc* t||||tSr)r]rXrwrrrs rspawnverbs CtT377rc* t|||dtSr)r]rr_s rspawnvprds CtT488rc* t||||tSr)r]rras rspawnvperfs CtT388r)rPrbrdrfc t|||Sr)rPr_s rspawnlrhs C dD$''rc0 |d}t|||dd|Sr)rbras rspawnlerjs* C2htT49c22rrhrjrdc t|||Sr)rdr_s rspawnlprls CtT4((rc0 |d}t|||dd|Sr)rfras rspawnlperns* C2hdD"Is33rrlrnvxworksct|tstdt|z|dvrt d|z|dk(s| t dddl}|dk(r6|j |dd|j|}t|j|S|j |dd|j| }t|j|S) Nz&invalid cmd type (%s, expected string))rwzinvalid mode %rrz+popen() does not support unbuffered streamsrqT)shelltextstdoutbufsize)rsrtstdinrv) rsr/rr0r subprocessPopenPIPE _wrap_closerurw)cmdrw bufferingrxprocs rpopenrs#s#DtCyPQ Q z !.56 6 >Y.JK K 3;##C*.T+5??,5$7Dt{{D1 1##C*.T*4//,5$7Dtzz40 0rc0eZdZdZdZdZdZdZdZy)r{c ||_||_yr)_stream_proc)rstreamr~s rrz_wrap_close.__init__ s!DLDJrc|jj|jj}|dk(rytdk(r|S|dzS)Nrr*)rrrwaitr )r returncodes rrz_wrap_close.closesC LL   *JQt|!!!Q&rc|Srrrs r __enter__z_wrap_close.__enter__Krc$|jyrrrrs r__exit__z_wrap_close.__exit__ JJLrc.t|j|Sr)getattrr)rr s r __getattr__z_wrap_close.__getattr__s4<<. .rc,t|jSr)iterrrs rrz_wrap_close.__iter__s % %rN) r*r+r,rrrrrrrrrr{r{ s   '   / &rr{rct|tstdt|zddl}d|vr|j |}|j ||||g|i|S)Nz&invalid fd type (%s, expected integer)rb)rsintrr0io text_encodingrE)fdrwr}r9rkwargsrs rrr$s\ b# @48KLL  $##H- 2772tY B4 B6 BBrcr t|ttfr|St|} |j |}t|ttfr|Stdj|jt|j#t $r&t |drtd|jzwxYw)N __fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}) rsr/rtr0rr hasattrrr*format)r path_type path_reprs r_fspathr/s$e % T I9((. )c5\*!!' (:(:(,Y(@(@"BC C 9 9l + #%.%7%789 9 9s B/B6rcReZdZ ejdZedZeeZ y)PathLikec tr)NotImplementedErrorrs rrzPathLike.__fspath__Ws G!!rc6|tur t|dStS)Nr)rrr%)clssubclasss r__subclasshook__zPathLike.__subclasshook__\s (?!(L9 9rN) r*r+r,abcabstractmethodr classmethodr GenericAlias__class_getitem__rrrrrSs>M"" $L1rrc*eZdZdZdZdZdZdZy)_AddedDllDirectoryc.||_||_||_yr)r _cookie_remove_dll_directory)rr cookieremove_dll_directorys rrz_AddedDllDirectory.__init__gsDI!DL)=D &rcH|j|jd|_yr)rrr rs rrz_AddedDllDirectory.closeks  & &t|| 4DIrc|Srrrs rrz_AddedDllDirectory.__enter__nrrc$|jyrrrs rrz_AddedDllDirectory.__exit__prrcR|jrdj|jSy)Nzz)r rrs rrz_AddedDllDirectory.__repr__rs!yy299$))DD*rN)r*r+r,rrrrrrrrrrfs >    +rrc^ ddl}|j|}t|||jS)Nr)r*_add_dll_directoryrr)r r*rs radd_dll_directoryrws:  &&&t,!    $ $  r)iF)TNF).TNr)rqr)rqrN)mrrr9r_collections_abcrr0rrrbuiltin_module_names_namesrrr$r r r%r(r ImportError posixpathr r)rr*ntpathmodulesos.pathrrrrr rrr rr,r1setr-supports_dir_fdsupports_effective_idsr. supports_fdsupports_follow_symlinksrrrrqr|robjectrrrErVrrrrrrrrrrrrrrrrr=rrArrCrrtrErFrNrrrQrRrSr]rPrbrdrfrhrjrlrnplatformrr{rrrr*ABCrrrrrrrs0 +DI ! !  7 f DG w ) NN$U+,  V^ DG w  NN$R()  & 3 44 I     yH# 5D H%G$G$F# G$F#G$H%G$F# J'H% I&H%G$ G$O 5D H%! 5DG$G$G$ I& I&H%HHTN J'G$G$ J'ygj1 _i(K 5D H%, G$F#I&G$x ]G$F#G$F#F# G$F##     @&,445!(X'tv$x FFO2sww2$4<++" %U!               sHSS*S6TS'&S'*S32S36S?>S?T  T