Lines Matching refs:stdin
119 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
122 self.assertIsInstance(p.stdin, io.BufferedIOBase)
126 p.stdin.close()
133 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
136 self.assertIsInstance(p.stdin, io.RawIOBase)
140 p.stdin.close()
201 # check_output() can be called with stdin set to a file
208 "import sys; sys.stdout.write(sys.stdin.read().upper())"],
209 stdin=tf)
216 "import sys; sys.stdout.write(sys.stdin.read().upper())"],
224 "import sys; print('XX' if sys.stdin.read() else '')"],
231 "import sys; print('XX' if sys.stdin.read() else '')"],
238 "import sys; print('XX' if sys.stdin.read() else '')"],
258 # check_output() refuses to accept 'stdin' with 'input'
266 stdin=tf, input=b'hare')
267 self.fail("Expected ValueError when stdin and input args supplied.")
268 self.assertIn('stdin', c.exception.args[0])
307 # .stdin is None when not redirected
313 self.assertEqual(p.stdin, None)
328 ' stdin=PIPE, stderr=PIPE);'
341 stdin=subprocess.PIPE, stdout=subprocess.PIPE)
343 self.addCleanup(p.stdin.close)
522 # stdin redirection
524 'import sys; sys.exit(sys.stdin.read() == "pear")'],
525 stdin=subprocess.PIPE)
526 p.stdin.write(b"pear")
527 p.stdin.close()
532 # stdin is set to open file descriptor
539 'import sys; sys.exit(sys.stdin.read() == "pear")'],
540 stdin=d)
545 # stdin is set to open file object
551 'import sys; sys.exit(sys.stdin.read() == "pear")'],
552 stdin=tf)
705 'sys.stdin.read(1)'],
706 stdin=subprocess.DEVNULL)
708 self.assertEqual(p.stdin, None)
726 'import sys; sys.stdin.read(); sys.stdout.write("out"); '
728 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
731 for fifo in [p.stdin, p.stdout, p.stderr]:
738 p.stdin.write(b"pear")
739 p.stdin.close()
751 'import sys; sys.stdin.read(); sys.stdout.write("out"); '
753 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
759 for fifo in [p.stdin, p.stdout, p.stderr]:
768 p.stdin.close()
860 'sys.exit(sys.stdin.read() == "pear")'],
861 stdin=subprocess.PIPE)
885 'sys.stdout.write(sys.stdin.read())'],
886 stdin=subprocess.PIPE,
891 self.addCleanup(p.stdin.close)
902 'sys.stdout.write(sys.stdin.read())'],
904 stdin=subprocess.PIPE,
938 options['stdin'] = subprocess.PIPE
947 if p.stdin is not None:
948 self.assertTrue(p.stdin.closed)
971 'sys.stdout.write(sys.stdin.read(47));'
973 'sys.stdout.write(sys.stdin.read())' %
975 stdin=subprocess.PIPE,
980 self.addCleanup(p.stdin.close)
986 # stdin.write before communicate()
989 'sys.stdout.write(sys.stdin.read())'],
990 stdin=subprocess.PIPE,
995 self.addCleanup(p.stdin.close)
996 p.stdin.write(b"banana")
1006 'buf.write(sys.stdin.readline().encode());'
1010 'buf.write(sys.stdin.read().encode());'
1023 p = subprocess.Popen(args, **{'stdin': subprocess.PIPE,
1027 p.stdin.write("line1\n")
1028 p.stdin.flush()
1030 p.stdin.write("line3\n")
1031 p.stdin.close()
1066 # universal newlines through communicate(), with only stdin
1069 s = sys.stdin.readline()
1071 s = sys.stdin.read()
1074 stdin=subprocess.PIPE,
1085 stdin=subprocess.PIPE,
1092 # universal newlines through communicate(), with stdin, stdout, stderr
1095 s = sys.stdin.buffer.readline()
1099 s = sys.stdin.buffer.read()
1106 stdin=subprocess.PIPE,
1131 # We set stdin to be non-None because, as of this writing,
1135 stdin=subprocess.PIPE,
1151 # We set stdin to be non-None because, as of this writing,
1155 stdin=subprocess.PIPE,
1190 "sys.stdout.write(sys.stdin.read())"],
1191 stdin=subprocess.PIPE,
1222 stdin=subprocess.PIPE)
1223 self.addCleanup(p.stdin.close)
1225 os.write(p.stdin.fileno(), b'A')
1261 "sys.stdout.write(sys.stdin.readline());"
1263 stdin=subprocess.PIPE,
1268 p.stdin.write(line) # expect that it flushes the line in text mode
1269 os.close(p.stdin.fileno()) # close it without flushing the buffer
1273 p.stdin.close()
1276 p.stdin = None
1358 stdin=subprocess.PIPE,
1445 subprocess.Popen (["*"], stdin=ifhandle, stdout=ofhandle,
1461 stdin=subprocess.PIPE,
1466 self.addCleanup(p.stdin.close)
1491 stdin=subprocess.PIPE)
1492 self.addCleanup(p.stdin.close)
1529 ZERO_RETURN_CMD, stdin=subprocess.PIPE,
1613 # run() can be called with stdin set to a file
1619 "import sys; sys.stdout.write(sys.stdin.read().upper())",
1620 stdin=tf, stdout=subprocess.PIPE)
1626 "import sys; sys.stdout.write(sys.stdin.read().upper())",
1631 # run() refuses to accept 'stdin' with 'input'
1637 msg="Expected ValueError when stdin and input args supplied.") as c:
1639 stdin=tf, input=b'hare')
1640 self.assertIn('stdin', c.exception.args[0])
2191 # instance is using for stdin/stdout/stderr.
2197 fd, (self.stdin.fileno(), self.stdout.fileno(),
2215 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
2353 stdin=subprocess.PIPE,
2375 stdin=subprocess.PIPE,
2433 stdin = 0
2437 stdin = saved
2447 stdin=stdin,
2493 # Restore original stdin and stdout
2509 # write some data to what will become stdin, and rewind
2523 'import sys; got = sys.stdin.read();'
2525 stdin=temp_fds[1],
2560 # write some data to what will become stdin, and rewind
2567 'import sys; got = sys.stdin.read();'
2569 stdin=stdin_no,
2610 arg_names = ['stdin', 'stdout', 'stderr']
2729 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
2739 unwanted_fds = set([p1.stdin.fileno(), p1.stdout.fileno(),
2755 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
2759 stdin=p1.stdout, stdout=subprocess.PIPE,
2777 p1.stdin.write(data)
2778 p1.stdin.close()
2998 stdin=pass_fds[0],
3012 stdout=inout, stdin=inout)
3024 stderr=inout, stdin=inout)
3225 with proc, mock.patch.object(proc, 'stdin') as mock_proc_stdin:
3234 with proc, mock.patch.object(proc, 'stdin') as mock_proc_stdin:
3241 # Setting stdin and stdout forces the ._communicate() code path.
3244 stdin=subprocess.PIPE,
3246 with proc, mock.patch.object(proc, 'stdin') as mock_proc_stdin, \
3249 # because _communicate registers a selector using proc.stdin...
3256 # Setting stdin and stdout forces the ._communicate() code path.
3259 stdin=subprocess.PIPE,
3261 with proc, mock.patch.object(proc, 'stdin') as mock_proc_stdin:
3525 # Some win32 buildbot raises EOFError if stdin is inherited
3532 stdin=subprocess.PIPE,
3552 stdin=subprocess.PIPE,
3768 "sys.exit(sys.stdin.read() == 'context')"],
3769 stdin=subprocess.PIPE) as proc:
3783 stdin=subprocess.PIPE,
3789 proc.stdin.write(b'x' * support.PIPE_MAX_SIZE)
3794 self.assertTrue(proc.stdin.closed)