summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* Issue #23812: Fix getter-cancellation with many pending getters code pathYury Selivanov2015-08-061-1/+1
|
* asyncio: Make sure BaseException is re-raised in SSLProtocolYury Selivanov2015-08-051-1/+6
|
* Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.Yury Selivanov2015-08-051-9/+38
| | | | Patch by Gustavo J. A. M. Carneiro.
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-046-11/+13
|
* asyncio: Sync with mainstreamYury Selivanov2015-08-041-1/+1
|
* Revert da29a94367b2Yury Selivanov2015-08-021-2/+3
|
* asyncio: Fix code styleYury Selivanov2015-08-021-3/+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.
* asyncio: sync with githubVictor Stinner2015-07-256-12/+25
| | | | | | | | | * Fix ResourceWarning warnings in test_streams * Return True from StreamReader.eof_received() to fix http://bugs.python.org/issue24539 (but still needs a unittest). Add StreamReader.__repr__() for easy debugging. * remove unused imports * Issue #234: Drop JoinableQueue on Python 3.5+
* asyncio: Add asyncio.compat moduleVictor Stinner2015-07-258-30/+35
| | | | | Move compatibility helpers for the different Python versions to a new asyncio.compat module.
* asyncio: sync with github asyncioVictor Stinner2015-07-091-1/+1
| | | | | * queues: get coroutine from asyncio.coroutines, not from asyncio.tasks * tets: replace tulip with asyncio in comments
* Issue #24450: Proxy gi_yieldfrom & cr_await in asyncio.CoroWrapperYury Selivanov2015-07-031-0/+8
|
* Fix asyncio unittests in debug modeYury Selivanov2015-06-241-0/+2
|
* Issue #24400: Fix CoroWrapper for 'async def' coroutinesYury Selivanov2015-06-241-10/+40
|
* asyncio: Merge changes from issue #24400.Yury Selivanov2015-06-241-31/+17
|
* Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutinesYury Selivanov2015-06-011-1/+1
|
* Issue 24004: Support Awaitables (pep 492) in @asyncio.coroutine decoratorYury Selivanov2015-05-311-2/+13
|
* asyncio: Drop some useless code from tasks.py.Yury Selivanov2015-05-281-7/+2
| | | | See also issue 24017.
* asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine (in 3.5)Yury Selivanov2015-05-131-0/+8
|
* Sync asyncio code from default branch.Yury Selivanov2015-05-132-55/+67
|
* asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is ↵Yury Selivanov2015-05-121-35/+45
| | | | | | | | | | | | running. Previous approach of installing coroutine wrapper in loop.set_debug() and uninstalling it in loop.close() was very fragile. Most of asyncio tests do not call loop.close() at all. Since coroutine wrapper is a global setting, we have to make sure that it's only set when the loop is running, and is automatically unset when it stops running. Issue #24017.
* asyncio: Support PEP 492. Issue #24017.Yury Selivanov2015-05-124-24/+112
|
* asyncio: async() function is deprecated in favour of ensure_future().Yury Selivanov2015-05-113-8/+23
|
* Sync asyncio changes from the main repo.Yury Selivanov2015-05-112-12/+42
|
* Asyncio issue 222 / PR 231 (Victor Stinner) -- fix @coroutine functions ↵Guido van Rossum2015-05-033-11/+23
| | | | without __name__.
* Fix asyncio issue 235: Queue subclass bug caused by JoinableQueue merge.Guido van Rossum2015-04-201-6/+13
|
* Issue #23879, asyncio: SelectorEventLoop.sock_connect() must not call connect()Victor Stinner2015-04-071-8/+6
| | | | | | | | again if the first call to connect() raises an InterruptedError. When the C function connect() fails with EINTR, the connection runs in background. We have to wait until the socket becomes writable to be notified when the connection succeed or fails.
* asyncio: Fix _SelectorTransport.__repr__() if the event loop is closedVictor Stinner2015-03-271-1/+1
|
* Issue #23456: Add missing @coroutine decorators in asyncioVictor Stinner2015-03-183-0/+5
|
* 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, Tulip issue 220: Merge JoinableQueue with Queue.Victor Stinner2015-02-171-59/+43
| | | | | | | | | | | | | | Merge JoinableQueue with Queue. To more closely match the standard Queue, asyncio.Queue has "join" and "task_done". JoinableQueue is deleted. Docstring for Queue.join shouldn't mention threads. Restore JoinableQueue as a deprecated alias for Queue. To more closely match the standard Queue, asyncio.Queue has "join" and "task_done". JoinableQueue remains as a deprecated alias for Queue to avoid needlessly breaking too much code that depended on it. Patch written by A. Jesse Jiryu Davis <jesse@mongodb.com>.
* 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
* asyncio: BaseEventLoop: rename _owner to _thread_idVictor Stinner2015-02-051-6/+6
|
* asyncio: Only call _check_resolved_address() in debug modeVictor Stinner2015-02-043-18/+36
| | | | | | | | | | | | | | | | * _check_resolved_address() is implemented with getaddrinfo() which is slow * If available, use socket.inet_pton() instead of socket.getaddrinfo(), because it is much faster Microbenchmark (timeit) on Fedora 21 (Python 3.4, Linux 3.17, glibc 2.20) to validate the IPV4 address "127.0.0.1" or the IPv6 address "::1": * getaddrinfo() 10.4 usec per loop * inet_pton(): 0.285 usec per loop On glibc older than 2.14, getaddrinfo() always requests the list of all local IP addresses to the kernel (using a NETLINK socket). getaddrinfo() has other known issues, it's better to avoid it when it is possible.
* asyncio: BaseSelectorEventLoop uses directly the private _debug attributeVictor Stinner2015-02-041-5/+5
| | | | | Just try to be consistent: _debug was already used in some places, and always used in BaseProactorEventLoop.
* asyncio, Tulip issue 221: Fix doc of QueueEmpty and QueueFullVictor Stinner2015-02-031-2/+6
|
* Issue #23353, asyncio: Workaround CPython bug #23353Victor Stinner2015-02-023-4/+23
| | | | | 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: 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-294-4/+4
|
* asyncio: sync with TulipVictor Stinner2015-01-294-87/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-298-5/+96
| | | | is not explicitly closed. Close also explicitly transports in test_sslproto.
* asyncio: sync with TulipVictor Stinner2015-01-293-13/+50
| | | | | | | | | * 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 doc: document Protocol state machineVictor Stinner2015-01-291-0/+5
|
* asyncio: sync with TulipVictor Stinner2015-01-291-3/+10
| | | | | | | | | | * _SelectorTransport constructor: extra parameter is now optional * Fix _SelectorDatagramTransport constructor. Only start reading after connection_made() has been called. * Fix _SelectorSslTransport.close(). Don't call protocol.connection_lost() if protocol.connection_made() was not called yet: if the SSL handshake failed or is still in progress. The close() method can be called if the creation of the connection is cancelled, by a timeout for example.
* 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: Fix _SelectorSocketTransport constructorVictor Stinner2015-01-281-1/+3
| | | | | Only start reading when connection_made() has been called: protocol.data_received() must not be called before protocol.connection_made().
* asyncio: SSL transports now clear their reference to the waiterVictor Stinner2015-01-284-21/+32
| | | | | | | * 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: Fix SSLProtocol.eof_received()Victor Stinner2015-01-281-0/+4
| | | | Wake-up the waiter if it is not done yet.