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B%$gtЏ򤵍zHNuЯ-'40;_3 !01"@AQa2Pq#3BR?ʩcaen^8F<7;EA{EÖ1U/#d1an.1ě0ʾRh|RAo3m3 % 28Q yφHTo7lW>#i`qca m,B-j݋'mR1Ήt>Vps0IbIC.1Rea]H64B>o]($Bma!=?B KǾ+Ծ"nK*+[T#{EJSQs5:U\wĐf3܆&)IԆwE TlrTf6Q|Rh:[K zc֧GC%\_a84HcObiؖV7H )*ģK~Xhչ04?0 E<}3#u? |gS6ꊤ|I#Hڛ աwX97Ŀ%SLy6č|Fa 8b$sקhb9RAu7˨pČ_\*w묦F 4D~f|("mNKiS>$d7SlA/²SL|6N}S˯g]6; #. 403WebShell
403Webshell
Server IP : 45.32.152.128  /  Your IP : 216.73.216.91
Web Server : nginx/1.24.0
System : Linux stage-vultr 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : forge ( 1000)
PHP Version : 8.2.14
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/2271/cwd/usr/lib/python3.8/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/2271/cwd/usr/lib/python3.8/__pycache__/subprocess.cpython-38.pyc
U

���g.�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZdddddd	d
ddd
ddddgZ
zddlZddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&e
�'dddddddddddd d!d"d#d$d%d&d'g�Gd(d�de(�Z)Gd)d
�d
e)�Z*Gd*d�de)�Z+e�r�Gd+d�d�Z,Gd,d-�d-e-�Z.n&e/ed.d/�Z0e1ed0��r�ej2Z3nej4Z3e�r�dZ5d1d2�Z6ngZ5d3d2�Z6d4Z7d5Z8d6Z9d7d8�Z:d9d:�Z;dd;�d<d�Z<d=d�Z=dd;�d>d�Z>Gd?d�de?�Z@ddddd@�dAd�ZAdBdC�ZBdDd	�ZCdEd
�ZDdFdG�ZEeE�ZFGdHd�de?�ZGdS)Ia�Subprocesses 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
�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'� /usr/lib/python3.8/subprocess.pyr`sc@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�Raised 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)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|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�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�	r$r%r&�__doc__r/r3�propertyr5�setterr'r'r'r(rcs

c@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r<r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r<r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr=)r.r>r?r@rArBrCr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrDr=)	rC�copy�listr#r>r?r@rArB)r.Z	attr_listr'r'r(rE�s
�zSTARTUPINFO.copy)r$r%r&r/rEr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rH�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rKr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rH�_winapirIrJrLrN�__del__r'r'r'r(rG�s
rGZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srRc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rR�s���������cCs*g}tjj}|dkr&|�dd|�|S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r�-�O)rW�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
recCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	d
d
�}tjj
}ttdi�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr_z-Iz-Ez-sN�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrs)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%srv)
re�items�getattrrWrarc�isolated�ignore_environment�no_user_site�warnoptionsrprY�extend)Zflag_opt_maprd�flagZoptriZwarnoptsrpZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r<c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)z�Run 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"])
    r�N)r�wait�kill)r<�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|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"])
    rdNr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|d	d
�|��jS)aRun 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'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    r5z3stdout argument not allowed, it will be overridden.�inputN�universal_newlines�text��T)r5r<�check)r1r�rrr5)r<r�r��emptyr'r'r(r
ps#�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
raEA 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||_||_||_||_dSr))rdr*r5r-)r.rdr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrdr*r5rcr-�typer$�join)r.rdr'r'r(rN�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dS)z6Raise CalledProcessError if the exit code is non-zero.N)r*rrdr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r9r/rNr�r'r'r'r(r�s

	)r��capture_outputr<r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)	aKRun 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 bytes or 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.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrdr)r�r�r<r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�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� �	�"�\�z\"r�)�map�os�fsdecoderc�lenrr�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)a�Return (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)�shellr�r-rNr\�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�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'
    rt)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)a�Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    �posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrt)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rW�platform�confstr�splitr�r1�tupler�rK�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdZdKdddd�d	d
