summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-27500: Fix static version of getaddrinfo to resolve IPv6 (GH-7993)Yury Selivanov2018-06-291-4/+10
|
* bpo-30805: Avoid race condition with debug logging (GH-7545)Yury Selivanov2018-06-081-2/+4
| | | Supersedes https://github.com/python/cpython/pull/2490
* bpo-33694: Fix typo in helper function name (GH-7522)Victor Stinner2018-06-083-3/+3
| | | | | | _feed_data_to_bufferred_proto() renamed to _feed_data_to_buffered_proto() ("bufferred" => "buffered"). Typo spotted by Nathaniel J. Smith.
* bpo-33792: Add selector and proactor windows policies (GH-7487)Yury Selivanov2018-06-081-3/+8
|
* bpo-33694: Fix race condition in asyncio proactor (GH-7498)Victor Stinner2018-06-073-145/+73
| | | | | | | | | | | | | | | | The cancellation of an overlapped WSARecv() has a race condition which causes data loss because of the current implementation of proactor in asyncio. No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport to work around the race condition. Remove the optimized recv_into() implementation to get simple implementation of pause_reading() using the single _pending_data attribute. Move _feed_data_to_bufferred_proto() to protocols.py. Remove set_protocol() method which became useless.
* bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403)Yury Selivanov2018-06-052-3/+6
| | | In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
* bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)Yury Selivanov2018-06-044-37/+39
| | | | | | | * Fix AttributeError (not all SSL exceptions have 'errno' attribute) * Increase default handshake timeout from 10 to 60 seconds * Make sure start_tls can be cancelled correctly * Make sure any error in SSLProtocol gets propagated (instead of just being logged)
* bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)jhaydaman2018-05-301-6/+2
| | | | | | | Future.set_result and Future.set_exception now raise InvalidStateError if the futures are not pending or running. This mirrors the behavior of asyncio.Future, and prevents AssertionErrors in asyncio.wrap_future when set_result is called multiple times.
* Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (#7232)Yury Selivanov2018-05-301-7/+0
| | | This reverts commit 5d97b7bcc19496617bf8c448d2f149cc28c73bc7.
* bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)Elvis Pranskevichus2018-05-291-2/+21
| | | | | | | | | | | | | | | | | | | | | | | Currently, asyncio.wait_for(fut), upon reaching the timeout deadline, cancels the future and returns immediately. This is problematic for when *fut* is a Task, because it will be left running for an arbitrary amount of time. This behavior is iself surprising and may lead to related bugs such as the one described in bpo-33638: condition = asyncio.Condition() async with condition: await asyncio.wait_for(condition.wait(), timeout=0.5) Currently, instead of raising a TimeoutError, the above code will fail with `RuntimeError: cannot wait on un-acquired lock`, because `__aexit__` is reached _before_ `condition.wait()` finishes its cancellation and re-acquires the condition lock. To resolve this, make `wait_for` await for the task cancellation. The tradeoff here is that the `timeout` promise may be broken if the task decides to handle its cancellation in a slow way. This represents a behavior change and should probably not be back-patched to 3.6 and earlier.
* bpo-32684: Fix gather to propagate cancel of itself with return_exceptions ↵Yury Selivanov2018-05-291-1/+13
| | | | (GH-7209)
* bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)Yury Selivanov2018-05-291-0/+7
| | | | Original patch by Dan O'Reilly.
* bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)Victor Stinner2018-05-291-1/+1
| | | | | | | Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 4 KiB. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
* bpo-33654: Support protocol type switching in SSLTransport.set_protocol() ↵Yury Selivanov2018-05-291-4/+7
| | | | (#7194)
* bpo-33674: Pause the transport as early as possible (#7192)Yury Selivanov2018-05-291-2/+5
|
* bpo-33674: asyncio: Fix SSLProtocol race (GH-7175)Victor Stinner2018-05-281-1/+1
| | | | | | Fix a race condition in SSLProtocol.connection_made() of asyncio.sslproto: start immediately the handshake instead of using call_soon(). Previously, data_received() could be called before the handshake started, causing the handshake to hang or fail.
* bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172)Yury Selivanov2018-05-282-2/+9
|
* bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)Yury Selivanov2018-05-283-3/+16
|
* bpo-33469: RuntimeError after closing loop that used run_in_executor (GH-7171)Yury Selivanov2018-05-281-0/+3
|
* bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines (GH-7161)Yury Selivanov2018-05-282-40/+50
|
* bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)Yury Selivanov2018-05-286-26/+107
| | | | | | | | | | | In this commit: * Support BufferedProtocol in set_protocol() and start_tls() * Fix proactor to cancel readers reliably * Update tests to be compatible with OpenSSL 1.1.1 * Clarify BufferedProtocol docs * Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving * Rewrite test_start_tls_server_1
* bpo-33505: Optimize asyncio.ensure_future by reordering if conditions (GH-6836)jimmylai2018-05-281-5/+5
|
* bpo-31647: Fix write_eof() after close() for SelectorSocketTransport (GH-7149)twisteroid ambassador2018-05-281-1/+1
| | | | | Fixed bug where calling write_eof() on a _SelectorSocketTransport after it's already closed raises AttributeError.
* bpo-33263: Fix FD leak in _SelectorSocketTransport (GH-6450)Vlad Starostin2018-05-211-3/+9
| | | | | | | | | * bpo-33263 Fix FD leak in _SelectorSocketTransport. (GH-6450) Under particular circumstances _SelectorSocketTransport can try to add a reader even the transport is already being closed. This can lead to FD leak and invalid stated of the following connections. Fixed the SelectorSocketTransport to add the reader only if the trasport is still active.
* bpo-32262: Fix typo in f-string (GH-7016)Christian Heimes2018-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix typo from commit 6370f345e1d5829e1fba59cd695c8b82c5a8c620 Signed-off-by: Christian Heimes <christian@python.org> <!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. # Pull Request title It should be in the following format: ``` bpo-NNNN: Summary of the changes made ``` Where: bpo-NNNN refers to the issue number in the https://bugs.python.org. Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue. # Backport Pull Request title If this is a backport PR (PR made against branches other than `master`), please ensure that the PR title is in the following format: ``` [X.Y] <title from the original PR> (GH-NNNN) ``` Where: [X.Y] is the branch name, e.g. [3.6]. GH-NNNN refers to the PR number from `master`. --> <!-- issue-number: bpo-32262 --> https://bugs.python.org/issue32262 <!-- /issue-number -->
* bpo-33584: Fix several minor bugs in asyncio. (GH-7003)Serhiy Storchaka2018-05-201-1/+1
| | | | | | | | | | | | Fix the following bugs in the C implementation: * get_future_loop() silenced all exceptions raised when look up the get_loop attribute, not just an AttributeError. * enter_task() silenced all exceptions raised when look up the current task, not just a KeyError. * repr() was called for a borrowed link in enter_task() and task_step_impl(). * str() was used instead of repr() in formatting one error message (in Python implementation too). * There where few reference leaks in error cases.
* bpo-26819: Prevent proactor double read on resume (#6921)CtrlZvi2018-05-201-1/+7
| | | | | | | | | | The proactor event loop has a race condition when reading with pausing/resuming. `resume_reading()` unconditionally schedules the read function to read from the current future. If `resume_reading()` was called before the previously scheduled done callback fires, this results in two attempts to get the data from the most recent read and an assertion failure. This commit tracks whether or not `resume_reading` needs to reschedule the callback to restart the loop, preventing a second attempt to read the data.
* bpo-33332: Add signal.valid_signals() (GH-6581)Antoine Pitrou2018-05-041-2/+2
|
* Fix duplicating words words. (GH-6296)Serhiy Storchaka2018-03-281-1/+1
| | | Most of them have been added in 3.7.
* Fix senfile typo (#6265)Sam Dunster2018-03-281-1/+1
| | | * Also in docs
* bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044)Andrew Svetlov2018-03-101-1/+5
| | | | * Skip write()/data_received() if sslpipe is destroyed
* bpo-32622: Native sendfile on windows (#5565)Andrew Svetlov2018-02-252-1/+91
| | | * Support sendfile on Windows Proactor event loop naively.
* bpo-32841: Fix cancellation in awaiting asyncio.Condition (#5665)Bar Harel2018-02-141-1/+5
|
* bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466)Bar Harel2018-02-021-10/+22
|
* Implement TimerHandle.when() (#5473)Andrew Svetlov2018-02-011-0/+8
|
* bpo-32251: Fix docs (#5408)Yury Selivanov2018-01-291-1/+1
|
* bpo-32251: Implement asyncio.BufferedProtocol. (#4755)Yury Selivanov2018-01-283-37/+241
|
* bpo-32327: Revert loop.run_in_executor behaviour: return a Future. (#5392)Yury Selivanov2018-01-281-2/+2
| | | | I've run some tests on 3.7 asyncio and it appears that too many things assume that run_in_executor returns a Future.
* bpo-32622: Normalize ENOTCONN to ConnectionError on macOS (GH-5369)Yury Selivanov2018-01-271-0/+11
| | | | On mac, sendfile throws ENOTCONN on a repeated sendfile call if the connection is closed. Normalize it to behave like other systems.
* bpo-32622: Enforce sendfile fallback policy for FALLBACK transports (#5364)Yury Selivanov2018-01-271-1/+6
|
* bpo-32622: Implement loop.sendfile() (#5271)Andrew Svetlov2018-01-277-4/+219
|
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-6/+0
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32574: Fix leaks in asyncio.Queue.put() and .get() (#5208)José Melero Fernández2018-01-251-2/+10
|
* bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)Yury Selivanov2018-01-253-30/+132
| | | | | | | | | | | | | * bpo-32662: Implement Server.start_serving() and Server.serve_forever() New methods: * Server.start_serving(), * Server.serve_forever(), and * Server.is_serving(). Add 'start_serving' keyword parameter to loop.create_server() and loop.create_unix_server().
* bpo-32391: Implement StreamWriter.wait_closed() (#5281)Andrew Svetlov2018-01-241-9/+27
|
* bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)Nathaniel J. Smith2018-01-241-1/+2
|
* bpo-32643: Drop support for a few private Task and Future APIs. (#5293)Yury Selivanov2018-01-242-18/+18
| | | | | | | | Specifically, it's not possible to subclass Task/Future classes and override the following methods: * Future._schedule_callbacks * Task._step * Task._wakeup
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-237-36/+55
|
* bpo-32314: Fix asyncio.run() to cancel runinng tasks on shutdown (#5262)Yury Selivanov2018-01-212-15/+35
|
* bpo-32591: Add native coroutine origin tracking (#5250)Nathaniel J. Smith2018-01-212-66/+16
| | | | | | * Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth * Use coroutine origin information in the unawaited coroutine warning * Stop using set_coroutine_wrapper in asyncio debug mode * In BaseEventLoop.set_debug, enable debugging in the correct thread