b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/subprocess.pyc
Size40.11 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:24
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s3dZddkZeidjZddkZddkZddkZddkZddkZddk Z ddk
Z
de fd��YZ de fd��YZ
eo^ddklZddkZddkZddkZd fd
��YZd fd ��YZnFddkZeed
�ZddkZddkZeedd�ZddddddgZeoeid�nyeid�ZWn
dZnXgZd�Z dZ!dZ"d�Z#d�Z$d�Z%d�Z&de'fd��YZ(d�Z)d �Z*e+d!joeo e*�ne)�ndS("sÓ.subprocess - 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. This module
intends to replace several other, older modules and functions, like:

os.system
os.spawn*
os.popen*
popen2.*
commands.*

Information about how the subprocess module can be used to replace these
modules and functions can be found below.



Using the subprocess module
===========================
This module defines one class called Popen:

class Popen(args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
cwd=None, env=None, universal_newlines=False,
startupinfo=None, creationflags=0):


Arguments are:

args should be a string, or a sequence of program arguments. The
program to execute is normally the first item in the args sequence or
string, but can be explicitly set by using the executable argument.

On UNIX, with shell=False (default): In this case, the Popen class
uses os.execvp() to execute the child program. args should normally
be a sequence. A string will be treated as a sequence with the string
as the only item (the program to execute).

On UNIX, with shell=True: If args is a string, it specifies the
command string to execute through the shell. If args is a sequence,
the first item specifies the command string, and any additional items
will be treated as additional shell arguments.

On Windows: the Popen class uses CreateProcess() to execute the child
program, which operates on strings. If args is a sequence, it will be
converted to a string using the list2cmdline method. Please note that
not all MS Windows applications interpret the command line the same
way: The list2cmdline is designed for applications using the same
rules as the MS C runtime.

bufsize, if given, has the same meaning as the corresponding argument
to the built-in open() function: 0 means unbuffered, 1 means line
buffered, any other positive value means use a buffer of
(approximately) that size. A negative bufsize means to use the system
default, which usually means fully buffered. The default value for
bufsize is 0 (unbuffered).

stdin, stdout and stderr specify the executed programs' standard
input, standard output and standard error file handles, respectively.
Valid values are PIPE, an existing file descriptor (a positive
integer), an existing file object, and None. PIPE indicates that a
new pipe to the child should be created. With None, no redirection
will occur; the child's file handles will be inherited from the
parent. Additionally, stderr can be STDOUT, which indicates that the
stderr data from the applications should be captured into the same
file handle as for stdout.

If preexec_fn is set to a callable object, this object will be called
in the child process just before the child is executed.

If close_fds is true, all file descriptors except 0, 1 and 2 will be
closed before the child process is executed.

if shell is true, the specified command will be executed through the
shell.

If cwd is not None, the current directory will be changed to cwd
before the child is executed.

If env is not None, it defines the environment variables for the new
process.

If universal_newlines is true, the file objects stdout and stderr are
opened as a text files, but lines may be terminated by any of '\n',
the Unix end-of-line convention, '\r', the Macintosh convention or
'\r\n', the Windows convention. All of these external representations
are seen as '\n' by the Python program. Note: This feature is only
available if Python is built with universal newline support (the
default). Also, the newlines attribute of the file objects stdout,
stdin and stderr are not updated by the communicate() method.

The startupinfo and creationflags, if given, will be passed to the
underlying CreateProcess() function. They can specify things such as
appearance of the main window and priority for the new process.
(Windows only)


This module also defines two shortcut functions:

call(*popenargs, **kwargs):
Run command with arguments. Wait for command to complete, then
return the returncode attribute.

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

retcode = call(["ls", "-l"])

check_call(*popenargs, **kwargs):
Run 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 Popen constructor. Example:

check_call(["ls", "-l"])

Exceptions
----------
Exceptions raised in the child process, before the new program has
started to execute, will be re-raised in the parent. Additionally,
the exception object will have one extra attribute called
'child_traceback', which is a string containing traceback information
from the childs point of view.

The most common exception raised is OSError. This occurs, for
example, when trying to execute a non-existent file. Applications
should prepare for OSErrors.

