Uname: Linux server.digisquadtech.com 4.18.0-553.100.1.el8_10.x86_64 #1 SMP Mon Feb 2 04:13:33 EST 2026 x86_64
User: 1091 (madhavfluid)
Group: 1090 (madhavfluid)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//usr/lib64/python3.6///__pycache__      ( Reset | Go to )
File Name: subprocess.cpython-36.pyc
3

 \@s8dZddlZejdkZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddlm Z Gddde ZGdddeZGd    d
d
eZerddlZddlZddlZGd d d ZnhddlZddlZddlZy ddlZWnek
rddlZYnXeed dZeedrejZnejZddddddddddddd
dgZ erddlm!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(e j)ddddd d!d"d#d g    Gd$d%d%e*Z+gZ,d&d'Z-d<Z.d=Z/d>Z0d+d,Z1d-d.Z2dd/d0dZ3d1dZ4dd/d2dZ5Gd3dde6Z7ddd4d5d6dZ8d7d8Z9d9dZ:d:dZ;e6Z<Gd;dde6Z=dS)?aSubprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
NZwin32)    monotonicc@s eZdZdS)SubprocessErrorN)__name__
__module__ __qualname__rr"/usr/lib64/python3.6/subprocess.pyr9src@s<eZdZdZd
ddZddZeddZejd    dZdS) CalledProcessErrorzRaised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    NcCs||_||_||_||_dS)N)
returncodecmdoutputstderr)selfr
r r r rrr__init__CszCalledProcessError.__init__c Csb|jrN|jdkrNyd|jtj|j fStk
rJd|j|j fSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r
r signalZSignals
ValueError)rrrr__str__IszCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr)r )rrrrstdoutUszCalledProcessError.stdoutcCs
||_dS)N)r )rvaluerrrrZs)NN)    rrr__doc__rrpropertyrsetterrrrrr    <s

 r    c@s<eZdZdZd
ddZddZeddZejd    dZdS) TimeoutExpiredzThis exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dS)N)r timeoutr r )rr rr r rrrrhszTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r r)rrrrrnszTimeoutExpired.__str__cCs|jS)N)r )rrrrrrszTimeoutExpired.stdoutcCs
||_dS)N)r )rrrrrrvs)NN)    rrrrrrrrrrrrrras

 rc@s eZdZdZdZdZdZdZdS) STARTUPINFOrN)rrrdwFlags    hStdInput
