MCPcopy Index your code
hub / github.com/RustPython/RustPython / subprocess_exec

Method subprocess_exec

Lib/asyncio/base_events.py:1771–1803  ·  view source on GitHub ↗
(self, protocol_factory, program, *args,
                              stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE, universal_newlines=False,
                              shell=False, bufsize=0,
                              encoding=None, errors=None, text=None,
                              **kwargs)

Source from the content-addressed store, hash-verified

1769 return transport, protocol
1770
1771 async def subprocess_exec(self, protocol_factory, program, *args,
1772 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
1773 stderr=subprocess.PIPE, universal_newlines=False,
1774 shell=False, bufsize=0,
1775 encoding=None, errors=None, text=None,
1776 **kwargs):
1777 if universal_newlines:
1778 raise ValueError("universal_newlines must be False")
1779 if shell:
1780 raise ValueError("shell must be False")
1781 if bufsize != 0:
1782 raise ValueError("bufsize must be 0")
1783 if text:
1784 raise ValueError("text must be False")
1785 if encoding is not None:
1786 raise ValueError("encoding must be None")
1787 if errors is not None:
1788 raise ValueError("errors must be None")
1789
1790 popen_args = (program,) + args
1791 protocol = protocol_factory()
1792 debug_log = None
1793 if self._debug:
1794 # don't log parameters: they may contain sensitive information
1795 # (password) and may be too long
1796 debug_log = f'execute program {program!r}'
1797 self._log_subprocess(debug_log, stdin, stdout, stderr)
1798 transport = await self._make_subprocess_transport(
1799 protocol, popen_args, False, stdin, stdout, stderr,
1800 bufsize, **kwargs)
1801 if self._debug and debug_log is not None:
1802 logger.info('%s: %r', debug_log, transport)
1803 return transport, protocol
1804
1805 def get_exception_handler(self):
1806 """Return an exception handler, or None if the default one is in use.

Callers

nothing calls this directly

Calls 3

_log_subprocessMethod · 0.95
infoMethod · 0.45

Tested by

no test coverage detected