Home | History | Annotate | Download | only in Lib

Lines Matching defs:stdout

27 STDOUT:  Special value that indicates that stderr should go to stdout
37 stdout instead of a return code
65 cmd, returncode, stdout, stderr, output
86 def stdout(self):
90 @stdout.setter
91 def stdout(self, value):
93 # .stdout is a transparent alias for .output
102 cmd, output, stdout, stderr, timeout
115 def stdout(self):
118 @stdout.setter
119 def stdout(self, value):
121 # .stdout is a transparent alias for .output
158 __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
215 STDOUT = -2
307 The stdout argument is not allowed as it is used internally.
308 To capture standard error in the result, use stderr=STDOUT.
312 ... stderr=STDOUT)
327 if 'stdout' in kwargs:
328 raise ValueError('stdout argument not allowed, it will be overridden.')
335 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
336 **kwargs).stdout
347 stdout: The standard output (None if not captured).
350 def __init__(self, args, returncode, stdout=None, stderr=None):
353 self.stdout = stdout
359 if self.stdout is not None:
360 args.append('stdout={!r}'.format(self.stdout))
368 raise CalledProcessError(self.returncode, self.args, self.stdout,
375 The returned instance will have attributes args, returncode, stdout and
376 stderr. By default, stdout and stderr are not captured, and those attributes
377 will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
395 string and stdout/stderr in the returned object will be strings rather than
405 stdout, stderr = process.communicate(input, timeout=timeout)
408 stdout, stderr = process.communicate()
409 raise TimeoutExpired(process.args, timeout, output=stdout,
418 output=stdout, stderr=stderr)
419 return CompletedProcess(process.args, retcode, stdout, stderr)
515 data = check_output(cmd, shell=True, universal_newlines=True, stderr=STDOUT)
525 """Return output (stdout or stderr) of executing cmd in a shell.
549 creating the stdin/stdout/stderr pipe file objects
553 stdin, stdout and stderr: These specify the executed programs' standard
568 objects stdin, stdout and stderr.
579 file objects stdin, stdout and stderr.
582 stdin, stdout, stderr, pid, returncode
587 stdin=None, stdout=None, stderr=None,
613 any_stdio_set = (stdin is not None or stdout is not None or
623 " if you redirect stdin/stdout/stderr")
640 self.stdout = None
654 # c2pread <--stdout--- c2pwrite
665 errread, errwrite) = self._get_handles(stdin, stdout, stderr)
691 self.stdout = io.open(c2pread, 'rb', bufsize)
693 self.stdout = io.TextIOWrapper(self.stdout,
710 for f in filter(None, (self.stdin, self.stdout, self.stderr)):
720 if stdout == PIPE:
742 if self.stdout:
743 self.stdout.close()
798 stdout and stderr, until end-of-file is reached. Wait for
806 communicate() returns a tuple (stdout, stderr). These will be
817 [self.stdin, self.stdout, self.stderr].count(None) >= 2):
818 stdout = None
822 elif self.stdout:
823 stdout = self.stdout.read()
824 self.stdout.close()
836 stdout, stderr = self._communicate(input, endtime, timeout)
842 return (stdout, stderr)
871 def _get_handles(self, stdin, stdout, stderr):
875 if stdin is None and stdout is None and stderr is None:
900 if stdout is None:
906 elif stdout == PIPE:
909 elif stdout == DEVNULL:
911 elif isinstance(stdout, int):
912 c2pwrite = msvcrt.get_osfhandle(stdout)
915 c2pwrite = msvcrt.get_osfhandle(stdout.fileno())
927 elif stderr == STDOUT:
1060 if self.stdout and not hasattr(self, "_stdout_buff"):
1064 args=(self.stdout, self._stdout_buff))
1081 if self.stdout is not None:
1092 stdout = None
1094 if self.stdout:
1095 stdout = self._stdout_buff
1096 self.stdout.close()
1102 if stdout is not None:
1103 stdout = stdout[0]
1107 return (stdout, stderr)
1144 def _get_handles(self, stdin, stdout, stderr):
1164 if stdout is None:
1166 elif stdout == PIPE:
1168 elif stdout == DEVNULL:
1170 elif isinstance(stdout, int):
1171 c2pwrite = stdout
1174 c2pwrite = stdout.fileno()
1180 elif stderr == STDOUT:
1183 else: # child's stdout is not set, use parent's stdout
1462 stdout = None
1468 if self.stdout:
1469 self._fileobj2output[self.stdout] = []
1473 if self.stdout:
1474 stdout = self._fileobj2output[self.stdout]
1486 if self.stdout:
1487 selector.register(self.stdout, selectors.EVENT_READ)
1515 elif key.fileobj in (self.stdout, self.stderr):
1525 if stdout is not None:
1526 stdout = b''.join(stdout)
1533 if stdout is not None:
1534 stdout = self._translate_newlines(stdout,
1535 self.stdout.encoding,
1536 self.stdout.errors)
1542 return (stdout, stderr)