summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* gh-128552: fix refcycles in eager task creation (#128553)Thomas Grainger2025-01-072-2/+12
|
* gh-128559: Remove typing import from asyncio.timeouts (#128560)Michael H2025-01-061-13/+11
|
* gh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)Kumar Aditya2025-01-062-1/+32
| | | Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
* gh-127529: Correct asyncio's `accept_connection` behaviour for handling ↵jb21702025-01-031-3/+7
| | | | | `ConnectionAbortedError` (#127532) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* Mention loop_factory argument in docstring for asyncio.run() (#128288)Andrew Svetlov2024-12-271-0/+1
|
* gh-127949: deprecate `asyncio.set_event_loop` (#128218)Kumar Aditya2024-12-243-14/+24
| | | Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
* gh-127949: deprecate asyncio policy classes (#128216)Kumar Aditya2024-12-244-15/+31
|
* gh-127949: deprecate `asyncio.get_event_loop_policy` (#128053)Kumar Aditya2024-12-181-5/+9
| | | This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.
* gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)Kumar Aditya2024-12-181-2/+8
| | | | First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
* gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol ↵J. Nick Koston2024-12-061-0/+1
| | | | | | | if needed (#127656) Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-126353: remove implicit creation of loop from `asyncio.get_event_loop` ↵Kumar Aditya2024-11-041-24/+0
| | | | | (#126354) Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
* gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is ↵Javad Shafique2024-10-241-1/+4
| | | | | | | thrown (#118960) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-124958: Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and ↵Thomas Grainger2024-10-142-13/+34
| | | | | | | | | _PyFuture refcycles ... (#125486) * Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)" This reverts commit e99650b80ace3893c2a80b3f2a4aca99cb305191. * fix incompatability with gh-124392
* gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles ↵Kirill Podoprigora2024-10-142-34/+13
| | | | | | | (#12… (#125476) Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)" This reverts commit d5dbbf4372cd3dbf3eead1cc70ddc4261c061fd9.
* gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)Thomas Grainger2024-10-142-13/+34
|
* gh-124309: fix staggered race on eager tasks (#124847)Thomas Grainger2024-10-111-3/+14
| | | | | | | This patch is entirely by Thomas and Peter Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-124858: fix happy eyeballs refcyles (#124859)Thomas Grainger2024-10-022-6/+13
|
* gh-124594: Create and reuse the same context for the entire asyncio REPL ↵Bartosz Sławecki2024-10-011-2/+4
| | | | | session (#124595) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* gh-124309: Revert eager task factory fix to prevent breaking downstream ↵Peter Bierma2024-10-012-24/+61
| | | | | | | | | | | (#124810) * Revert "GH-124639: add back loop param to staggered_race (#124700)" This reverts commit e0a41a5dd12cb6e9277b05abebac5c70be684dd7. * Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)" This reverts commit de929f353c413459834a2a37b2d9b0240673d874.
* GH-124639: add back loop param to staggered_race (#124700)Kumar Aditya2024-09-291-2/+8
|
* gh-120284: Enhance `asyncio.run` to accept awaitable objects (#120566)Ron Frederick2024-09-261-4/+13
| | | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-124309: Modernize the `staggered_race` implementation to support eager ↵Peter Bierma2024-09-262-62/+19
| | | | | | | | task factories (#124390) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-120221: Support KeyboardInterrupt in asyncio REPL (#123795)Łukasz Langa2024-09-061-0/+10
| | | | | | | | | This switches the main pyrepl event loop to always be non-blocking so that it can listen to incoming interruptions from other threads. This also resolves invalid display of exceptions from other threads (gh-123178). This also fixes freezes with pasting and an active input hook.
* gH-80788: remove old weakset workaround for thread safety (#123388)Kumar Aditya2024-08-271-17/+2
|
* Fix typo mentioning threads instead of tasks (#123203)Kevin Evans2024-08-231-3/+3
|
* gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)Wulian2024-08-113-2/+11
| | | | | Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` ↵AN Long2024-07-251-3/+2
| | | | (#122269)
* gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958)Łukasz Langa2024-07-221-0/+5
| | | | Relatedly, emit the `cpython.run_startup` event from the Python version of `PYTHONSTARTUP` handling.
* gh-121790: Fix interactive console initialization (#121793)Milan Oberkirch2024-07-151-18/+9
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* fix outdated comments in asyncio (#121783)Kumar Aditya2024-07-152-4/+3
|
* gh-121711: Set `-m asyncio` return_code to 1 for ENOTTY (#121714)Milan Oberkirch2024-07-131-1/+2
| | | Set return_code to 1 for ENOTTY
* gh-119909: Fix ``NameError`` in ``asyncio`` REPL (#121341)Kirill Podoprigora2024-07-061-1/+1
|
* gh-87744: fix waitpid race while calling send_signal in asyncio (#121126)Kumar Aditya2024-07-011-9/+26
| | | asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.
* gh-120804: remove `is_active` method from internal child watchers ↵Kumar Aditya2024-06-281-6/+0
| | | | implementation in asyncio (#121124)
* GH-120804: Remove `PidfdChildWatcher`, `ThreadedChildWatcher` and ↵Kumar Aditya2024-06-231-176/+23
| | | | `AbstractChildWatcher` from asyncio APIs (#120893)
* GH-120804: Remove `get_child_watcher` and `set_child_watcher` from asyncio ↵Kumar Aditya2024-06-232-113/+5
| | | | (#120818)
* GH-107803: double linked list implementation for asyncio tasks (GH-107804)Kumar Aditya2024-06-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * linked list * add tail optmiization to linked list * wip * wip * wip * more fixes * finally it works * add tests * remove weakreflist * add some comments * reduce code duplication in _asynciomodule.c * address some review comments * add invariants about the state of the linked list * add better explanation * clinic regen * reorder branches for better branch prediction * Update Modules/_asynciomodule.c * Apply suggestions from code review Co-authored-by: Itamar Oren <itamarost@gmail.com> * fix capturing of eager tasks * add comment to task finalization * fix tests and couple c implmentation to c task improved linked-list logic and more comments * fix test --------- Co-authored-by: Itamar Oren <itamarost@gmail.com>
* GH-120804: Remove SafeChildWatcher, FastChildWatcher and ↵Kumar Aditya2024-06-211-322/+3
| | | | | MultiLoopChildWatcher from asyncio (#120805) Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio. These child watchers have been deprecated since Python 3.12. The tests are also removed and some more tests will be added after the rewrite of child watchers.
* gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure ↵Kirill Podoprigora2024-06-011-0/+2
| | | | that the given socket is in non-blocking mode (#119519)
* gh-118894: Make asyncio REPL use pyrepl (GH-119433)Łukasz Langa2024-05-311-18/+71
|
* gh-119121: Fix and test `async.staggered.staggered_race` (#119173)Nikita Sobolev2024-05-201-2/+1
|
* gh-118817: Fix `asyncio REPL` on Windows (#118819)Kirill Podoprigora2024-05-091-3/+4
|
* gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)Bruce Merry2024-04-111-5/+5
| | | | | | | | | | | | | gh-16429 introduced support for an iterable of separators in Stream.readuntil. Since bytes-like types are themselves iterable, this can introduce ambiguities in deciding whether the argument is an iterator of separators or a singleton separator. In gh-16429, only 'bytes' was considered a singleton, but this will break code that passes other buffer object types. Fix it by only supporting tuples rather than arbitrary iterables. Closes gh-117722.
* gh-116720: Fix corner cases of taskgroups (#117407)Guido van Rossum2024-04-092-6/+15
| | | | | | | | | | This prevents external cancellations of a task group's parent task to be dropped when an internal cancellation happens at the same time. Also strengthen the semantics of uncancel() to clear self._must_cancel when the cancellation count reaches zero. Co-Authored-By: Tin Tvrtković <tinchester@gmail.com> Co-Authored-By: Arthur Tacca
* gh-81322: support multiple separators in StreamReader.readuntil (#16429)Bruce Merry2024-04-081-21/+44
|
* gh-96471: Correct documentation for asyncio queue shutdown (#117621)Laurie O2024-04-081-2/+4
|
* gh-96471: Add asyncio queue shutdown (#104228)Laurie O2024-04-061-3/+65
| | | Co-authored-by: Duprat <yduprat@gmail.com>
* gh-117459: Keep the traceback in _convert_future_exc (#117460)rsp4jack2024-04-041-4/+2
|
* gh-77714: Provide an async iterator version of as_completed (GH-22491)Justin Turner Arthur2024-04-011-44/+108
| | | | | | | | | * as_completed returns object that is both iterator and async iterator * Existing tests adjusted to test both the old and new style * New test to ensure iterator can be resumed * New test to ensure async iterator yields any passed-in Futures as-is Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011)Erik Soma2024-03-231-12/+17
|