hStdOutput    hStdError wShowWindowrrrrrs
rZPIPE_BUFi PollSelectorPopenPIPESTDOUTcall
check_callgetstatusoutput    getoutput check_outputrunDEVNULLCompletedProcess)CREATE_NEW_CONSOLECREATE_NEW_PROCESS_GROUPSTD_INPUT_HANDLESTD_OUTPUT_HANDLESTD_ERROR_HANDLESW_HIDESTARTF_USESTDHANDLESSTARTF_USESHOWWINDOWr,r-r.r/r0r1r2r3c@s6eZdZdZejfddZddZddZeZ    eZ
dS)    HandleFcCs|jsd|_||dS)NT)closed)r CloseHandlerrrClosesz Handle.ClosecCs |jsd|_t|StddS)NTzalready closed)r5intr)rrrrDetachsz Handle.DetachcCsd|jjt|fS)Nz%s(%d))    __class__rr8)rrrr__repr__szHandle.__repr__N) rrrr5_winapir6r7r9r;__del__rrrrrr4s r4c CsTxNtddD]>}|jtjd}|dk    rytj|Wqtk
rJYqXqWdS)N)
_deadstate)_active_internal_pollsysmaxsizeremover)Zinstresrrr_cleanupsrEcCs*g}tjj}|dkr&|jdd||S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r-O)rAflagsoptimizeappend)argsrrrr"_optim_args_from_interpreter_flagss
rOcCsddddddd}t}x:|jD].\}}ttj|}|dkr"|jd    ||q"Wtjjrh|jd
n$tjjrz|jd tjjr|jd xtj    D]}|jd |qWttdi}xDdD]<}||kr||}|dkr|}n d||f}|j
d|fqW|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.dBSvbq)debugdont_write_bytecodeno_siteverbose bytes_warningquietrrIz-Iz-Ez-sz-W    _xoptions faulthandler tracemallocshowalloccount showrefcountutf8Tz%s=%sz-X)r]r^r_r`ra) rOitemsgetattrrArKrMisolatedignore_environment no_user_site warnoptionsextend)Z flag_opt_maprNflagoptrSZxoptionsrargrrr_args_from_interpreter_flagss:  

   rl)rcOsFt||2}y |j|dS|j|jYnXWdQRXdS)zRun command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    )rN)r!waitkill)r    popenargskwargsprrrr$s  cOs6t||}|r2|jd}|dkr(|d}t||dS)aORun command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    rNNr)r$getr    )rorpretcoder rrrr%(s



cOsTd|krtdd|kr<|ddkr<|jddr4dnd|d<t|t|d    d
|jS) a(Run command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    If universal_newlines=True is passed, the "input" argument must be a
    string and the return value will be a string rather than bytes.
    rz3stdout argument not allowed, it will be overridden.inputNuniversal_newlinesFT)rrcheck)rrrr)r"r)rrorprrrr(;s  c@s*eZdZdZd    ddZddZddZdS)
r+aEA process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    NcCs||_||_||_||_dS)N)rNr
rr )rrNr
rr rrrrrszCompletedProcess.__init__cCshdj|jdj|jg}|jdk    r4|jdj|j|jdk    rP|jdj|jdjt|jdj|S)Nz    args={!r}zreturncode={!r}z stdout={!r}z stderr={!r}z{}({})z, )    formatrNr
rrMr typerjoin)rrNrrrr;xs


zCompletedProcess.__repr__cCs |jrt|j|j|j|jdS)z6Raise CalledProcessError if the exit code is non-zero.N)r
r    rNrr )rrrrcheck_returncodesz!CompletedProcess.check_returncode)NN)rrrrrr;r|rrrrr+gs

    F)rtrrxc    Os|dk    r d|krtdt|d<t||}y|j||d\}}WnVtk
r||j|j\}}t|j|||dYn|j|jYnX|j}|r|rt    ||j||dWdQRXt
|j|||S)afRun command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    The other arguments are the same as for the Popen constructor.

    If universal_newlines=True is passed, the "input" argument must be a
    string and stdout/stderr in the returned object will be strings rather than
    bytes.
    Nstdinz/stdin and input arguments may not both be used.)r)r r ) rr"r! communicaterrnrNrmpollr    r+)    rtrrxrorpZprocessrr rsrrrr)s*  
 cCsg}d}x|D]}g}|r$|jdd|kp8d|kp8| }|rH|jdxj|D]b}|dkrf|j|qN|dkr|jdt|dg}|jdqN|r|j|g}|j|qNW|r|j||r|j||jdqWdj|S)    a
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    F     "\rGz\"rv)rMlenrhr{)seqresultZ    needquoterkZbs_bufcrrr list2cmdlines4



  


rcCslyt|ddtd}d}Wn.tk
rF}z|j}|j}WYdd}~XnX|dddkrd|dd}||fS)    aReturn (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    T)shellrur rNrF
r)r(r#r    r r
)r dataZexitcodeZexrrrr&s cCs t|dS)a%Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    rF)r&)r rrrr'"s
c@seZdZdZdZd?dddddeddddddddffddddd    Zd
d Zd d ZddZ    e
j e j fddZddZddZd@ddZddZddZddZerddZd d!Zd"d#Zdejejejfd$d%ZdAd&d'Zd(d)Zd*d+Z d,d-Z!d.d/Z"e"Z#nd0dZd1d#Ze$j%e$j&e$j'e$j(e$j)e$j*fd2d3Z+de$j,e$j-e.j/fd4d%Zd5d6Z0dBd7d'Zd8d+Z d9d:Z1d;d-Z!d<d/Z"d=d>Z#dS)Cr!a Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      universal_newlines: If true, use universal line endings for file
          objects stdin, stdout and stderr.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    FrFNrT)encodingerrorscCsrttj|_d|_d|_|dkr(d}t|ts:tdt    r|dk    rNt
d|dk    pd|dk    pd|dk    }|t kr~|rxd}qd}q|r|rt
dnF|t krd}|r| rt j dtd}| dk    rt
d    |d
krt
d ||_d|_d|_d|_d|_d|_| |_||_||_|j|||\}}}}}}t    rz|dkrFtj|jd
}|dkr`tj|jd
}|dkrztj|jd
}|p|p| }d|_y|dkrtj|d ||_|rtj|jd|dk||d |_|dkrtj|d||_|rtj|j||d|_|dkr6tj|d||_|r6tj|j||d|_|j ||||||
| | ||    ||||||||WnxDt!d|j|j|jfD]*}y |j"Wnt#k
rYnXqW|jsfg}|t$kr|j%||t$kr|j%||t$kr|j%|t&|dr|j%|j'xP|D]H}y*t    r<t|t(r<|j)n
t*j"|Wnt#k
r^YnXqWYnXdS)zCreate new Popen instance.NFrFzbufsize must be an integerz0preexec_fn is not supported on Windows platformsTzSclose_fds is not supported on Windows platforms if you redirect stdin/stdout/stderrzpass_fds overriding close_fds.z2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformswb) write_throughline_bufferingrrrb)rr_devnullrrrrrrr)+rE    threadingZLock _waitpid_lock_input_communication_started
isinstancer8    TypeError
_mswindowsr_PLATFORM_DEFAULT_CLOSE_FDSwarningswarnRuntimeWarningrNr}rr pidr
rurr _get_handlesmsvcrtZopen_osfhandler9_closed_child_pipe_fdsioopen TextIOWrapper_execute_childfiltercloseOSErrorr"rMhasattrrr4r7os)rrNbufsize
executabler}rr
preexec_fn    close_fdsrcwdenvru startupinfo creationflagsrestore_signalsstart_new_sessionpass_fdsrrZ any_stdio_setp2creadp2cwritec2preadc2pwriteerrreaderrwriteZ    text_modefZto_closefdrrrr`s


 




 
 
    





  

 zPopen.__init__cCs |j||}|jddjddS)Nz
r )decodereplace)rrrrrrr_translate_newliness zPopen._translate_newlinescCs|S)Nr)rrrr    __enter__szPopen.__enter__c
CsD|jr|jj|jr |jjz|jr2|jjWd|jXdS)N)rrr r}rm)rrzr    tracebackrrr__exit__s

zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d|j|d|jdkrPtdk    rPtj|dS)Nzsubprocess %s is still running)source)r>)_child_createdr
rResourceWarningr@r?rM)rZ_maxsizeZ_warnrrrr=
s


 z Popen.__del__cCs"t|dstjtjtj|_|jS)Nr)rrrdevnullO_RDWRr)rrrr _get_devnulls
zPopen._get_devnullcCs|rZy|jj|WnDtk
r(Yn2tk
rX}z|jtjkrFnWYdd}~XnXy|jjWnDtk
r|Yn2tk
r}z|jtjkrnWYdd}~XnXdS)N)r}writeBrokenPipeErrorrerrnoZEINVALr)rrtexcrrr _stdin_writes"  zPopen._stdin_writec Cs|jr|rtd|dkr|j r|j|j|jgjddkrd}d}|jrV|j|n6|jrr|jj}|jjn|jr|jj}|jj|j    nJ|dk    rt
|}nd}z|j |||\}}Wdd|_X|j    |j |d}||fS)a4Interact with process: Send data to stdin.  Read data from
        stdout and stderr, until end-of-file is reached.  Wait for
        process to terminate.

        The optional "input" argument should be data to be sent to the
        child process (if self.universal_newlines is True, this should
        be a string; if it is False, "input" should be bytes), or
        None, if no data should be sent to the child.

        communicate() returns a tuple (stdout, stderr).  These will be
        bytes or, if self.universal_newlines was True, a string.
        z.Cannot send input after starting communicationNrGT)r) rrr}rr countrreadrrm_time _communicate_remaining_time)rrtrrr endtimestsrrrr~7s.
 
 


 zPopen.communicatecCs|jS)zSCheck if child process has terminated. Set and return returncode
        attribute.)r@)rrrrrhsz
Popen.pollcCs|dkr dS|tSdS)z5Convenience for _communicate when computing timeouts.N)r)rrrrrrnszPopen._remaining_timecCs&|dkr dSt|kr"t|j|dS)z2Convenience for checking if a timeout has expired.N)rrrN)rr orig_timeoutrrr_check_timeoutvs
zPopen._check_timeoutc Cs|dkr|dkr|dkrd
Sd \}}d\}}d\}}    |dkrttjtj}|dkrrtjdd\}}
t|}tj|
nj|tkrtjdd\}}t|t|}}n>|tkrtj    |j
}n&t |t rtj    |}ntj    |j }|j|}|dkr,tjtj}|dkrtjdd\}
}t|}tj|
nn|tkrZtjdd\}}t|t|}}n@|tkrttj    |j
}n&t |t rtj    |}ntj    |j }|j|}|dkrtjtj}    |    dkrftjdd\}
}    t|    }    tj|
n~|tkrtjdd\}}    t|t|    }}    nP|tkr&|}    n@|tkr@tj    |j
}    n&t |t rXtj    |}    ntj    |j }    |j|    }    ||||||    fS)z|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            NrFrrrrrrr)rrrrrrrr)rrrr)rrrr)rr)r<Z GetStdHandler.Z
CreatePiper4r6r"r*rZ get_osfhandlerrr8fileno_make_inheritabler/r0r#) rr}rr rrrrrr_rrrrsn    

 
 

  

 
 


  
zPopen._get_handlescCs&tjtj|tjddtj}t|S)z2Return a duplicate of handle, which is inheritablerrF)r<ZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSr4)rZhandlehrrrrs

zPopen._make_inheritablecCsJ| stdt|ts t|}|dkr.t}d    | ||fkr^|jtjO_| |_||_    ||_
|
r|jtj O_tj |_ tjjdd}dj||}z>tj||ddt| |    ||dk    rtj|nd|    \}}}}Wd| d
kr| j|d kr|j|d kr|jt|drtj|jd|_Xd|_t||_||_tj|dS) z$Execute program (MS Windows version)z"pass_fds not supported on Windows.NrFZCOMSPECzcmd.exez
{} /c "{}"rTrrrr)AssertionErrorrstrrrrr<r2rrrr3r1rrenvironrrryZ CreateProcessr8fspathr7rrrrrr4_handlerr6)rrNrrrrrrrrrrrrrrrZunused_restore_signalsZunused_start_new_sessionZcomspecZhpZhtrtidrrrrsH    
 
  
zPopen._execute_childcCs,|jdkr&||jd|kr&||j|_|jS)zCheck if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            Nr)r
r)rr>Z_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessrrrr@s
 zPopen._internal_pollcCs|dk    r"tjdtdd|j|}|dkr2tj}n t|d}|jdkrztj|j    |}|tj
krlt |j |tj |j    |_|jS)zOWait for child process to terminate.  Returns returncode
            attribute.Nz0'endtime' argument is deprecated; use 'timeout'.rG)
stackleveli)rrDeprecationWarningrr<ZINFINITEr8r
WaitForSingleObjectrZ WAIT_TIMEOUTrrNGetExitCodeProcess)rrrZtimeout_millisrrrrrm$s 
 

 z
Popen.waitcCs|j|j|jdS)N)rMrr)rZfhbufferrrr _readerthread:szPopen._readerthreadcCs`|jrDt|d rDg|_tj|j|j|jfd|_d|j_|jj|j    rt|d rg|_
tj|j|j    |j
fd|_ d|j _|j j|j r|j ||jdk    r|jj|j||jjrt|j||j    dk    r|j j|j||j jrt|j|d}d}|jr|j}|jj|j    r4|j
}|j    j|dk    rF|d}|dk    rX|d}||fS)N _stdout_buff)targetrNT _stderr_buffr)rrrrZThreadrZ stdout_threadZdaemonstartr rZ stderr_threadr}rr{rZis_aliverrNr)rrtrrrr rrrr?sF




 

 