�Zedd��Zejd
d��Zdd�Z	dd�Z
dd�Zej
ejfdd�Zdd�Zdd�ZdLdd�Zdd�Zdd�ZdMd d!�ZdNd"d#�Zd$d%�Ze�rd&d'�Zd(d)�Zd*d+�Zd,d-�Zdejej ej!fd.d/�Z"d0d1�Z#d2d3�Z$d4d5�Z%d6d7�Z&d8d9�Z'e'Z(n�d:d'�Zd;d<�Z)d=d-�Ze*j+e*j,e*j-e*j.e*j/e*j0fd>d?�Z1de*j2e*j3e4j5fd@d/�Z"dAdB�Z6dCd1�Z#dDd5�Z%dEdF�Z7dGd7�Z&dHd9�Z'dIdJ�Z(dS)Ora� 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.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      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
    Fr\NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|d	kr�t
d
��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td��|�|||�\}}}}}}t	�rN|dk�rt�|��d	�}|dk�r4t�|��d	�}|dk�rNt�|��d	�}|�pb|�pb|�pb||_d|_d|_|j�r�|d
k�r�d}d}nd}z�|dk�r�t� |d|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)zCreate new Popen instance.NFr\zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rt�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rR�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerK�	TypeErrorr�r1�warnings�warn�RuntimeWarningrdr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerL�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrcr�r�rGrJr�)r.rd�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerS)�_child_createdr*r��ResourceWarningrVrUrc)r.Z_maxsizeZ_warnr'r'r(rP�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)a9Interact with process: Send data to stdin and close it.
        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, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        z.Cannot send input after starting communicationNr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r<r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��S)zSCheck if child process has terminated. Set and return returncode
        attribute.)rVr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdS)z5Convenience for _communicate when computing timeouts.N)r)r.rr'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)z2Convenience for checking if a timeout has expired.Nr�r�)rrrdr�)r.r�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)z=Wait for child process to terminate; returns self.returncode.Nr�r)rr�r�rr�rr)r.r<rr	r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r\T)	rz�
contextlib�	ExitStackr��callbackrJr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)�|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            N)r\r\r\r\r\r\�r\r\r)rOZGetStdHandlerZ
CreatePiperGrIrr
r�Z
get_osfhandler�r�rK�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)z2Return a duplicate of handle, which is inheritablerrt)rOZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrG)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)z�Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles.cSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rOZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rF)r.rDr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCs2|rtd��t|t�rnNt|t�r:|
r.td��t|g�}n,t|tj�r^|
rRtd��t|g�}nt|�}|dk	rxt�|�}|dkr�t	�}n|�
�}d|||fk}|r�|jtj
O_||_||_||_|j}t|o�d|ko�|d�}|s�|�rl|�rl|dk�ri}|_t|�dg��}|d<|�r>|t|�t|�t|�g7}|�|�|dd�<|�rl|�sht�dt�d}|
�r�|jtjO_tj|_tj�d	d
�}d�||�}|dk	�r�t�|�}t� d||||�z,t�"||ddt|�|	|||�	\}}}}W5|�!|||
|||�Xd
|_#t$|�|_%||_&t�'|�dS)z$Execute program (MS Windows version)z"pass_fds not supported on Windows.z$bytes args is not allowed on Windows�0path-like args is not allowed when shell is trueNr\rDz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZCOMSPECzcmd.exez
{} /c "{}"�subprocess.PopenT)(�AssertionErrorr��str�bytesr�r�r��PathLiker�r#rEr>rOrr?r@rArCr�rFr�rKrr�r�r�rrrB�environr�rW�auditrZ
CreateProcessr�rG�_handler�rI)r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrDZcomspecZhpZhtr��tidr'r'r(r��s�	


��

�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS)z�Check 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&)r.rTZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rV8s
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)z-Internal implementation of wait() on Windows.Ni�)
rOZINFINITErKr*�WaitForSingleObjectr&ZWAIT_TIMEOUTrrd�GetExitCodeProcess)r.r<Ztimeout_millisr�r'r'r(r�Is
�
zPopen._waitcCs|�|���|��dSr))rcrr�)r.Zfh�bufferr'r'r(�
_readerthreadYszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrdT�_stderr_buffr)r5r�r,r�ZThreadr+Z
stdout_threadZdaemon�startr-r.Z
stderr_threadr�rr�rZis_aliverrdr�)r.r�rrr5r-r'r'r(r^sJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)�Send a signal to the process.NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdS)zTerminates the process.Nrt)r*rOZTerminateProcessr&�PermissionErrorr)ZSTILL_ACTIVE)r.Zrcr'r'r(r2�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)rrNr\)rr��piper
r�r�rKrrrW�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d	|_	|�
|||||	|
�dS)
z'Execute program using os.posix_spawn().N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr\rrtr��file_actionsT)r�r$rzr0rc�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rdr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr:r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|d	ks�|d
k�r|d	ks�|d
k�r|d	ks�|d
k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|dk�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td
��|�|dt�|���q�nd}t����tj����r�f}nt�fdd�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd
�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)zExecute program (POSIX version)rZgetandroidapilevelz/system/bin/shz/bin/shz-crNrr\r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r��pathr��fsencode)r�dir�r�r'r(�	<genexpr>bs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r!r"r�r#r�rFr�rWr%�_USE_POSIX_SPAWNr?�dirnamer=r6rc�dupr�ryr@r1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rKr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrXr*�ChildProcessErrorr�r�r�rz�builtinsr�
issubclassr��strerror))r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�kriZexecutable_listZfds_to_keepZerrpipe_data�partr�r
Zexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rBr(r�s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)�:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r*r)r.r
Z_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rR�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)z�Check 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*r��acquire�releaser�rRr�r)r.rTZ_waitpidZ_WNOHANGZ_ECHILDr�r
�er'r'r(rV�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fS)rZr)r�rQr�rS)r.Z
wait_flagsr�r
r'r'r(�	_try_wait�s
zPopen._try_waitc	Cs2|jdk	r|jS|dk	r�t�|}d}|j�d�r�zT|jdk	rDW�Fq�|�tj�\}}||jksj|dksjt	�||jkr�|�
|�W�q�W5|j��X|�|�}|dkr�t|j
|��t|d|d�}t�|�q&n\|jdk�r,|j�B|jdk	r�W5QR��q,|�d�\}}||jk�r |�
|�W5QRXq�|jS)z+Internal implementation of wait() on POSIX.Ng����Mb@?Frr�g�������?)r*rr�r[r\r^r��WNOHANGr�r rRrrrdr�time�sleep)r.r<rZdelayr�r
Z	remainingr'r'r(r��s8







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)rzN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushr�r�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErHZ
EVENT_READZget_maprr
�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrcr�r�r�r�r�r�)r.r�rrr5r-Z
input_viewZselectorr<Zready�keyZevents�chunkr�r'r'r(rs�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dS)Nr)r�r�rjr��encoder�r�)r.r�r'r'r(rc}s�zPopen._save_inputcCs|jdkrt�|j|�dS)r0N)r*r�r�r�r3r'r'r(r4�s
cCs|�tj�dS)z/Terminate the process with SIGTERM
            N)r4r0r1r2r'r'r(r2�scCs|�tj�dS)z*Kill the process with SIGKILL
            N)r4r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r\NNNNNTFNNNNrTFr')NN)F)N)8r$r%r&r9r�r/r:r�r;r�r�r�rWrXr�r�rPr�rr�r�rr
r�rr�r�rrr�rOr(Z
WAIT_OBJECT_0r)rVr�r+rr4r2r�r=r��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrRrQr_rZECHILDr^rcr'r'r'r(r�s�-��


D	�

H	
l�
26'�
�
#
)f)Hr9rTrr�r�r`r0rWr�r�rrr�__all__r�rOr��ModuleNotFoundErrorrNrirgrrrrrrrrrrrrrrrr r!r"r�	Exceptionrrrr#rKrGrzrkr�rQreZSelectSelectorrUrRrrr
rer�rrr
�objectrrr�rr	r�rHrr'r'r'r(�<module>
s�"�P
�
%	


;3"�EI
/

Youez - 2016 - github.com/yon3zu
LinuXploit