A ValueError will be raised if Popen is called with invalid arguments.

check_call() will raise CalledProcessError, if the called process
returns a non-zero return code.


Security
--------
Unlike some other popen functions, this implementation will never call
/bin/sh implicitly. This means that all characters, including shell
metacharacters, can safely be passed to child processes.


Popen objects
=============
Instances of the Popen class have the following methods:

poll()
Check if child process has terminated. Returns returncode
attribute.

wait()
Wait for child process to terminate. Returns returncode attribute.

communicate(input=None)
Interact 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 a string to be
sent to the child process, or None, if no data should be sent to
the child.

communicate() returns a tuple (stdout, stderr).

Note: The data read is buffered in memory, so do not use this
method if the data size is large or unlimited.

The following attributes are also available:

stdin
If the stdin argument is PIPE, this attribute is a file object
that provides input to the child process. Otherwise, it is None.

stdout
If the stdout argument is PIPE, this attribute is a file object
that provides output from the child process. Otherwise, it is
None.

stderr
If the stderr argument is PIPE, this attribute is file object that
provides error output from the child process. Otherwise, it is
None.

pid
The process ID of the child process.

returncode
The child return code. A None value indicates that the process
hasn't terminated yet. A negative value -N indicates that the
child was terminated by signal N (UNIX only).


Replacing older functions with the subprocess module
====================================================
In this section, "a ==> b" means that b can be used as a replacement
for a.

Note: All functions in this section fail (more or less) silently if
the executed program cannot be found; this module raises an OSError
exception.

In the following examples, we assume that the subprocess module is
imported with "from subprocess import *".


Replacing /bin/sh shell backquote
---------------------------------
output=`mycmd myarg`
==>
output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]


Replacing shell pipe line
-------------------------
output=`dmesg | grep hda`
==>
p1 = Popen(["dmesg"], stdout=PIPE)
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
output = p2.communicate()[0]


Replacing os.system()
---------------------
sts = os.system("mycmd" + " myarg")
==>
p = Popen("mycmd" + " myarg", shell=True)
pid, sts = os.waitpid(p.pid, 0)

Note:

* Calling the program through the shell is usually not required.

* It's easier to look at the returncode attribute than the
exitstatus.

A more real-world example would look like this:

try:
retcode = call("mycmd" + " myarg", shell=True)
if retcode < 0:
print >>sys.stderr, "Child was terminated by signal", -retcode
else:
print >>sys.stderr, "Child returned", retcode
except OSError, e:
print >>sys.stderr, "Execution failed:", e


Replacing os.spawn*
-------------------
P_NOWAIT example:

pid = os.spawnlp(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg")
==>
pid = Popen(["/bin/mycmd", "myarg"]).pid


P_WAIT example:

retcode = os.spawnlp(os.P_WAIT, "/bin/mycmd", "mycmd", "myarg")
==>
retcode = call(["/bin/mycmd", "myarg"])


Vector example:

os.spawnvp(os.P_NOWAIT, path, args)
==>
Popen([path] + args[1:])


Environment example:

os.spawnlpe(os.P_NOWAIT, "/bin/mycmd", "mycmd", "myarg", env)
==>
Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"})


Replacing os.popen*
-------------------
pipe = os.popen("cmd", mode='r', bufsize)
==>
pipe = Popen("cmd", shell=True, bufsize=bufsize, stdout=PIPE).stdout

pipe = os.popen("cmd", mode='w', bufsize)
==>
pipe = Popen("cmd", shell=True, bufsize=bufsize, stdin=PIPE).stdin


(child_stdin, child_stdout) = os.popen2("cmd", mode, bufsize)
==>
p = Popen("cmd", shell=True, bufsize=bufsize,
stdin=PIPE, stdout=PIPE, close_fds=True)
(child_stdin, child_stdout) = (p.stdin, p.stdout)


(child_stdin,
child_stdout,
child_stderr) = os.popen3("cmd", mode, bufsize)
==>
p = Popen("cmd", shell=True, bufsize=bufsize,
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
(child_stdin,
child_stdout,
child_stderr) = (p.stdin, p.stdout, p.stderr)


(child_stdin, child_stdout_and_stderr) = os.popen4("cmd", mode,
bufsize)
==>
p = Popen("cmd", shell=True, bufsize=bufsize,
stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
(child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout)

On Unix, os.popen2, os.popen3 and os.popen4 also accept a sequence as
the command to execute, in which case arguments will be passed
directly to the program without shell intervention. This usage can be
replaced as follows:

(child_stdin, child_stdout) = os.popen2(["/bin/ls", "-l"], mode,
bufsize)
==>
p = Popen(["/bin/ls", "-l"], bufsize=bufsize, stdin=PIPE, stdout=PIPE)
(child_stdin, child_stdout) = (p.stdin, p.stdout)

Return code handling translates as follows:

pipe = os.popen("cmd", 'w')
...
rc = pipe.close()
if rc != None and rc % 256:
print "There were some errors"
==>
process = Popen("cmd", 'w', shell=True, stdin=PIPE)
...
process.stdin.close()
if process.wait() != 0:
print "There were some errors"


Replacing popen2.*
------------------
(child_stdout, child_stdin) = popen2.popen2("somestring", bufsize, mode)
==>
p = Popen(["somestring"], shell=True, bufsize=bufsize
stdin=PIPE, stdout=PIPE, close_fds=True)
(child_stdout, child_stdin) = (p.stdout, p.stdin)

On Unix, popen2 also accepts a sequence as the command to execute, in
which case arguments will be passed directly to the program without
shell intervention. This usage can be replaced as follows:

(child_stdout, child_stdin) = popen2.popen2(["mycmd", "myarg"], bufsize,
mode)
==>
p = Popen(["mycmd", "myarg"], bufsize=bufsize,
stdin=PIPE, stdout=PIPE, close_fds=True)
(child_stdout, child_stdin) = (p.stdout, p.stdin)

The popen2.Popen3 and popen2.Popen4 basically works as subprocess.Popen,
except that:

* subprocess.Popen raises an exception if the execution fails
* the capturestderr argument is replaced with the stderr argument.
* stdin=PIPE and stdout=PIPE must be specified.
* popen2 closes all filedescriptors by default, but you have to specify
close_fds=True with subprocess.Popen.
iÿÿÿÿNtwin32tCalledProcessErrorcBs eZdZd�Zd�ZRS(s This exception is raised when a process run by check_call() returns
a non-zero exit status. The exit status will be stored in the
returncode attribute.cCs||_||_dS(N(t
returncodetcmd(tselfRR((s"/usr/lib64/python2.6/subprocess.pyt__init__�s cCsd|i|ifS(Ns-Command '%s' returned non-zero exit status %d(RR(R((s"/usr/lib64/python2.6/subprocess.pyt__str__�s(t__name__t
__module__t__doc__RR(((s"/usr/lib64/python2.6/subprocess.pyR�s tTimeoutExpiredcBseZdZRS(s]This exception is raised when the timeout expires while waiting for a
child process.
(RRR (((s"/usr/lib64/python2.6/subprocess.pyR
�s(tCREATE_NEW_CONSOLEt STARTUPINFOcBs&eZdZdZdZdZdZRS(iN(RRtdwFlagstNonet hStdInputt
hStdOutputt hStdErrort wShowWindow(((s"/usr/lib64/python2.6/subprocess.pyR �s
t
pywintypescBseZeZRS((RRtIOErrorterror(((s"/usr/lib64/python2.6/subprocess.pyR£stpolltPIPE_BUFitPopentPIPEtSTDOUTtcallt
check_callR t SC_OPEN_MAXicCspxitD]`}|idti�}|dj o8|djo+yti|�Wqhtj
oqhXqqWdS(Nt
_deadstatei(t_activet_internal_polltsystmaxintRtremovet
ValueError(tinsttres((s"/usr/lib64/python2.6/subprocess.pyt_cleanup¼siþÿÿÿcGs\xUtoMy||�SWqttfj
o&}|itijoqn�qXqWdS(N(tTruetOSErrorRterrnotEINTR(tfunctargste((s"/usr/lib64/python2.6/subprocess.pyt_eintr_retry_callËscOs~|idd�}t||�}y,|djo |i�S|id|�SWn*tj
o|i�|i��nXdS(sÞ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"])
ttimeoutN(tpopRRtwaitR
tkill(t popenargstkwargsR0tp((s"/usr/lib64/python2.6/subprocess.pyRÕs
 

cOsWt||�}|id�}|djo|d}n|ot||��n|S(sSRun 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 Popen constructor. Example:

check_call(["ls", "-l"])
R-iN(RtgetRR(R4R5tretcodeR((s"/usr/lib64/python2.6/subprocess.pyRês

cCsWg}t}x;|D]3}g}|o|id�nd|jpd|jp| }|o|id�nx�|D]�}|djo|i|�qw|djo2|idt|�d�g}|id�qw|o|i|�g}n|i|�qwW|o|i|�n|o|i|�|id�qqWdi|�S(s�
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.
t s t"s\is\"t(tFalsetappendtlentextendtjoin(tseqtresultt needquotetargtbs_buftc((s"/usr/lib64/python2.6/subprocess.pyt list2cmdlineýs8!




cBs¨eZddddddeeddeddd�
Zd�Zeied�Z ddd�Z
d�Z d�Z d�Z
eo|d�Zd �Zd
�Zd �Zdeieieid �Zdd
�Zd�Zd�Zd�Zd�ZeZn©d�Zd�Zd�Zd�Ze i!e i"e i#e i$d�Z%de i&e i'e i(d�Zddd�Zd�Zd�Z)d�Z*d�Zd�Zd�ZRS( icCsÊt�t|_d
|_t|_t|ttf�pt d��nt
o_|d
j ot d��n|o7|d
j p|d
j p
|d
j ot d��qèn;|
d
j ot d��n|djot d��nd
|_ d
|_
d
|_d
|_d
|_| |_|i|||�\}}}}}}|i|||||
| | |
|| ||||||�t
o|d
j oti|i�d�}n|d
j oti|i�d�}n|d
j oti|i�d�}qn|d
j oti|d|�|_ n|d
j o?| oti|d|�|_
qzti|d |�|_
n|d
j o?| oti|d|�|_qÆti|d |�|_nd
S( sCreate new Popen instance.sbufsize must be an integers0preexec_fn is not supported on Windows platformssSclose_fds is not supported on Windows platforms if you redirect stdin/stdout/stderrs2startupinfo is only supported on Windows platformsis4creationflags is only supported on Windows platformstwbtrUtrbN(R'R<t_child_createdRt_inputt_communication_startedt
isinstancetinttlongt TypeErrort mswindowsR$tstdintstdouttstderrtpidRtuniversal_newlinest _get_handlest_execute_childtmsvcrttopen_osfhandletDetachtostfdopen(RR-tbufsizet
executableRSRTRUt
preexec_fnt close_fdstshelltcwdtenvRWt startupinfot
creationflagstp2creadtp2cwritetc2preadtc2pwriteterrreadterrwrite((s"/usr/lib64/python2.6/subprocess.pyRDs\   
!


      '  



 


cCs(|idd�}|idd�}|S(Ns
s
s
(treplace(Rtdata((s"/usr/lib64/python2.6/subprocess.pyt_translate_newlines�scCsQ|ipdS|id|�|idjo|dj o|i|�ndS(NR(RKR RRR=(Rt_maxintR((s"/usr/lib64/python2.6/subprocess.pyt__del__ s

c
Cs|io|otd��n|dj oti�|}nd}|djo-|i o"|i|i|igid�djoúd}d}|iou|o]y|ii|�Wqt j
o6}|i
t
i jo|i
t
i jo�qþqXn|ii
�n[|io#t|ii�}|ii
�n.|io#t|ii�}|ii
�n|i�||fSz|i||�\}}Wdt|_X|dj odi|�}n|dj odi|�}n|ioHttd�o8|o|i|�}n|o|i|�}q=n|djo|i�}n|id|i|��}||fS(sÚInteract 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 a
string to be sent to the child process, or None, if no data
should be sent to the child.

communicate() returns a tuple (stdout, stderr).

The optional "timeout" argument is a non-standard addition to
Python 2.6. If supplied, it is a number of seconds, which can be an
integer or a float (though there are no precision guarantees). A
TimeoutExpired exception will be raised after the given number of
seconds elapses, if the call has not yet returned.
s.Cannot send input after starting communicationiNR;tnewlinesR0(RMR$RttimeRSRTRUtcounttwriteRR*tEPIPEtEINVALtcloseR/treadR2t _communicateR(R@RWthasattrtfileRpt_remaining_time(RtinputR0tendtimeRTRUR.tsts((s"/usr/lib64/python2.6/subprocess.pyt communicate«sR
(
&


 



cCs
|i�S(N(R (R((s"/usr/lib64/python2.6/subprocess.pyRøscCs$|djodS|ti�SdS(s5Convenience for _communicate when computing timeouts.N(RRt(RR�((s"/usr/lib64/python2.6/subprocess.pyR~üs
cCs3|djodSti�|jo
t�ndS(s2Convenience for checking if a timeout has expired.N(RRtR
(RR�((s"/usr/lib64/python2.6/subprocess.pyt_check_timeouts
c Cs±|djo|djo|djodSd\}}d\}}d\}} |djo?titi�}|djotidd�\}}
qýnb|tjotidd�\}}n9t|t�oti |�}nti |i
��}|i |�}|djo?titi �}|djotidd�\}
}q¹nb|tjotidd�\}}n9t|t�oti |�}nti |i
��}|i |�}|djo?titi
�} | djotidd�\}
} q�ny|tjotidd�\}} nP|tjo
|} n9t|t�oti |�} nti |i
��} |i | �} |||||| fS(s|Construct and return tupel with IO objects:
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
iN(NNNNNN(NN(NN(NN(Rt _subprocesst GetStdHandletSTD_INPUT_HANDLEt
CreatePipeRRNRORZt
get_osfhandletfilenot_make_inheritabletSTD_OUTPUT_HANDLEtSTD_ERROR_HANDLER( RRSRTRURhRiRjRkRlRmt_((s"/usr/lib64/python2.6/subprocess.pyRXsP'   

 


 


 


cCs+titi�|ti�ddti�S(s2Return a duplicate of handle, which is inheritableii(R�tDuplicateHandletGetCurrentProcesstDUPLICATE_SAME_ACCESS(Rthandle((s"/usr/lib64/python2.6/subprocess.pyR�IscCs�tiitiitid��d�}tii|�pKtiitiiti�d�}tii|�pt d��q�n|S(s,Find and return absolut path to w9xpopen.exeis w9xpopen.exesZCannot locate w9xpopen.exe, which is needed for Popen to work with your shell or platform.(
R]tpathR@tdirnameR�tGetModuleFileNametexistsR!t exec_prefixt RuntimeError(Rtw9xpopen((s"/usr/lib64/python2.6/subprocess.pyt_find_w9xpopenPs   c
Cst|ti�pt|�}n|djo
t�}nd| ||fjo1|itiO_| |_ ||_
||_ n|
o¤|iti O_ti
|_tiidd�}|d|}ti�djptii|�i�djo-|i�}d||f}| tiO} q/ny>ti||ddt| �| |||� \}}}}Wn'tij
o}t|i��nXt|_||_ ||_!|i"�| dj o| i"�n|dj o|i"�n|dj o|i"�ndS(s$Execute program (MS Windows version)tCOMSPECscmd.exes /c ls command.coms"%s" %sN(#RNttypest StringTypesRGRR R
R�tSTARTF_USESTDHANDLESRRRtSTARTF_USESHOWWINDOWtSW_HIDERR]tenvironR7t
GetVersionR�tbasenametlowerR�R t
CreateProcessRORRt WindowsErrorR-R(RKt_handleRVtClose(RR-R`RaRbRdReRWRfRgRcRhRiRjRkRlRmtcomspecR�thpthtRVttidR.((s"/usr/lib64/python2.6/subprocess.pyRYasN

  
   
   



cCsJ|idjo3||id�|jo||i�|_qCn|iS(sÎ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.

iN(RRR¦(RRt_WaitForSingleObjectt_WAIT_OBJECT_0t_GetExitCodeProcess((s"/usr/lib64/python2.6/subprocess.pyR ¯s cCs�|djo
ti}nt|d�}|idjoHti|i|�}|tijo
t�nti |i�|_n|iS(sOWait for child process to terminate. Returns returncode
attribute.ièN(
RR�tINFINITERORtWaitForSingleObjectR¦t WAIT_TIMEOUTR
tGetExitCodeProcess(RR0RB((s"/usr/lib64/python2.6/subprocess.pyR2Às


cCs|i|i��dS(N(R=Rz(Rtfhtbuffer((s"/usr/lib64/python2.6/subprocess.pyt
_readerthreadÏscCs0|ioet|d� oTg|_tid|id|i|if�|_|iit�|ii �n|i
oet|d� oTg|_ tid|id|i
|i f�|_ |i it�|i i �n|i
oh|dj oJy|i
i|�Wq?tj
o#}|itijo�q;q?Xn|i
i�n|io7|ii|i|��|ii�o
t�q�n|i
o7|i i|i|��|i i�o
t�qÒnd}d}|io|i}|ii�n|i
o|i }|i
i�n||fS(Nt _stdout_buffttargetR-t _stderr_buff(RTR|R¶t threadingtThreadRµt
stdout_threadt setDaemonR(tstartRUR¸t
stderr_threadRSRRvRR*RwRyR@R~tisAliveR
(RRR�R.RTRU((s"/usr/lib64/python2.6/subprocess.pyR{ÓsJ  




 
 cCs.|tijo|i�n
td��dS(s)Send a signal to the process
s$Only SIGTERM is supported on WindowsN(tsignaltSIGTERMt terminateR$(Rtsig((s"/usr/lib64/python2.6/subprocess.pyt send_signalscCsti|id�dS(s#Terminates the process
iN(R�tTerminateProcessR¦(R((s"/usr/lib64/python2.6/subprocess.pyRÂsc
Cs_d\}}d\}}d\}} |djonJ|tjoti�\}}n't|t�o
|}n
|i�}|djonJ|tjoti�\}}n't|t�o
|}n
|i�}|djona|tjoti�\}} n>|tjo
|} n't|t�o
|} n
|i�} |||||| fS(s|Construct and return tupel with IO objects:
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
N(NN(NN(NN(RRR]tpipeRNROR�R(
RRSRTRURhRiRjRkRlRm((s"/usr/lib64/python2.6/subprocess.pyRXs:   


 


 




 cCs\y
ti}Wntj
o
d}nXti|ti�}ti|ti||B�dS(Ni(tfcntlt
FD_CLOEXECtAttributeErrortF_GETFDtF_SETFD(Rtfdt cloexec_flagtold((s"/usr/lib64/python2.6/subprocess.pyt_set_cloexec_flagGs 
 cCs(tid|�ti|dt�dS(Nii(R]t
closerangetMAXFD(Rtbut((s"/usr/lib64/python2.6/subprocess.pyt
_close_fdsQscCsÊt|ti�o
|g}n
t|�}|
o)ddg|}|o||d<q\n|d jo|d}nti�\}}z�z×|i|�ti �}ti
�yti �|_ Wn|oti
�n�nXt|_|i djoMyÝ| d j oti| �n|
d j oti|
�n|d j oti|�nti|�| d j oti| d�n|d j oti|d�n|d j oti|d�n| d j o| d joti| �n|d j o$|| dfjoti|�n|d j o'|| |dfjoti|�n|o|id|�n|d j oti|�n|o |�n|d joti||�nti|||�Wn\ti�\}}}ti|||�}di|�|_ti|ti|��nXtid�n|oti
�nWd ti|�X| d j o| d j oti| �n|d j o|
d j oti|�n|d j o|d j oti|�nt ti!|d
�}Wd ti|�X|djo�yt ti"|i d�Wn/t#j
o#}|i$t$i%jo�qunXti&|�}x5| |
|fD]$}|d j oti|�q�q�W|�nd S( sExecute program (POSIX version)s/bin/shs-ciiiRÒR;iÿNi(i('RNR�R�tlistRR]RÆRÏtgct isenabledtdisabletforkRVtenableR(RKRytdup2RÓtchdirtexecvptexecvpeR!texc_infot tracebacktformat_exceptionR@tchild_tracebackRvtpickletdumpst_exitR/RztwaitpidR)R*tECHILDtloads(RR-R`RaRbRdReRWRfRgRcRhRiRjRkRlRmt errpipe_readt
errpipe_writetgc_was_enabledtexc_typet exc_valuettbt exc_linesRoR.tchild_exceptionRÌ((s"/usr/lib64/python2.6/subprocess.pyRYVs¦
 

 
 






 #
 
  
 
cCsQ||�o||� |_n-||�o||�|_n
td��dS(NsUnknown child exit status!(RR�(RR�t _WIFSIGNALEDt _WTERMSIGt
_WIFEXITEDt _WEXITSTATUS((s"/usr/lib64/python2.6/subprocess.pyt_handle_exitstatusÙs


cCs�|idjoqy=||i|�\}}||ijo|i|�nWq�|j
o!|dj o
||_q}q�Xn|iS(sõ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).

N(RRRVRô(RRt_waitpidt_WNOHANGt _os_errorRVR�((s"/usr/lib64/python2.6/subprocess.pyR çs 
cCs�|idj o|iS|dj oÚti�|}d}x<toµtti|iti�\}}||ijp|djpt �||ijo|i
|�Pn|ti�}|djo
t �nt |d|d�}ti
|�q>Wn||idjoky"tti|id�\}}Wn5tj
o)}|itijo�nd}nX|i
|�n|iS(sÒWait for child process to terminate. Returns returncode
attribute.

The optional "timeout" argument is a non-standard addition to
Python 2.6. If supplied, it is a number of seconds, which can be
an integer or a float (though there are no precision guarantees).
A TimeoutExpired exception will be raised after the given number of
seconds elapses, if the call has not yet returned.
gü©ñÒMb@?iig������©?N(RRRtR(R/R]RåRVtWNOHANGtAssertionErrorRôR
tmintsleepR)R*Ræ(RR0R�tdelayRVR�t remainingR.((s"/usr/lib64/python2.6/subprocess.pyR2ûs6

 $


" cCsI|io4|i o)|ii�|p|ii�q>nto|i||�\}}n|i||�\}}|dj odi|�}n|dj odi|�}n|i oHt
t d�o8|o|i |�}n|o|i |�}q n|djo|i
�n|i
d|i|��||fS(NR;RsR0(RSRMtflushRyt _has_pollt_communicate_with_pollt_communicate_with_selectRR@RWR|R}RpR2R~(RRR�RTRU((s"/usr/lib64/python2.6/subprocess.pyR{'s(



cs d}d}�ip
h�_nti����fd�}��fd�}�io|o|�iti�n�ipUh�_�iog�i�ii �<n�i
og�i�i
i �<qÚnti ti B}�io*|�i|��i�ii �}n�i
o*|�i
|��i�i
i �}n�i
pd�_|�_
nx��io�y�i�i|��}Wn9tij
o*} | idtijoqun�nX�i|�x|D]\}
} | ti@o �i
�i�it!} y�iti|
| �7_Wn9tj
o-} | itijo||
�q¡�qùX�it�i
�jo||
�qùqë| |@o?ti|
d�}
|
p||
�n�i|
i|
�që||
�qëWquW||fS(Ncs-�i|i�|�|�i|i�<dS(N(tregisterR�t_fd2file(tfile_objt eventmask(Rtpoller(s"/usr/lib64/python2.6/subprocess.pytregister_and_appendTscs2�i|��i|i��ii|�dS(N(t
unregisterRRyR1(RÌ(RR(s"/usr/lib64/python2.6/subprocess.pytclose_unregister_and_removeXs
ii(RRMRtselectRRStPOLLOUTt
_fd2outputRTR�RUtPOLLINtPOLLPRIRLt
_input_offsetR~RR-R*R+R�t _PIPE_BUFR]RvR)RwR>RzR=(RRR�RTRURR tselect_POLLIN_POLLPRItreadyR.RÌtmodetchunkRo((RRs"/usr/lib64/python2.6/subprocess.pyRLsl

 
 




 


   c

Cs�|ip�g|_g|_|io|o|ii|i�n|io|ii|i�n|io|ii|i�q�n|ip||_d|_nd}d}|io$|ip
g|_
n|i
}n|io$|ip
g|_ n|i }nx�|ip
|iok|i |�}y+t
i
|i|ig|�\}}}Wn9t
ij
o*} | idtijoqn�nX|i|�|p |p|p
t�n|i|joÛ|i|i|it!}
yti|ii�|
�} WnOtj
oC} | itijo$|ii�|ii|i�q²�q¶X|i| 7_|it|i�jo$|ii�|ii|i�q¶n|i|jo]ti|ii�d�} | djo$|ii�|ii|i�n|i| �n|i|jo]ti|ii�d�} | djo$|ii�|ii|i�n|i| �qqW||fS(NiiR;(RMt _read_sett
_write_setRSR=RTRURLRRR¶R¸R~R
RR-R*R+R�R
RR]RvR�R)RwRyR#R>Rz(
RRR�RTRURýtrlisttwlisttxlistR.Rt
bytes_writtenRo((s"/usr/lib64/python2.6/subprocess.pyR�s~
  


 








  

 





cCsti|i|�dS(s)Send a signal to the process
N(R]R3RV(RRÃ((s"/usr/lib64/python2.6/subprocess.pyRÄçscCs|iti�dS(s/Terminate the process with SIGTERM
N(RÄRÀRÁ(R((s"/usr/lib64/python2.6/subprocess.pyRÂìscCs|iti�dS(s*Kill the process with SIGKILL
N(RÄRÀtSIGKILL(R((s"/usr/lib64/python2.6/subprocess.pyR3ñsN(+RRRR<RRpR!R"RRrR�RR~R�RRRXR�R�RYR�R°t
WAIT_OBJECT_0R²R R2RµR{RÄRÂR3RÏRÓR]t WIFSIGNALEDtWTERMSIGt WIFEXITEDt WEXITSTATUSRôRåRøRRR(((s"/usr/lib64/python2.6/subprocess.pyRCsT   R  M    9   N   4  
 -
 �  , % M N  cCs.tdgdt�i�d}dGH|GHti�djo&tdgdd��}|i�ndGHtd gdt�}td
d gd |idt�}t|i�d�GHHd
GHytdg�i�GHWnJtj
o>}|i t i
jodGHdGH|i GHq*dG|i GHnXt i
dIJdS(NtpsRTis
Process list:tidRacSs
tid�S(id(R]tsetuid(((s"/usr/lib64/python2.6/subprocess.pyt<lambda>ssLooking for 'hda'...tdmesgtgrepthdaRSsTrying a weird file...s/this/path/does/not/exists'The file didn't exist. I thought so...sChild traceback:tErrorsGosh. No error.(RRR�R]tgetuidR2RTtreprR)R*tENOENTRáR!RU(tplistR6tp1tp2R.((s"/usr/lib64/python2.6/subprocess.pyt _demo_posix÷s*! cCsldGHtddtdt�}tdd|idt�}t|i�d�GHdGHtd �}|i�dS(
Ns%Looking for 'PROMPT' in set output...tsetRTRcs
find "PROMPT"RSisExecuting calc...tcalc(RRR(RTR*R�R2(R-R.R6((s"/usr/lib64/python2.6/subprocess.pyt
_demo_windows s t__main__(,R R!tplatformRRR]R�RßRÕRÀR*Rtt ExceptionRR
R�R R¹RZR RR
R|RÿRÇRâtgetattrRt__all__R=tsysconfRÑRR'RRR/RRRGtobjectRR/R2R(((s"/usr/lib64/python2.6/subprocess.pyt<module>ys`               
 
  Fÿÿÿ· )