zPopen._communicatecCsl|jdk    rdS|tjkr"|jnF|tjkr>tj|jtjn*|tjkrZtj|jtjnt    dj
|dS)zSend a signal to the process.NzUnsupported signal: {}) r
rSIGTERM    terminateZ CTRL_C_EVENTrrnrZCTRL_BREAK_EVENTrry)rsigrrr send_signalss




zPopen.send_signalc CsX|jdk    rdSytj|jdWn2tk
rRtj|j}|tjkrH||_YnXdS)zTerminates the process.NrF)r
r<ZTerminateProcessrPermissionErrorrZ STILL_ACTIVE)rZrcrrrrs
 
zPopen.terminatec
Cs.d\}}d\}}d \}}    |dkr"n@|tkr8tj\}}n*|tkrJ|j}nt|trZ|}n|j}|dkrln@|tkrtj\}}n*|tkr|j}nt|tr|}n|j}|dkrnh|tkrtj\}}    nR|tkr|d kr|}    n
t    j
j}    n.|tkr|j}    nt|tr|}    n|j}    ||||||    fS) z|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            rFNrr)rrrr)rrrr)rrr) r"rpiper*rrr8rr#rA
__stdout__)
rr}rr rrrrrrrrrrsJ




 

 c)"st|ttfr|g}nt|}|
