summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)Miss Islington (bot)2020-08-041-1/+1
| | | | | | | | On Windows, fix asyncio recv_into() return value when the socket/pipe is closed (BrokenPipeError): return 0 rather than an empty byte string (b''). (cherry picked from commit 602a971a2af3a685d625c912c400cadd452718b1) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() ↵Miss Islington (bot)2020-07-231-7/+6
| | | | | | | (GH-21595) (cherry picked from commit 0dd98c2d00a75efbec19c2ed942923981bc06683) Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
* bpo-37703: improve asyncio.gather documentation regarding cancellation ↵Miss Islington (bot)2020-07-201-0/+7
| | | | | | | | | | (GH-15312) These changes updates the doc to comprehensively mention the behaviour of gather.cancel() Automerge-Triggered-By: @asvetlov (cherry picked from commit d42528a3a2c7d79fd2e6c9f2a02f3ce12d44c8cc) Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
* bpo-40967: Remove deprecated asyncio.Task.current_task() and ↵Miss Islington (bot)2020-07-021-28/+0
| | | | | | | asyncio.Task.all_tasks() (GH-20874) (cherry picked from commit 004e64e8059fe68a72890314673282f2e60d5ce1) Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
* Fix asyncio.to_thread() documented return type (GH-20547)Miss Islington (bot)2020-05-311-1/+1
| | | | | | | | When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine. This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio. (cherry picked from commit 2b201369b435a4266bda5b895e3b615dbe28ea6e) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-30064: Fix asyncio loop.sock_* race condition issue (GH-20369)Miss Islington (bot)2020-05-271-16/+25
| | | | | (cherry picked from commit 210a137396979d747c2602eeef46c34fc4955448) Co-authored-by: Fantix King <fantix.king@gmail.com>
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Miss Islington (bot)2020-05-211-2/+6
| | | | | | | | Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143GH-discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros (cherry picked from commit 0f56263e62ba91d0baae40fb98947a3a98034a73) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* s/wakup/wakeup (GH-20250)Miss Islington (bot)2020-05-201-1/+1
| | | | | | | | (as title) Automerge-Triggered-By: @Mariatta (cherry picked from commit f2947e354c95d246b1836ac78d4c820c420e259b) Co-authored-by: Kunal Bhalla <bhalla.kunal@gmail.com>
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Miss Islington (bot)2020-05-192-0/+23
| | | | | | | | Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410GH-issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros (cherry picked from commit cc2bbc2227c3f5ed9d8f6b3bd052e6f9e68279d2) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)Chris Jerdonek2020-05-182-19/+33
| | | | | When an asyncio.Task is cancelled, the exception traceback now starts with where the task was first interrupted. Previously, the traceback only had "depth one."
* bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)Chris Jerdonek2020-05-153-19/+36
|
* bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() ↵romasku2020-05-151-1/+9
| | | | | | | | | | | | | | | (GH-20054) Currently, if asyncio.wait_for() timeout expires, it cancels inner future and then always raises TimeoutError. In case those future is task, it can handle cancelation mannually, and those process can lead to some other exception. Current implementation silently loses thoses exception. To resolve this, wait_for will check was the cancelation successfull or not. In case there was exception, wait_for will reraise it. Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
* bpo-40443: Remove unused imports in the stdlib (GH-19803)Victor Stinner2020-04-302-2/+0
|
* Fix typo from Lib/asyncio/events.py (GH-19410)Galden2020-04-141-1/+1
|
* bpo-39764: Make Task.get_stack accept ag_frame (#18669)Lidi Zheng2020-03-021-3/+10
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39609: set the thread_name_prefix for the default asyncio executor ↵Markus Mohrhard2020-02-271-1/+3
| | | | | (GH-18458) Just a small debugging improvement to identify the asyncio executor threads.
* bpo-34793: Drop old-style context managers in asyncio.locks (GH-17533)Andrew Svetlov2020-02-011-83/+0
|
* bpo-38356: Fix ThreadedChildWatcher thread leak in test_asyncio (GH-16552)Kyle Stanley2020-01-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation for this PR (comment from @vstinner in bpo issue): ``` Warning seen o AMD64 Ubuntu Shared 3.x buildbot: https://buildbot.python.org/all/#/builders/141/builds/2593 test_devnull_output (test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ... Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2) ``` The following implementation details for the new method are TBD: 1) Public vs private 2) Inclusion in `close()` 3) Name 4) Coroutine vs subroutine method 5) *timeout* parameter If it's a private method, 3, 4, and 5 are significantly less important. I started with the most minimal implementation that fixes the dangling threads without modifying the regression tests, which I think is particularly important. I typically try to avoid directly modifying existing tests as much as possible unless it's necessary to do so. However, I am open to changing any part of this. https://bugs.python.org/issue38356
* bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863)Andrew Svetlov2020-01-071-3/+3
| | | https://bugs.python.org/issue39191
* Fix #39191: Don't spawn a task before failing (#17796)Andrew Svetlov2020-01-041-3/+7
|
* bpo-34790: Implement deprecation of passing coroutines to asyncio.wait() ↵Kyle Stanley2019-12-301-0/+6
| | | | (GH-16977)
* Fix import path for asyncio.TimeoutError (#17691)Andrew Svetlov2019-12-241-2/+2
|
* bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (#17311)Kyle Stanley2019-12-091-7/+18
|
* bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)Victor Stinner2019-12-091-10/+10
| | | | Fix asyncio when the ssl module is missing: only check for ssl.SSLSocket instance if the ssl module is available.
* bpo-37404: Raising value error if an SSLSocket is passed to asyncio ↵idomic2019-12-071-0/+10
| | | | | functions (GH-16457) https://bugs.python.org/issue37404
* bpo-38529: Fix asyncio stream warning (GH-17474)Andrew Svetlov2019-12-071-18/+1
|
* bpo-38978: Implement __class_getitem__ for asyncio objects (GH-17491)Batuhan Taşkaya2019-12-073-0/+9
| | | https://bugs.python.org/issue38978
* bpo-38982: Fix asyncio PidfdChildWatcher on waitpid() error (GH-17477)Victor Stinner2019-12-061-2/+13
| | | | | | If waitpid() is called elsewhere, waitpid() call fails with ChildProcessError: use return code 255 in this case, and log a warning. It ensure that the pidfd file descriptor is closed if this error occurs.
* bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)Hill Ma2019-12-052-4/+3
| | | https://bugs.python.org/issue38951
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-192-3/+3
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-38692: Add asyncio.PidfdChildWatcher to __all__ (GH-17161)Kyle Stanley2019-11-151-1/+1
| | | | | | | | | | /cc @asvetlov @1st1 https://bugs.python.org/issue38692 Automerge-Triggered-By: @benjaminp
* closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)Benjamin Peterson2019-11-141-0/+67
|
* bpo-38785: Prevent asyncio from crashing (GH-17144)Andrew Svetlov2019-11-131-1/+4
| | | | | | | if parent `__init__` is not called from a constructor of object derived from `asyncio.Future` https://bugs.python.org/issue38785
* bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)Victor Stinner2019-10-231-3/+3
| | | | bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in the main thread.
* bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)idomic2019-10-031-2/+2
|
* Fix and improve `asyncio.run()` docs (GH-16403)Kyle Stanley2019-10-011-5/+1
|
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-303-1242/+112
| | | See https://bugs.python.org/issue38242 for more details
* bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe ↵Andrew Svetlov2019-09-291-0/+11
| | | | (GH-16472)
* bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)Yury Selivanov2019-09-251-1/+1
|
* bpo-38260: Add Docs on asyncio.run (GH-16337)Emmanuel Arias2019-09-251-0/+4
| | | | | | | | | | | | | Add docs about return and raise exception on asyncio.run https://bugs.python.org/issue38260 Automerge-Triggered-By: @asvetlov
* bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() ↵Kyle Stanley2019-09-193-0/+34
| | | | (GH-15735)
* bpo-38148: Add slots to asyncio transports (GH-16077)Andrew Svetlov2019-09-131-0/+14
| | | | | | | | * bpo-38148: Add slots to asyncio transports * Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
* bpo-36889: Document Stream class and add docstrings (GH-14488)Xtreak2019-09-131-0/+21
| | | | | | | | | | | * This just copies the docs from `StreamWriter` and `StreamReader`. * Add docstring for asyncio functions. https://bugs.python.org/issue36889 Automerge-Triggered-By: @asvetlov
* bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)Andrew Svetlov2019-09-122-2/+30
|
* bpo-36373: Fix deprecation warnings (GH-15889)Andrew Svetlov2019-09-112-2/+2
| | | https://bugs.python.org/issue36373
* bpo-38066: Hide internal Stream methods (GH-15762)Andrew Svetlov2019-09-102-11/+48
| | | | | | feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Emmanuel Arias2019-09-101-0/+4
| | | | | | | | | | | | | | | [queue] (GH-13950) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. fourth step: queue.py https://bugs.python.org/issue36373
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Emmanuel Arias2019-09-101-12/+29
| | | | | | | | | | | | | | | [locks] (GH-13920) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Third step: locks.py https://bugs.python.org/issue36373
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-2/+2
|
* bpo-34679: Restore instantiation Windows IOCP event loop from non-main ↵Andrew Svetlov2019-08-261-1/+4
| | | | | | | | thread (#15492) * Restore running proactor event loop from non-main thread Co-Authored-By: Kyle Stanley <aeros167@gmail.com>