summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge 3.5 (issue #28704)Yury Selivanov2016-11-151-0/+8
|\
| * Issue #28704: Fix create_unix_server to support Path-like objectsYury Selivanov2016-11-151-0/+8
| |
* | Merge 3.5 (issue #28652)Yury Selivanov2016-11-091-2/+2
|\ \ | |/
| * Issue #28652: Make loop methods reject socket kinds they do not support.Yury Selivanov2016-11-091-2/+2
| |
* | Merge 3.5 (issue #28399)Yury Selivanov2016-10-091-0/+11
|\ \ | |/
| * Issue #28399: Remove UNIX socket from FS before binding.Yury Selivanov2016-10-091-0/+11
| | | | | | | | Patch by Коренберг Марк.
* | Merge 3.5 (asyncio)Yury Selivanov2016-10-071-2/+9
|\ \ | |/
| * asyncio: Only allow Unix Stream sockets for loop.create_unix_server/connectionYury Selivanov2016-10-071-2/+9
| |
* | Merge 3.5 (issue #28369)Yury Selivanov2016-10-051-13/+13
|\ \ | |/
| * Issue #28369: Raise an error when transport's FD is used with add_readerYury Selivanov2016-10-051-13/+13
| |
* | Merge 3.5 (issue #28368)Yury Selivanov2016-10-051-5/+18
|\ \ | |/
| * Issue #28368: Refuse monitoring processes if the child watcher has no loop ↵Yury Selivanov2016-10-051-5/+18
| | | | | | | | | | | | attached. Patch by Vincent Michel.
* | Merge 3.5 (asyncio, issue #26909)Yury Selivanov2016-09-151-15/+12
|\ \ | |/
| * Issue #26909: Fix slow pipes IO in asyncio.Yury Selivanov2016-09-151-15/+12
| | | | | | | | Patch by INADA Naoki.
* | Merge 3.5 (asyncio)Yury Selivanov2016-09-121-0/+12
|\ \ | |/
| * asyncio: Add set_protocol / get_protocol methods to TransportsYury Selivanov2016-09-121-0/+12
| |
* | Merge asyncio from 3.5Guido van Rossum2016-08-311-10/+21
|\ \ | |/
| * Fix ordering issues in UNIX read/write pipe transport constructors.Guido van Rossum2016-08-311-6/+17
| | | | | | | | Upstream https://github.com/python/asyncio/pull/408 by Ron Frederick.
| * Don't select for read on character devices in _UnixWritePipeTransport.Guido van Rossum2016-08-311-4/+4
| | | | | | | | Upstream https://github.com/python/asyncio/pull/374 by Ron Frederick.
* | Merge 3.5 (Issue #27041)Yury Selivanov2016-05-161-1/+1
|\ \ | |/
| * Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-1/+1
| |
* | Merge 3.5 (asyncio)Yury Selivanov2016-05-131-4/+10
|\ \ | |/
| * asyncio: Fix unix pipe transport 'repr' methodsYury Selivanov2016-05-131-4/+10
| | | | | | | | | | Patch by Vincent Michel. See also https://github.com/python/asyncio/pull/326
* | Merge 3.5 (asyncio)Victor Stinner2016-04-011-1/+1
|\ \ | |/
| * asyncio: Don't log ConnectionAbortedErrorVictor Stinner2016-04-011-1/+1
| | | | | | | | | | Issue #26509: In fatal error handlers, don't log ConnectionAbortedError which occur on Windows.
* | Add a source parameter to warnings.warn()Victor Stinner2016-03-221-2/+4
|/ | | | | | | | 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
* asyncio: Cleanup Future APIYury Selivanov2015-11-171-2/+4
| | | | See https://github.com/python/asyncio/pull/292 for details.
* asyncio: Add Transport.is_closing()Yury Selivanov2015-11-161-0/+6
| | | | See https://github.com/python/asyncio/pull/291 for details.
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-041-2/+3
|
* Issue #23353, asyncio: Workaround CPython bug #23353Victor Stinner2015-02-021-2/+10
| | | | | Don't use yield/yield-from in an except block of a generator. Store the exception and handle it outside the except block.
* Issue #23347, asyncio: Make BaseSubprocessTransport.wait() privateVictor Stinner2015-01-291-1/+1
|
* asyncio: sync with TulipVictor Stinner2015-01-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+19
| | | | is not explicitly closed. Close also explicitly transports in test_sslproto.
* asyncio: sync with TulipVictor Stinner2015-01-291-6/+11
| | | | | | | | | * Cleanup gather(): use cancelled() method instead of using private Future attribute * Fix _UnixReadPipeTransport and _UnixWritePipeTransport. Only start reading when connection_made() has been called. * Issue #23333: Fix BaseSelectorEventLoop._accept_connection(). Close the transport on error. In debug mode, log errors using call_exception_handler()
* asyncio: SSL transports now clear their reference to the waiterVictor Stinner2015-01-281-2/+2
| | | | | | | * Rephrase also the comment explaining why the waiter is not awaken immediatly. * SSLProtocol.eof_received() doesn't instanciate ConnectionResetError exception directly, it will be done by Future.set_exception(). The exception is not used if the waiter was cancelled or if there is no waiter.
* asyncio: Close the transport on subprocess creation failureVictor Stinner2015-01-151-1/+5
|
* Issue #23243: Fix asyncio._UnixWritePipeTransport.close()Victor Stinner2015-01-151-1/+1
| | | | | Do nothing if the transport is already closed. Before it was not possible to close the transport twice.
* asyncio: sync with TulipVictor Stinner2015-01-141-2/+12
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* asyncio: sync with TulipVictor Stinner2015-01-091-4/+1
| | | | | | | * Tulip issue 184: FlowControlMixin constructor now get the event loop if the loop parameter is not set. Add unit tests to ensure that constructor of StreamReader and StreamReaderProtocol classes get the event loop. * Remove outdated TODO/XXX
* asyncio: Truncate to 80 columnsVictor Stinner2015-01-081-1/+2
|
* asyncio, tulip issue 209: Fix subprocess for close_fds=False on Python 3.3Victor Stinner2014-12-111-0/+22
| | | | Mark the write end of the stdin pipe as non-inheritable.
* Closes #22922: More EventLoop methods fail if the loop is closed. Initial patchVictor Stinner2014-12-041-0/+1
| | | | | | | written by Torsten Landschoff. create_task(), call_at(), call_soon(), call_soon_threadsafe() and run_in_executor() now raise an error if the event loop is closed.
* asyncio: Coroutine objects are now rejected with a TypeError by the followingVictor Stinner2014-11-201-2/+3
| | | | | | | | | | | | | | functions: * add_signal_handler() * call_at() * call_later() * call_soon() * call_soon_threadsafe() * run_in_executor() Fix also the error message of add_signal_handler() (fix the name of the function).
* - Issue #22841: Reject coroutines in asyncio add_signal_handler().Guido van Rossum2014-11-141-0/+3
| | | | Patch by Ludovic.Gasc.
* asyncio: Move loop attribute to _FlowControlMixinVictor Stinner2014-11-051-2/+1
| | | | | | | | | Move the _loop attribute from the constructor of _SelectorTransport, _ProactorBasePipeTransport and _UnixWritePipeTransport classes to the constructor of the _FlowControlMixin class. Add also an assertion to explicit that the parent class must ensure that the loop is defined (not None)
* asyncio.unix_events: Move import statement to match tulip codeYury Selivanov2014-09-251-1/+2
|
* asyncio: sync with TulipVictor Stinner2014-08-251-3/+11
| | | | | | | | | | | | | | | | | | | | | | | * PipeServer.close() now cancels the "accept pipe" future which cancels the overlapped operation. * Fix _SelectorTransport.__repr__() if the transport was closed * Fix debug log in BaseEventLoop.create_connection(): get the socket object from the transport because SSL transport closes the old socket and creates a new SSL socket object. Remove also the _SelectorSslTransport._rawsock attribute: it contained the closed socket (not very useful) and it was not used. * Issue #22063: socket operations (sock_recv, sock_sendall, sock_connect, sock_accept) of the proactor event loop don't raise an exception in debug mode if the socket are in blocking mode. Overlapped operations also work on blocking sockets. * Fix unit tests in debug mode: mock a non-blocking socket for socket operations which now raise an exception if the socket is blocking. * _fatal_error() method of _UnixReadPipeTransport and _UnixWritePipeTransport now log all exceptions in debug mode * Don't log expected errors in unit tests * Tulip issue 200: _WaitHandleFuture._unregister_wait() now catchs and logs exceptions. * Tulip issue 200: Log errors in debug mode instead of simply ignoring them.
* asyncio: Use the new os.set_blocking() function of Python 3.5 if availableVictor Stinner2014-07-291-4/+8
|
* asyncio: sync with TulipVictor Stinner2014-07-231-3/+3
| | | | | * Tulip issue 194: Don't use sys.getrefcount() in unit tests * signal.set_wakeup_fd() can now raise an OSError on Python 3.5
* Python issue #21645, Tulip issue 192: Rewrite signal handlingVictor Stinner2014-07-171-2/+18
| | | | | | | | | | | | | | | | | | | Since Python 3.3, the C signal handler writes the signal number into the wakeup file descriptor and then schedules the Python call using Py_AddPendingCall(). asyncio uses the wakeup file descriptor to wake up the event loop, and relies on Py_AddPendingCall() to schedule the final callback with call_soon(). If the C signal handler is called in a thread different than the thread of the event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In this case, the event loop has nothing to do and go to sleep again. Py_AddPendingCall() is called while the event loop is sleeping again and so the final callback is not scheduled immediatly. This patch changes how asyncio handles signals. Instead of relying on Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on the wakeup file descriptor. asyncio reads signal numbers from the wakeup file descriptor to call its signal handler.