r:ddg|}r:|d<dkrJ|d}tj\}}g}x |dkr~|j|tj|}q`Wx|D]}tj|qWzz|dk    rg}xL|j    D]:\}}tj
|}d|krt d|j|dtj
|qWnd}tj
tj j rf}ntfdd    tj|D}t|}|j|tj|||tttt|||| | | |||||||||_d
|_Wdtj|Xt|d d}| dkr| dkr| |krtj| |dkr| dkr||krtj||dkr|dkr||krtj||dk    r.tj|d
|_t}x2tj|d }||7}| sft|d kr<Pq<WWdtj|X|ry6tj|jd\} }!| |jkr|j|!nt j!|_"Wnt#k
rYnXy|j$dd\}"}#}$|$j%}$Wn,t k
rd}"d}#dj&t|}$YnXtt'|"j%dt(}%t)|%t*r|#rt|#d}&|$dk}'|'rdd}$|}(n|}(|&dkrtj+|&}$|&t,j-kr|$dt.|(7}$|%|&|$|(|%|$dS)zExecute program (POSIX version)z/bin/shz-crNrH=z!illegal environment variable namec3s"|]}tjjtj|VqdS)N)rpathr{fsencode).0dir)rrr    <genexpr>sz'Popen._execute_child.<locals>.<genexpr>TrrFiP:rGsSubprocessError0z#Bad exception data from child: {!r}asciiZnoexecrvz: rrrrrr)/rrbyteslistrrrMduprrbrrrdirnametuple get_exec_pathsetadd_posixsubprocessZ    fork_execsortedmapr8rrrcr    bytearrayrrwaitpid_handle_exitstatusrArBr
ChildProcessErrorsplitrrybuiltinsr
issubclassrstrerrorrENOENTrepr))rrNrrrrrrrrrrrrrrrrrZorig_executableZ errpipe_readZ errpipe_writeZlow_fds_to_closeZlow_fdZenv_listkrSZexecutable_listZ fds_to_keepZ
devnull_fdZ errpipe_datapartrrZexception_nameZ    hex_errnoZerr_msgZchild_exception_typeZ    errno_numZchild_exec_never_calledZ err_filenamer)rrrs      






 
  




       



  cCsL||r|| |_n2||r*|||_n||r@|| |_ntddS)z:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r
r)rrZ _WIFSIGNALEDZ    _WTERMSIGZ
_WIFEXITEDZ _WEXITSTATUSZ _WIFSTOPPEDZ    _WSTOPSIGrrrr Xs zPopen._handle_exitstatuscCs|jdkr|jjdsdSzy8|jdk    r.|jS||j|\}}||jkrR|j|WnBtk
r}z&|dk    rv||_n|j|krd|_WYdd}~XnXWd|jjX|jS)zCheck if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            NFr)r
racquirerr rrrelease)rr>Z_waitpidZ_WNOHANGZ_ECHILDrrerrrr@js     
 


 c Cs>ytj|j|\}}Wntk
r4|j}d}YnX||fS)z:All callers to this function MUST hold self._waitpid_lock.r)rr rr )rZ
wait_flagsrrrrr    _try_waits 
zPopen._try_waitc Csp|jdk    r|jS|dk    r(tjdtdd|dk    s8|dk    r^|dkrLt|}n|dkr^|j|}|dk    rd}x|jjdrzL|jdk    rP|jt    j
\}}||j ks|dkst ||j kr|j |PWd|jjX|j|}|dkrt|j|t|d|d}tj|qnWnXxV|jdkrh|j8|jdk    r6P|jd\}}||j krZ|j |WdQRXqW|jS)    zOWait for child process to terminate.  Returns returncode
            attribute.Nz0'endtime' argument is deprecated; use 'timeout'.rG)rgMb@?Frg?)r
rrrrrrrrrWNOHANGrrr rrrNmintimeZsleep)rrrZdelayrrZ    remainingrrrrmsL
 

 


 
   c#Cs|jrZ|j rZy|jjWntk
r0YnX|sZy|jjWntk
rXYnXd}d}|jsi|_|jrg|j|j<|jrg|j|j<|jr|j|j}|jr|j|j}|j||j    rt
|j    }t }|jr|r|j |jt j|jr |j |jt j|jr$|j |jt jxJ|jrp|j|}|dk    r\|dkr\t|j||j|}    |j||x|    D]\}
} |
j|jkr||j|jt} y|jtj|
j| 7_Wn,tk
r|j|
j|
jjYn*X|jt|j    krf|j|
j|
jjnP|
j|j|jfkrxtj|
jd} | sT|j|
j|
jj|j|
jj| qxWq(WWdQRX|j |j|d|dk    rdj!|}|dk    rdj!|}|j"s|j#s|j$r|dk    r|j%||jj"|jj#}|dk    r|j%||jj"|jj#}||fS)Nri)rrw)&r}rflushrrZ_fileobj2outputrr _save_inputr
memoryview_PopenSelectorregister    selectorsZ EVENT_WRITEZ
EVENT_READZget_maprrrNselectrZfileobj _input_offset    _PIPE_BUFrrrZ
unregisterrrrMrmr{rrrur)rrtrrrr Z
input_viewZselectorrZreadykeyZeventschunkrrrrrs    




 
     
(







cCsR|jrN|jdkrNd|_||_|dk    rN|js6|js6|jrN|jj|jj|jj|_dS)Nr)r}rr$rrruencode)rrtrrrr/s zPopen._save_inputcCs|jdkrtj|j|dS)zSend a signal to the process.N)r
rrnr)rrrrrr<s
cCs|jtjdS)z/Terminate the process with SIGTERM
            N)rrr)rrrrrBscCs|jtjdS)z*Kill the process with SIGKILL
            N)rrSIGKILL)rrrrrnGsz
Popen.killr)NN)NN)NN)2rrrrrrrrrrrArBrrr=rrr~rrrrrrrr<rZ WAIT_OBJECT_0rr@rmrrrrrnr WIFSIGNALEDWTERMSIG    WIFEXITED WEXITSTATUS
WIFSTOPPEDWSTOPSIGr r rrZECHILDrrrrrrr!2sd+ 
1H    @
46 "
4a r)>rrAplatformrrrrrrrrrr    Exceptionrr    rrrr<rrr#r" ImportErrorZdummy_threadingrcr%rr r ZSelectSelector__all__r,r-r.r/r0r1r2r3rhr8r4r?rEr"r#r*rOrlr$r%r(objectr+r)rr&r'rr!rrrr<module>*sr
 %    

( 
.,!2I 

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL