summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* Misc asyncio improvements from upstream (merge 3.5->3.6)Guido van Rossum2016-09-301-1/+2
|\
| * Merge 3.5 (asyncio)Yury Selivanov2016-09-111-1/+2
| |\
| | * Merge 3.5 (issue #26741)Victor Stinner2016-05-201-0/+4
| | |\
| | * \ Merge 3.5 (Issue #27041)Yury Selivanov2016-05-161-1/+1
| | |\ \
| | * | | Add a source parameter to warnings.warn()Victor Stinner2016-03-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26604: * Add a new optional source parameter to _warnings.warn() and warnings.warn() * Modify asyncore, asyncio and _pyio modules to set the source parameter when logging a ResourceWarning warning
* | | | | Misc asyncio improvements from upstreamGuido van Rossum2016-09-301-1/+0
|/ / / /
* | | | asyncio: Add set_protocol / get_protocol methods to TransportsYury Selivanov2016-09-111-0/+6
| |_|/ |/| |
* | | asyncio: fix ResourceWarning related to subprocessesVictor Stinner2016-05-201-0/+4
| |/ |/| | | | | | | | | Issue #26741: asyncio: BaseSubprocessTransport._process_exited() now copies the return code from the child watched to the returncode attribute of the Popen object. On Python 3.6, it is required to avoid a ResourceWarning.
* | Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-1/+1
|/
* asyncio: Add Transport.is_closing()Yury Selivanov2015-11-161-0/+3
| | | | See https://github.com/python/asyncio/pull/291 for details.
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-041-2/+2
|
* Fix ResourceWarning in asyncio.BaseSubprocessTransportVictor Stinner2015-07-311-2/+7
| | | | | | | Issue #24763: Fix resource warnings when asyncio.BaseSubprocessTransport constructor fails, if subprocess.Popen raises an exception for example. Patch written by Martin Richard, test written by me.
* Issue #23456: Add missing @coroutine decorators in asyncioVictor Stinner2015-03-181-0/+1
|
* asyncio: Fix repr(BaseSubprocessTransport) if it didn't start yetVictor Stinner2015-03-101-2/+5
| | | | | Replace "running" with "not started" and don't show the pid if the subprocess didn't start yet.
* Issue #23537: Remove 2 unused private methods of asyncio.BaseSubprocessTransportVictor Stinner2015-02-271-6/+0
| | | | Methods only raise NotImplementedError and are never used.
* asyncio: BaseSubprocessTransport: repr() mentions when the child process isVictor Stinner2015-02-171-0/+2
| | | | running
* asyncio: BaseSubprocessTransport.close() doesn't try to kill the process if itVictor Stinner2015-02-101-1/+6
| | | | already finished
* Issue #23347, asyncio: send_signal(), terminate(), kill() don't check if theVictor Stinner2015-01-301-4/+3
| | | | | | | transport was closed. The check broken a Tulip example and this limitation is arbitrary. Check if _proc is None should be enough. Enhance also close(): do nothing when called the second time.
* Issue #23347, asyncio: Make BaseSubprocessTransport.wait() privateVictor Stinner2015-01-301-1/+1
|
* asyncio: sync with TulipVictor Stinner2015-01-301-43/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #23347: send_signal(), kill() and terminate() methods of BaseSubprocessTransport now check if the transport was closed and if the process exited. Issue #23347: Refactor creation of subprocess transports. Changes on BaseSubprocessTransport: * Add a wait() method to wait until the child process exit * The constructor now accepts an optional waiter parameter. The _post_init() coroutine must not be called explicitly anymore. It makes subprocess transports closer to other transports, and it gives more freedom if we want later to change completly how subprocess transports are created. * close() now kills the process instead of kindly terminate it: the child process may ignore SIGTERM and continue to run. Call explicitly terminate() and wait() if you want to kindly terminate the child process. * close() now logs a warning in debug mode if the process is still running and needs to be killed * _make_subprocess_transport() is now fully asynchronous again: if the creation of the transport failed, wait asynchronously for the process eixt. Before the wait was synchronous. This change requires close() to *kill*, and not terminate, the child process. * Remove the _kill_wait() method, replaced with a more agressive close() method. It fixes _make_subprocess_transport() on error. BaseSubprocessTransport.close() calls the close() method of pipe transports, whereas _kill_wait() closed directly pipes of the subprocess.Popen object without unregistering file descriptors from the selector (which caused severe bugs). These changes simplifies the code of subprocess.py.
* Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transportVictor Stinner2015-01-291-1/+18
| | | | is not explicitly closed. Close also explicitly transports in test_sslproto.
* asyncio: BaseSubprocessTransport._kill_wait() now also call close()Victor Stinner2015-01-291-0/+3
| | | | close() closes pipes, which is not None yet by _kill_wait().
* asyncio: sync with TulipVictor Stinner2015-01-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * PipeHandle now uses None instead of -1 for a closed handle * Sort imports in windows_utils. * Fix test_events on Python older than 3.5. Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing * Fix BaseEventLoop._create_connection_transport(). Close the transport if the creation of the transport (if the waiter) gets an exception. * _ProactorBasePipeTransport now sets _sock to None when the transport is closed. * Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is not set yet (still equal to None). * TestLoop.close() now calls the close() method of the parent class (BaseEventLoop). * Cleanup BaseSelectorEventLoop: create the protocol on a separated line for readability and ease debugging. * Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so close() doesn't try to terminate the process. * Tests: explicitly close event loops and transports * UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* Python issue #23173: sync with TulipVictor Stinner2015-01-141-24/+53
| | | | | | | | * If an exception is raised during the creation of a subprocess, kill the subprocess (close pipes, kill and read the return status). Log an error in such case. * Fix SubprocessStreamProtocol.connection_made() to handle cancelled waiter. Add unit test cancelling subprocess methods.
* Issue #23209: Break some reference cycles in asyncio. Patch written by MartinVictor Stinner2015-01-091-0/+1
| | | | Richard.
* asyncio: sync with TulipVictor Stinner2014-12-181-1/+1
| | | | | | | | | | | | | | | | * Fix a race condition in BaseSubprocessTransport._try_finish(). If the process exited before the _post_init() method was called, scheduling the call to _call_connection_lost() with call_soon() is wrong: connection_made() must be called before connection_lost(). Reuse the BaseSubprocessTransport._call() method to schedule the call to _call_connection_lost() to ensure that connection_made() and connection_lost() are called in the correct order. * Add repr(PipeHandle) * Fix typo
* asyncio: sync with TulipVictor Stinner2014-07-141-1/+39
| | | | | | | | | | | | | | | | | | | | * Tulip issue #184: Log subprocess events in debug mode - Log stdin, stdout and stderr transports and protocols - Log process identifier (pid) - Log connection of pipes - Log process exit - Log Process.communicate() tasks: feed stdin, read stdout and stderr - Add __repr__() method to many classes related to subprocesses * Add BaseSubprocessTransport._pid attribute. Store the pid so it is still accessible after the process exited. It's more convinient for debug. * create_connection(): add the socket in the "connected to" debug log * Clean up some docstrings and comments. Remove unused unimplemented _read_from_self().
* asyncio: sync with Tulip, add a new asyncio.coroutines moduleVictor Stinner2014-06-291-2/+2
|
* Issue #20400: Merge Tulip into Python: add the new asyncio.subprocess moduleVictor Stinner2014-02-011-14/+9
| | | | | | | | | | | | | | | | | | | | * Add a new asyncio.subprocess module * Add new create_subprocess_exec() and create_subprocess_shell() functions * The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers for stdout and stderr and a stream writer for stdin. * The new asyncio.subprocess.Process class offers an API close to the subprocess.Popen class: - pid, returncode, stdin, stdout and stderr attributes - communicate(), wait(), send_signal(), terminate() and kill() methods * Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess and unix_events, to not be confused with the symbols with the same name of subprocess and asyncio.subprocess modules * _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size of the pending write * _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if the write buffer size is greater than the high water mark (64 KB by default)
* asyncio: Pass through pause/resume from subprocess pipe proto to subprocess ↵Guido van Rossum2014-01-291-2/+5
| | | | proto. Also kill dummy eof_received().
* asyncio: Get rid of _try_connected().Victor Stinner2014-01-291-18/+14
|
* Merge latest Tulip into asyncioAndrew Svetlov2014-01-261-1/+0
|
* asyncio: Add new file (forgotten).Guido van Rossum2013-10-301-0/+166