Current File : //opt/imh-python/lib/python2.7/test/test_subprocess.pyo
�
��Wc@s\ddlZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZyddlZWne
k
r�eZnXyddlZWne
k
r�eZnXejdkZer�dZndZdejfd��YZdefd	��YZd
ejfd��YZdefd
��YZdefd��YZejed�defd��Y�Zejed�defd��Y�Zeje ede!�d�defd��Y�Z"dejfd��YZ#ejed�defd��Y�Z$d�Z%e&d krXe%�ndS(!i����N(ttest_supporttwin32s@import msvcrt; msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY);ttBaseTestCasecBs&eZd�Zd�Zdd�ZRS(cCstj�dS(N(Rt
reap_children(tself((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytsetUp$scCs?xtjD]}|j�q
Wtj�|jtjd�dS(Nssubprocess._active not empty(t
subprocesst_activetwaitt_cleanuptassertFalse(Rtinst((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttearDown)s
cCs,tjdd|�}|j|||�dS(Ns\[\d+ refs\]\r?\n?$R(tretsubtassertEqual(Rtstderrtexpectedtmsgtactual((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytassertStderrEqual/sN(t__name__t
__module__RR
tNoneR(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR#s		tPopenTestExceptioncBseZRS((RR(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR7stPopenExecuteChildRaisescBseZdZd�ZRS(sePopen subclass for testing cleanup of subprocess.PIPE filehandles when
    _execute_child fails.
    cOstd��dS(NsForced Exception for Test(R(Rtargstkwargs((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt_execute_child?s(RRt__doc__R(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR;stProcessTestCasecBsJeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zejej�d
�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d �Z%d!�Z&ej'e(j)j*d"e(j+��d#�d$��Z,d%�Z-d&�Z.d'�Z/d(�Z0d)�Z1d*�Z2d+�Z3d,�Z4d-�Z5d.�Z6d/�Z7eje8d6kd0�d1��Z:d2�Z;d3�Z<d4�Z=ej'e(j)j*d"e(j+��d#�d5��Z>RS(7cCs/tjtjddg�}|j|d�dS(Ns-csimport sys; sys.exit(47)i/(Rtcalltsyst
executableR(Rtrc((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt
test_call_seqEscCs/tjtjddg�}|j|d�dS(Ns-csimport sys; sys.exit(0)i(Rt
check_callR!R"R(RR#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_call_zeroKscCsN|jtj�� }tjtjddg�WdQX|j|jjd�dS(Ns-csimport sys; sys.exit(47)i/(	tassertRaisesRtCalledProcessErrorR%R!R"Rt	exceptiont
returncode(Rtc((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_call_nonzeroQscCs/tjtjddg�}|jd|�dS(Ns-csprint 'BDFL'tBDFL(Rtcheck_outputR!R"tassertIn(Rtoutput((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_outputXscCsN|jtj�� }tjtjddg�WdQX|j|jjd�dS(Ns-csimport sys; sys.exit(5)i(	R'RR(R.R!R"RR)R*(RR+((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_output_nonzero^scCs8tjtjddgdtj�}|jd|�dS(Ns-cs$import sys; sys.stderr.write('BDFL')RR-(RR.R!R"tSTDOUTR/(RR0((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_output_stderrescCsg|jt��8}tjtjddgdtj�}|jd�WdQX|jd|j	j
d�dS(Ns-csprint 'will not be run'tstdouts-Expected ValueError when stdout arg supplied.i(R't
ValueErrorRR.R!R"R5tfailR/R)R(RR+R0((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_check_output_stdout_arglscCsNtjj�}d|d<tjtjddgd|�}|j|d�dS(NtbananatFRUITs-cs5import sys, os;sys.exit(os.getenv("FRUIT")=="banana")tenvi(tostenvirontcopyRR R!R"R(RtnewenvR#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_call_kwargsus
		c	Cs�tj��Y}|jttjdd�tjjjj}dg|d}|jttj|�WdQX|j	|j
�d�dS(Ntinvalid_arg_nameiiR(Rtcaptured_stderrR't	TypeErrorRtPopent__init__t__code__tco_argcountRtgetvalue(Rtstargcountt
too_many_args((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_invalid_argsscCsttjtjddgdtjdtj�}|j|jj�|j|jj�|j	�|j
|jd�dS(Ns-csprint "banana"R5R(
RRDR!R"tPIPEt
addCleanupR5tcloseRR	RtstdinR(Rtp((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdin_none�s
cCs�d}tjtjd|gdtjdtj�}|j|jj�|j|jj�|j	�\}}|j
|jd|�|j
|j�d�dS(Ns�import sys; from subprocess import Popen, PIPE;p = Popen([sys.executable, "-c", "print 'test_stdout_none'"],          stdin=PIPE, stderr=PIPE);p.wait(); assert p.stdout is None;s-cR5Rittest_stdout_none(
RRDR!R"RMRNR5RORtcommunicateRR*trstrip(RtcodeRQtoutterr((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRS�scCsttjtjddgdtjdtj�}|j|jj�|j|jj�|j	�|j
|jd�dS(Ns-csprint "banana"RPR5(
RRDR!R"RMRNR5RORPR	RRR(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stderr_none�s
cCsitjjtjjtj��}tjdddgdtjd|�}|j�|j	|j
d�dS(Ntsomethingyoudonthaves-csimport sys; sys.exit(47)R"tcwdi/(R<tpathtdirnametrealpathR!R"RRDR	RR*(Rt
python_dirRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_executable_with_cwd�s!	
s#need an installed Python. See #7774cCsBtjdddgdtj�}|j�|j|jd�dS(NRZs-csimport sys; sys.exit(47)R"i/(RRDR!R"R	RR*(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_executable_without_cwd�s
	
cCsbtjtjddgdtj�}|jjd�|jj�|j�|j	|j
d�dS(Ns-cs0import sys; sys.exit(sys.stdin.read() == "pear")RPtpeari(RRDR!R"RMRPtwriteROR	RR*(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdin_pipe�s	

cCs}tj�}|j�}tj|d�tj|dd�tjtj	ddgd|�}|j
�|j|jd�dS(NRbis-cs0import sys; sys.exit(sys.stdin.read() == "pear")RPi(
ttempfilet
TemporaryFiletfilenoR<RctlseekRRDR!R"R	RR*(RttftdRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdin_filedes�s		
cCshtj�}|jd�|jd�tjtjddgd|�}|j�|j	|j
d�dS(NRbis-cs0import sys; sys.exit(sys.stdin.read() == "pear")RPi(ReRfRctseekRRDR!R"R	RR*(RRiRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdin_fileobj�s

		
cCsTtjtjddgdtj�}|j|jj�|j|jj	�d�dS(Ns-cs&import sys; sys.stdout.write("orange")R5torange(
RRDR!R"RMRNR5RORtread(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_pipe�s
	cCsvtj�}|j�}tjtjddgd|�}|j�tj	|dd�|j
tj|d�d�dS(Ns-cs&import sys; sys.stdout.write("orange")R5iiRn(ReRfRgRRDR!R"R	R<RhRRo(RRiRjRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_filedes�s		
cCs^tj�}tjtjddgd|�}|j�|jd�|j|j	�d�dS(Ns-cs&import sys; sys.stdout.write("orange")R5iRn(
ReRfRRDR!R"R	RlRRo(RRiRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_fileobj�s		

cCsTtjtjddgdtj�}|j|jj�|j|jj	�d�dS(Ns-cs*import sys; sys.stderr.write("strawberry")Rt
strawberry(
RRDR!R"RMRNRRORRo(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stderr_pipes
	cCsvtj�}|j�}tjtjddgd|�}|j�tj	|dd�|j
tj|d�d�dS(Ns-cs*import sys; sys.stderr.write("strawberry")RiiRs(ReRfRgRRDR!R"R	R<RhRRo(RRiRjRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stderr_filedess		
cCs^tj�}tjtjddgd|�}|j�|jd�|j|j	�d�dS(Ns-cs*import sys; sys.stderr.write("strawberry")RiRs(
ReRfRRDR!R"R	RlRRo(RRiRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stderr_fileobjs		

cCsvtjtjddgdtjdtj�}|j�\}}|j|d�|j|d�|j|jd�dS(Ns-cs�import sys, subprocess;rc = subprocess.call([sys.executable, "-c",    "import sys;"    "sys.stderr.write('42')"],    stderr=subprocess.STDOUT);sys.exit(rc)R5Rt42Ri(	RRDR!R"RMRTRRR*(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt,test_stderr_redirect_with_no_stdout_redirect s		cCs]tjtjddgdtjdtj�}|j|jj�|j	|jj
�d�dS(Ns-csRimport sys;sys.stdout.write("apple");sys.stdout.flush();sys.stderr.write("orange")R5Rtappleorange(RRDR!R"RMR3RNR5RORRo(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_stderr_pipe5s		cCsdtj�}tjtjddgd|d|�}|j�|jd�|j|j	�d�dS(Ns-csRimport sys;sys.stdout.write("apple");sys.stdout.flush();sys.stderr.write("orange")R5RiRy(
ReRfRRDR!R"R	RlRRo(RRiRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_stderr_fileAs		

cCs�d}tjtjd|gdtjdtj�}|j|jj�|j|jj�|j	�\}}|j
|jd|�|j
|j�d�dS(Ns�import sys, subprocess; rc = subprocess.call([sys.executable, "-c",     "import os, sys; sys.exit(os.write(sys.stdout.fileno(), 'test with stdout=1'))"], stdout=1); assert rc == 18s-cR5Ristest with stdout=1(
RRDR!R"RMRNR5RORRTRR*RU(RRVRQRWRX((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_stdout_filedes_of_stdoutOscCs�tj�}tj�}tj|�tj�}tj|�tjtjddgdtj	d|�}|j
|jj�tj
j}|j||jj��||��dS(Ns-cs+import sys,os;sys.stdout.write(os.getcwd())R5R[(Ret
gettempdirR<tgetcwdtchdirRRDR!R"RMRNR5ROR\tnormcaseRRo(RttmpdirR[RQR�((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_cwdbs

			cCsstjj�}d|d<tjtjddgdtjd|�}|j|j	j
�|j|j	j�d�dS(NRnR:s-cs2import sys,os;sys.stdout.write(os.getenv("FRUIT"))R5R;(
R<R=R>RRDR!R"RMRNR5RORRo(RR?RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_envss
			cCsHtjtjddgdtj�}|jd�|j|jd�dS(Ns-cs/import sys;sys.exit(sys.stdin.read() == "pear")RPRbi(RRDR!R"RMRTRR*(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_stdin~s
	
cCsZtjtjddgdtj�}|j�\}}|j|d�|j|d�dS(Ns-cs)import sys; sys.stdout.write("pineapple")R5t	pineapple(RRDR!R"RMRTRR(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_stdout�s	cCsZtjtjddgdtj�}|j�\}}|j|d�|j|d�dS(Ns-cs)import sys; sys.stderr.write("pineapple")RR�(	RRDR!R"RMRTRRR(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_stderr�s	cCs�tjtjddgdtjdtjdtj�}|j|jj�|j|jj�|j|j	j�|j
d�\}}|j|d�|j|d�dS(Ns-csNimport sys,os;sys.stderr.write("pineapple");sys.stdout.write(sys.stdin.read())RPR5RR9R�(
RRDR!R"RMRNR5RORRPRTRR(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate�s			s/proc/%d/fdsLinux specificcCs�dtj�}ttj|��}tjtjddgdtj�}|j	�ttj|��}~ttj|��}|j
||�|j
||�dS(Ns/proc/%d/fds-csprint()R5(R<tgetpidtlentlistdirRRDR!R"RMRTR(Rtfd_directorytnum_fds_before_popenRQtnum_fds_after_communicatetnum_fds_after_destruction((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_pipe_fd_leak�s
cCsQtjtjddg�}|j�\}}|j|d�|j|d�dS(Ns-csimport sys; sys.exit(47)(RRDR!R"RTRR(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_returns�s
cCs�tj�\}}tr!d}ntj|d�}tj|�tj|�tjtjdd|gdtj	dtj	dtj	�}|j
|jj�|j
|jj�|j
|j
j�d|}|j|�\}}|j||�dS(	NitPC_PIPE_BUFs-cspimport sys,os;sys.stdout.write(sys.stdin.read(47));sys.stderr.write("xyz"*%d);sys.stdout.write(sys.stdin.read())RPR5Rtabc(R<tpipet	mswindowst	fpathconfRORRDR!R"RMRNR5RRPRTR(Rtxtytpipe_bufRQtstring_to_writeR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_pipe_buf�s$	


		
cCs�tjtjddgdtjdtjdtj�}|j|jj�|j|jj�|j|j	j�|j	j
d�|jd�\}}|j|d�|j
|d	�dS(
Ns-cs0import sys,os;sys.stdout.write(sys.stdin.read())RPR5RR9tsplittbananasplitR(RRDR!R"RMRNR5RORRPRcRTRR(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_writes_before_communicate�s			cCs�tjtjddtdgdtjdd�}|j|jj�|jj	�}t
td�rv|j|d�n|j|d	�dS(
Ns-csimport sys,os;s	sys.stdout.write("line1\n");sys.stdout.flush();sys.stdout.write("line2\r");sys.stdout.flush();sys.stdout.write("line3\r\n");sys.stdout.flush();sys.stdout.write("line4\r");sys.stdout.flush();sys.stdout.write("\nline5");sys.stdout.flush();sys.stdout.write("\nline6");R5tuniversal_newlinesitnewliness#line1
line2
line3
line4
line5
line6s%line1
line2
line3
line4
line5
line6(
RRDR!R"t	SETBINARYRMRNR5RORothasattrtfileR(RRQR5((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_universal_newlines�s
			
	cCs�tjtjddtdgdtjdtjdd�}|j|jj�|j|j	j�|j
�\}}ttd�r�|j
|d	�n|j
|d
�dS(Ns-csimport sys,os;s	sys.stdout.write("line1\n");sys.stdout.flush();sys.stdout.write("line2\r");sys.stdout.flush();sys.stdout.write("line3\r\n");sys.stdout.flush();sys.stdout.write("line4\r");sys.stdout.flush();sys.stdout.write("\nline5");sys.stdout.flush();sys.stdout.write("\nline6");R5RR�iR�s#line1
line2
line3
line4
line5
line6s%line1
line2
line3
line4
line5
line6(RRDR!R"R�RMRNR5RORRTR�R�R(RRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt#test_universal_newlines_communicates
		
	c	Csptsd}nd}g}zx~t|�D]_}y*|jtjtjtjtjB��Wq+t	k
r�}|j
t
jkr��nPq+Xq+W|jd|�x'td�D]}tj
|j��q�Wxmtd�D]_}tjtjddgdtjd	tjd
tj�}|jd�d}|j|d�q�WWdx|D]}tj
|�qDWtjtj�XdS(
Niis4failed to reach the file descriptor limit (tried %d)i
is-cs-import sys;sys.stdout.write(sys.stdin.read())RPR5Rtlimei(R�trangetappendR<topenRtTESTFNtO_WRONLYtO_CREATtOSErrorterrnotEMFILEtskipTestROtpopRRDR!R"RMRTRtunlink(Rtmax_handlesthandlestiteRQtdatath((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_no_leaking s8						
cCs|jtjdddg�d�|jtjdddg�d�|jtjdddg�d	�|jtjd
ddg�d
�|jtjdddg�d�|jtjdddg�d�|jtjdddg�d�|jtjddg�d�dS(Nsa b cRjR�s"a b c" d esab"cs\s	ab\"c \ ds \s
ab\"c " \\" dsa\\\bsde fgR�sa\\\b "de fg" hsa\"bR+s
a\\\"b c dsa\\b cs"a\\b c" d esa\\b\ cs
"a\\b\ c" d etabRsab ""(RRtlist2cmdline(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_list2cmdlineFs cCs{tjtjddg�}d}x-|j�dkrPtjd�|d7}q$W|j|d�|j	|j�d�dS(Ns-csimport time; time.sleep(1)ig�������?ii(
RRDR!R"tpollRttimetsleeptassertGreaterEqualR(RRQtcount((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt	test_pollYs
cCsKtjtjddg�}|j|j�d�|j|j�d�dS(Ns-csimport time; time.sleep(2)i(RRDR!R"RR	(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt	test_waitiscCs6|jt��!tjtjddgd�WdQXdS(Ns-ctpassRn(R'RCRRDR!R"(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_invalid_bufsizeqscCsxxtd�D]j}|jt��)}tjdgdtjdtj�WdQX|jjtjtj	fkr
|j�q
q
WdS(Nitnonexisting_i_hopeR5R(
R�R'tEnvironmentErrorRRDRMR)R�tENOENTtEACCES(RR�R+((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_leaking_fds_on_errorws	sthreading requiredcs�g��fd�}tjd|�}|j�zE|jt��0tjdgdtjdtjdtj�WdQXWd|j�d}x;�D]3}yt
j|�Wq�tk
r�}|}q�Xq�W|dk	r�|�nXdS(Ncs;x4td�D]&}�jtj��tjd�q
WdS(Nig����MbP?(R�textendR<R�R�R�(R�(tfds(sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytopen_fds�sttargetR�RPR5R(
t	threadingtThreadtstartR'R�RRDRMtjoinRR<ROR�(RR�tttexctfdR�((R�sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_double_close_on_error�s&
		

cCs
tj�\}}tj�\}}tj�\}}y&tjdgd|d|d|�Wn_tk
r�tj|�tj|�tj|�tj|�tj|�tj|�nX|jtj	j
|��|jtj	j
|��|jtj	j
|��dS(Nt*RPR5R(RetmkstempRRDR�R<ROtremoveRR\texists(Rtifhandletifnametofhandletofnametefhandletefname((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt test_handles_closed_on_exception�s 





cCs�tjtjddgdtjdtjdtj�}|j|jj�|j|jj�|j|j	j�|j
dd	�dS(
Ns-cR�RPR5RR�iii(RRDR!R"RMRNR5RORRPRT(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_epipe�s		cCsYtjtjddgdtj�}|j|jj�tj	d�|j
dd�dS(Ns-cR�RPiR�ii(RRDR!R"RMRNRPROR�R�RT(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt!test_communicate_epipe_only_stdin�s

cCs�dtj�}tj|�}|jt��6ttjddgdtj	dtj	dtj	�WdQXtj|�}|j
||�dS(s;Test for the fork() failure fd leak reported in issue16327.s/proc/%d/fds-cR�RPR5RN(R<R�R�R'RRR!R"RRMR(RR�tfds_before_popentfds_after_exception((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt!test_failed_child_execute_fd_leak�sN(?RRR$R&R,R1R2R4R8R@RLRRRSRYR`tunittesttskipIft	sysconfigtis_python_buildRaRdRkRmRpRqRrRtRuRvRxRzR{R|R�R�R�R�R�R�t
skipUnlessR<R\tisdirR�R�R�R�R�R�R�R�R�R�R�R�R�R�RR�R�R�R�R�(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRCsj									
	
						
	
					
			
																&					!			
t_SuppressCoreFilescBsJeZdZdZd�Zd�Zeje	e
d�d�d��ZRS(s-Try to prevent core files from being created.cCs�td
k	rXy,tjtj�|_tjtjd�WqXttjfk
rTqXXntj	dkr�t
jddddgdt
j�j
�d}|j�dkr�d	GHtjj�q�nd
S(s3Try to save previous ulimit, then set it to (0, 0).itdarwins/usr/bin/defaultsRoscom.apple.CrashReportert
DialogTypeR5t	developers;this tests triggers the Crash Reporter, that is intentionalN(ii(tresourceRt	getrlimittRLIMIT_COREt	old_limitt	setrlimitR6terrorR!tplatformRRDRMRTtstripR5tflush(Rtvalue((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt	__enter__�scGs]|jdkrdStdk	rYytjtj|j�WqYttjfk
rUqYXndS(s%Return core file behavior to default.N(R�RR�R�R�R6R�(RR((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt__exit__�stSIGALRMsRequires signal.SIGALRMcCs�d�}tjtj|�}|jtjtj|�tjddg}xPdD]H}itj|6}tj||��}tjd�|j	�WdQXqPWdS(NcSsdS(N((tsignumtframe((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pythandlerss-csimport time; time.sleep(2)R5Ri(sstdoutsstderr(
tsignalR�RNR!R"RRMRDtalarmRT(RRtold_handlerRtstreamtkwtprocess((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_communicate_eintrs	

N(RRRRR�R�R�R�R�R�RR(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR��s		
sPOSIX specific teststPOSIXProcessTestCasecBs~eZd�Zd�Zd�Zdejfd��YZej	e
jjd�d�d��Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zej	ejjd'�d�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d �Z&d!�Z'd"�Z(d#�Z)d$�Z*d%�Z+d&�Z,RS((cCsS|jt��(}tjtjddgdd�}WdQX|jd|jj�dS(Ns-cRR[s/this/path/does/not/existsos.chdir(	R'R�RRDR!R"R/R)tchild_traceback(RR+RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_exceptionsscCsPt��*tjtjddg�}|j�WdQX|j|jtj	�dS(Ns-csimport os; os.abort()(
R�RRDR!R"R	RR*RtSIGABRT(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_run_abort%s

cCs]tjtjddgdtjdd��}|j|jj�|j|jj	�d�dS(Ns-cs3import sys, os;sys.stdout.write(os.getenv('FRUIT'))R5t
preexec_fncSstjdd�S(NR:tapple(R<tputenv(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt<lambda>3sR(
RRDR!R"RMRNR5RORRo(RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_preexec-s		t_TestExecuteChildPopencBs eZdZd�Zd�ZRS(s3Used to test behavior at the end of _execute_child.cOs#||_tjj|||�dS(N(t	_testcaseRRDRE(RttestcaseRR((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRE9s	cCs�zGtjj||||||||||	|
|||
||||�Wdgtd�D]}tjdtj�^qW}z1x*|D]"}|jj||
||f�q�WWdx|D]}tj	|�q�WXXdS(Nis	/dev/zero(
RRDRR�R<R�tO_RDONLYRtassertNotInRO(RRR"R
t	close_fdsR[R;R�tstartupinfot
creationflagstshelltto_closetp2creadtp2cwritetc2preadtc2pwriteterrreadterrwritet_tdevzero_fdsR�((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR=s 		+
	
(RRRRER(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR7s	s	/dev/zeros/dev/zero required.cCs`d�}|jt��B|j|tjddgdtjdtjdtjd|�WdQXdS(	s6Issue16140: Don't double close pipes on preexec error.cSstd��dS(Ns-force the _execute_child() errpipe_data path.(tRuntimeError(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytraise_it]ss-cR�RPR5RR
N(R'R$RR!R"RRM(RR%((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt0test_preexec_errpipe_does_not_double_close_pipesYs	cCs�tj�\}}tj|d�tj|dtj�tj|�tj|d�tj	|�}|j
�tj|�|j|j
d�dS(Ns
#!/bin/sh
s(exec '%s' -c 'import sys; sys.exit(47)'
i�i/(ReR�R<RcR!R"ROtchmodRRDR	R�RR*(RtftfnameRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_args_stringfs


cCsT|jttjtjddgdd�|jttjtjddgdd�dS(Ns-csimport sys; sys.exit(47)Ri/R(R'R6RR R!R"(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRLss				cCsvtjj�}d|d<tjdgdddtjd|�}|j|jj�|j	|jj
�j�d�dS(NRR:secho $FRUITRiR5R;(R<R=R>RRDRMRNR5RORRoR�(RR?RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_shell_sequence~s
		cCsstjj�}d|d<tjddddtjd|�}|j|jj�|j	|jj
�j�d�dS(NRR:secho $FRUITRiR5R;(R<R=R>RRDRMRNR5RORRoR�(RR?RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_shell_string�s
		cCs�tj�\}}tj|d�tj|dtj�tj|�tj|d�tj	|�}tj
|�|j|d�dS(Ns
#!/bin/sh
s(exec '%s' -c 'import sys; sys.exit(47)'
i�i/(ReR�R<RcR!R"ROR'RR R�R(RR(R)R#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_call_string�s

c	Cs*g}xedddgD]T}xKddgD]=}tjj||�}tjj|�r)|j|�q)q)WqW|s�|jd�nd}tjj|�r�tjj|�r�|j|�nxd|D]\}tjdd	|d
t	dtj
�}|j|jj
�|j|jj�j�|�q�WdS(Ns/bins	/usr/bin/s/usr/local/bintbashtkshs"bash or ksh required for this tests/bin/shsecho $0R"RR5(R<R\R�tisfileR�R�tislinkRRDtTrueRMRNR5RORRoR�(RtshellstprefixtnametshRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_specific_shell�s %
c
Gsctjtjddgdtdtjdtjdtj�}|jjd�t||�|�|S(Ns-cs�if 1:
                             import sys, time
                             sys.stdout.write('x\n')
                             sys.stdout.flush()
                             time.sleep(30)
                             RRPR5Ri(	RRDR!R"R2RMR5Rotgetattr(RtmethodRRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt
_kill_process�s			tnetbsdtopenbsds"Due to known OS bug (issue #16762)c
Gsztjtjddgdtdtjdtjdtj�}|jjd�tj	d�t
||�|�|j�dS(Ns-cs�if 1:
                             import sys, time
                             sys.stdout.write('x\n')
                             sys.stdout.flush()
                             RRPR5Ri(RRDR!R"R2RMR5RoR�R�R8RT(RR9RRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt_kill_dead_process�s			
cCsQ|jdtj�}|j�\}}|jd|�|j|j�d�dS(Ntsend_signaltKeyboardInterrupti(R:RtSIGINTRTR/tassertNotEqualR	(RRQR"R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_send_signal�scCsO|jd�}|j�\}}|j|d�|j|j�tj�dS(NtkillR(R:RTRRR	RtSIGKILL(RRQR"R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt	test_kill�scCsO|jd�}|j�\}}|j|d�|j|j�tj�dS(Nt	terminateR(R:RTRRR	RtSIGTERM(RRQR"R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_terminate�scCs|jdtj�dS(NR>(R=RR@(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_send_signal_dead�scCs|jd�dS(NRC(R=(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_kill_dead�scCs|jd�dS(NRF(R=(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_terminate_dead�sc	Cs*d}g}x?|D]7}tj|�}|j|�|dkr|}qqWz�x|D]}tj|�qXWtjtjddgd|dtjdtj�j	�\}}t
j|�}|j||fd	�Wdx-t
||�D]\}}tj||�q�Wx|D]}tj|�qWXdS(
Nis-csRimport sys;sys.stdout.write("apple");sys.stdout.flush();sys.stderr.write("orange")RPR5RRRn(sapplesorange(R<tdupR�RORRDR!R"RMRTRtstrip_python_stderrRtziptdup2(	RR�RPtnewfdstatbR�RWRX((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytcheck_close_std_fds�s*



		
cCs|jdg�dS(Ni(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fd_0scCs|jdg�dS(Ni(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fd_1scCs|jdg�dS(Ni(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fd_2scCs|jddg�dS(Nii(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fds_0_1 scCs|jddg�dS(Nii(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fds_0_2#scCs|jddg�dS(Nii(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fds_1_2&scCs|jdddg�dS(Niii(RS(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fds_0_1_2)scCs�gtd�D]}tj�^q
}g|D]\}}|^q,}z�x!|D]\}}tj|�qNWgtd�D]}tj|�^qx}	z�x*t|�D]\}}
tj|
|�q�Wtj|d�tj	|dd�t
jtj
ddgd|d|d|�}|j�x!|D]}tj	|dd�q$Wtj|d	�}tjtj|d	��}
Wdx7t|	�D])\}}tj||�tj|�qWX|j|d
�|j|
d�Wdx|D]}tj|�q�WXdS(NitSTDINis-csZimport sys; got = sys.stdin.read();sys.stdout.write("got %s"%got); sys.stderr.write("err")RPR5Ris	got STDINRX(R�ReR�R<R�RLt	enumerateRORcRhRRDR!R"R	RoRRMROR(Rtstdin_not	stdout_not	stderr_noR�ttempsR�R)ttemp_fdst	saved_fdsttemp_fdRQRWRXtstdtsaved((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytcheck_swap_fds.s8%(		


cCsv|jddd�|jddd�|jddd�|jddd�|jddd�|jddd�dS(Niii(Rf(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt
test_swap_fds`scCsotjddd�}tjtj|gdtjdtj�}|j�\}}|jd|j	d|�dS(Nssigchild_ignore.pytsubdirtsubprocessdataR5Ris6sigchild_ignore.py exited non-zero with this error:
%s(
RtfindfileRRDR!R"RMRTRR*(Rtsigchild_ignoreRQR5R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_wait_when_sigchild_ignoredhs	cCs�tjtjddgdtjdtj�}|j|jj�|j|jj�t	|�}|j
}~|j|gtjD]}t	|�^q~�dS(Ns-cs import sys, time;time.sleep(0.2)R5R(
RRDR!R"RMRNR5RORtidtpidR/R(RRQtidentRnto((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_zombie_fast_process_delrs			c
CsEtjtjddgdtjdtj�}|j|jj�|j|jj�t	|�}|j
}~tj|t
j�|j|gtjD]}t	|�^q��tjd�|jt��4}tjdgdtjdtj��}WdQXWdQX|jttj|d�|j|gtjD]}t	|�^q(�dS(Ns-csimport time;time.sleep(3)R5Rg�������?R�i(RRDR!R"RMRNR5RORRmRnR<RCRRDR/RR�R�R'R�R�twaitpidR(RRQRoRnRpR+tproc((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt!test_leak_fast_process_del_killed�s&			,
	c
Cs�tjtjddgdtjdtjdtj�}tjtjddg|j|j|jfD]}|j�^qagdtjdtjdtjdt	�}|j
d�|j
�\}}|j|jd	d
t
|��dS(Ns-csimport os;os.read(0, 1)RPR5Rsif True:
                               import os, errno, sys
                               for fd in %r:
                                   try:
                                       os.close(fd)
                                   except OSError as e:
                                       if e.errno != errno.EBADF:
                                           raise
                                   else:
                                       sys.exit(1)
                               sys.exit(0)
                               RtfooisUnexpected error: (RRDR!R"RMRPR5RRgtFalseRTRR*trepr(Rtp1R(tp2R"R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_pipe_cloexec�s	&
(R;R<(-RRR
RRRRDRR�R�R<R\R�R&R*RLR+R,R-R7R:R!R�t
startswithR=RBRERHRIRJRKRSRTRURVRWRXRYRZRfRgRlRqRtRz(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRsD			
"(
	
		
	
																		2		
		 sWindows specific teststWin32ProcessTestCasecBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cCsMd}d}tj�}||_||_tjtjddgd|�dS(Niis-csimport sys; sys.exit(0)R(RtSTARTUPINFOtdwFlagstwShowWindowR R!R"(RtSTARTF_USESHOWWINDOWtSW_MAXIMIZER((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_startupinfo�s		cCs4d}tjjd�tjtjdd|�dS(Nis'    a DOS box should flash briefly ...
s# -c "import time; time.sleep(0.25)"R(R!RRcRR R"(RtCREATE_NEW_CONSOLE((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_creationflags�s
cCs`|jttjtjddgdd��|jttjtjddgdtjdt�dS(Ns-csimport sys; sys.exit(47)R
cSsdS(Ni((((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR�sR5R(R'R6RR R!R"RMR2(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRL�s		
			cCs5tjtjddgdt�}|j|d�dS(Ns-csimport sys; sys.exit(47)Ri/(RR R!R"R2R(RR#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_close_fds�s		cCsptjj�}d|d<tjdgdddtjd|�}|j|jj�|j	d|jj
��dS(NtphysalisR:tsetRiR5R;(R<R=R>RRDRMRNR5ROR/Ro(RR?RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR+�s
		cCsmtjj�}d|d<tjddddtjd|�}|j|jj�|j	d|jj
��dS(NR�R:R�RiR5R;(R<R=R>RRDRMRNR5ROR/Ro(RR?RQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR,�s
		cCs*tjtjd�}|j|d�dS(Ns -c "import sys; sys.exit(47)"i/(RR R!R"R(RR#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR-s
cGs�tjtjddgdtjdtjdtj�}|j|jj�|j|jj�|j|j	j�|jj
d�t||�|�|j�\}}|j
|d�|j�}|j|d�dS(	Ns-cs�if 1:
                             import sys, time
                             sys.stdout.write('x\n')
                             sys.stdout.flush()
                             time.sleep(30)
                             RPR5RiRi(RRDR!R"RMRNR5RORRPRoR8RTRR	RA(RR9RRQR"RR*((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR:s			cGs�tjtjddgdtjdtjdtj�}|j|jj�|j|jj�|j|j	j�|jj
d�tjd�t
||�|�|j�\}}|j|d�|j�}|j|d�dS(	Ns-cs�if 1:
                             import sys, time
                             sys.stdout.write('x\n')
                             sys.stdout.flush()
                             sys.exit(42)
                             RPR5RiRi*(RRDR!R"RMRNR5RORRPRoR�R�R8RTRR	R(RR9RRQR"RR#((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR="s			
cCs|jdtj�dS(NR>(R:RRG(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRB;scCs|jd�dS(NRC(R:(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRE>scCs|jd�dS(NRF(R:(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRHAscCs|jdtj�dS(NR>(R=RRG(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRIDscCs|jd�dS(NRC(R=(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRJGscCs|jd�dS(NRF(R=(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRKJs(RRR�R�RLR�R+R,R-R:R=RBRERHRIRJRK(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR|�s					
	
								t	_has_pollspoll system call not supportedtProcessTestCaseNoPollcBseZd�Zd�ZRS(cCstt_tj|�dS(N(RvRR�RR(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRQs	cCstt_tj|�dS(N(R2RR�RR
(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR
Us	(RRRR
(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR�Ns	tHelperFunctionTestscBs#eZejed�d��ZRS(s(errno and EINTR make no sense on windowscs�g��fd�}|jdtj|dd��|jdg��|jdtj|d��|jdd	d
g��dS(NcsD�j|�t��dkr4ttjd��ntt|��S(Nisfake interrupted system call(R�R�R�R�tEINTRttupletreversed(R(trecord_calls(sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytfake_os_func^s
i�ii�(i�i(ii�(i�(ii�(i�(i�(RRt_eintr_retry_call(RR�((R�sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_eintr_retry_call[s		(RRR�R�R�R�(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR�Zssmswindows onlytCommandsWithSpacescBsGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs[tt|�j�tjdd�\}}|j�|_tj|d�tj	|�dS(Ns.pyste stsVimport sys;sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))(
tsuperR�RReR�tlowerR)R<RcRO(RR(R)((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyRos
cCs'tj|j�tt|�j�dS(N(R<R�R)R�R�R
(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR
xscOs_tj|d<tj||�}|j|jj�|j|jj�jd�d|j	�dS(NR5tmbcss2 [%r, 'ab cd'](
RRMRDRNR5RORRotdecodeR)(RRRRQ((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pytwith_spaces|s
cCs*|jdtj|jdfdd�dS(Ns"%s" "%s" "%s"sab cdRi(R�R!R"R)(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_shell_string_with_spaces�scCs&|jtj|jdgdd�dS(Nsab cdRi(R�R!R"R)(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_shell_sequence_with_spaces�scCs$|jdtj|jdf�dS(Ns"%s" "%s" "%s"sab cd(R�R!R"R)(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyttest_noshell_string_with_spaces�scCs |jtj|jdg�dS(Nsab cd(R�R!R"R)(R((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt!test_noshell_sequence_with_spaces�s(	RRRR
R�R�R�R�R�(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyR�ls								cCs3ttttttf}tj|�tj�dS(N(	RRR|R�R�R�Rtrun_unittestR(t
unit_tests((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt	test_main�s	
t__main__('R�ttestRRR!RR<R�ReR�RR�R�tImportErrorRR�R�R�R�tTestCaseRt	ExceptionRRDRRtobjectR�R�RR�R|R8RvR�R�R�R�R(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_subprocess.pyt<module>sV



	���8���	
*