summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45129 Remove deprecated reuse_address (GH-28207)Hugo van Kemenade2021-09-081-25/+2
| | | | | | | | Due to significant security concerns, the reuse_address parameter of asyncio.loop.create_datagram_endpoint, deprecated in Python 3.9, is now removed. This is because of the behavior of the socket option SO_REUSEADDR in UDP. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Trivial typo in docstringJesús Cea2021-07-311-1/+1
|
* bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)Mariusz Felisiak2021-07-261-1/+1
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor ↵Illia Volochii2021-07-011-5/+1
| | | | (GH-24540)
* bpo-43216: Remove @asyncio.coroutine (GH-26369)Illia Volochii2021-07-011-162/+4
| | | | | | | | | Remove the @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code; remove asyncio.coroutines.CoroWrapper used for wrapping legacy coroutine objects in the debug mode. The decorator has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10.
* bpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538)Illia Volochii2021-06-301-108/+0
|
* bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)Ethan Furman2021-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | * [Enum] reduce scope of new format behavior Instead of treating all Enums the same for format(), only user mixed-in enums will be affected. In other words, IntEnum and IntFlag will not be changing the format() behavior, due to the requirement that they be drop-in replacements of existing integer constants. If a user creates their own integer-based enum, then the new behavior will apply: class Grades(int, Enum): A = 5 B = 4 C = 3 D = 2 F = 0 Now: format(Grades.B) -> DeprecationWarning and '4' 3.12: -> no warning, and 'B'
* Fix typos in multiple files (GH-26689)Binbin2021-06-131-1/+1
| | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-037-721/+467
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* bpo-44011: Fix asyncio tests without ssl module (GH-25840)Christian Heimes2021-05-031-1/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-027-467/+720
|
* bpo-43989: Add signal format specifier for unix_events (GH-25769)Roberto Hueso2021-05-011-2/+2
| | | Add format specifier for IntEnum references to avoid 3.12 deprecation warning.
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-254-27/+44
| | | | | | (GH-23554) asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop. In future releases it will became an alias of asyncio.get_running_loop().
* bpo-41891: ensure asyncio.wait_for waits for task completion (#22461)Richard Kojedzinszky2020-12-181-1/+4
|
* bpo-38323: Add guard clauses in MultiLoopChildWatcher. (#22756)Chris Jerdonek2020-12-161-14/+18
| | | This is a trivial refactor in preparation for a fix for bpo-38323.
* bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)Victor Stinner2020-12-161-19/+15
| | | | | test_unix_events.py no longer checks if waitstatus_to_exitcode() mock has been called or not to make the test more functional, rather than checking the exact implementation.
* bpo-42582: Remove asyncio._all_tasks_compat(). (GH-23664)Serhiy Storchaka2020-12-062-28/+0
| | | It was used to implement now removed asyncio.Task.all_tasks().
* bpo-34215: Clarify IncompleteReadError message when "expected" is None ↵Zackery Spytz2020-11-281-1/+2
| | | | | (GH-21925) Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
* bpo-41241: Unnecessary Type casting in 'if condition' (GH-21396)Wansoo Kim2020-11-281-1/+1
| | | | | | | | This is my first issue! So, if there's anything wrong, please tell me! Also, thank you always for all the contributors! Automerge-Triggered-By: GH:asvetlov
* bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess ↵Yurii Karabas2020-11-285-74/+25
| | | | (GH-23521)
* bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop ↵Alex Grönholm2020-11-262-8/+14
| | | | | | (GH-21533) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)Yurii Karabas2020-11-261-28/+9
|
* bpo-42392: Improve removal of *loop* parameter in asyncio primitives (GH-23499)Yurii Karabas2020-11-253-14/+29
| | | | | | | | | | * Update code after merge review from 1st1 * Use a sentinel approach for loop parameter Remove unnecessary _get_running_loop patching * Use more clear function name (_verify_parameter_is_marker -> _verify_no_loop) * Add init method to _LoopBoundMixin to check that loop param wasn't used
* bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)Yurii Karabas2020-11-244-67/+45
| | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-42140: Improve asyncio.wait function (GH-22938)Diogo Dutra2020-11-101-2/+4
| | | | | | | | | | # Improve asyncio.wait function The original code creates the futures set two times. We can create this set before, avoiding the second creation. This new behaviour [breaks the aiokafka library](https://github.com/aio-libs/aiokafka/pull/672), because it gives an iterator to that function, so the second iteration become empty. Automerge-Triggered-By: GH:1st1
* bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() ↵Andrew Svetlov2020-11-101-3/+22
| | | | | | | | (GH-23020) The overflow occurs under some circumstances when a task or future recursively returns itself. Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-42230: Improve asyncio documentation regarding accepting sets vs ↵Jakub Stasiak2020-11-021-2/+2
| | | | | | | | | | | | | | iterables (GH-23073) People call wait() and as_completed() with various non-set iterables, a list should be the most common but there are others as well[1]. Considering typeshed also documents wait()[2] and as_completed()[3] as accepting arbitrary iterables I think it's a good idea to document the status quo better. [1] https://github.com/aio-libs/aiokafka/pull/672 [2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161 [3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40
* bpo-39651: Fix asyncio proactor _write_to_self() (GH-22197)Victor Stinner2020-09-122-9/+20
| | | | | Fix a race condition in the call_soon_threadsafe() method of asyncio.ProactorEventLoop: do nothing if the self-pipe socket has been closed.
* bpo-41696: Fix handling of debug mode in asyncio.run (#22069)Shantanu2020-09-031-2/+3
| | | | | | | | | | | * bpo-41696: Fix handling of debug mode in asyncio.run This allows PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode when using asyncio.run * 📜🤖 Added by blurb_it. Co-authored-by: hauntsaninja <> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39010: Fix errors logged on proactor loop restart (#22017)Ben Darnell2020-08-312-2/+14
| | | | | | Stopping and restarting a proactor event loop on windows can lead to spurious errors logged (ConnectionResetError while reading from the self pipe). This fixes the issue by ensuring that we don't attempt to start multiple copies of the self-pipe reading loop.
* bpo-37658: Fix asyncio.wait_for() to respect waited task status (#21894)Elvis Pranskevichus2020-08-261-3/+6
| | | | | | Currently, if `asyncio.wait_for()` itself is cancelled it will always raise `CancelledError` regardless if the underlying task is still running. This is similar to a race with the timeout, which is handled already.
* bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (#21895)Elvis Pranskevichus2020-08-261-2/+7
| | | | | | When I was fixing bpo-32751 back in GH-7216 I missed the case when *timeout* is zero or negative. This takes care of that. Props to @aaliddell for noticing the inconsistency.
* bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914)Cleber Rosa2020-08-201-2/+2
| | | | | | | Fix grammar in BaseTransport.close docstring. https://bugs.python.org/issue41572 Signed-off-by: Cleber Rosa <crosa@redhat.com>
* bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method ↵James Weaver2020-08-171-1/+1
| | | | | | not a coroutine (GH-21852) asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method. This matches the concrete implementations, and the documentation better.
* bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)Victor Stinner2020-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'').
* bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (#21595)Alex Grönholm2020-07-231-7/+6
|
* bpo-37703: improve asyncio.gather documentation regarding cancellation ↵Vinay Sharma2020-07-201-0/+7
| | | | | | | (GH-15312) These changes updates the doc to comprehensively mention the behaviour of gather.cancel() Automerge-Triggered-By: @asvetlov
* bpo-41273: asyncio's proactor read transport's better performance by using ↵Tony Solomonik2020-07-141-19/+21
| | | | | | | | | | | | | | | recv_into instead of recv (#21442) * bpo-41273: Proactor transport read loop to use recv_into By using recv_into instead of recv we do not allocate a new buffer each time _loop_reading calls recv. This betters performance for any stream using proactor (basically any asyncio stream on windows). * bpo-41273: Double proactor read transport buffer size By doubling the read buffer size we get better performance.
* bpo-40967: Remove deprecated asyncio.Task.current_task() and ↵Rémi Lapeyre2020-07-021-28/+0
| | | | asyncio.Task.all_tasks() (GH-20874)
* Fix asyncio.to_thread() documented return type (GH-20547)Kyle Stanley2020-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.
* bpo-30064: Fix asyncio loop.sock_* race condition issue (#20369)Fantix King2020-05-271-16/+25
|
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Kyle Stanley2020-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/20143#discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros
* s/wakup/wakeup (GH-20250)Kunal Bhalla2020-05-201-1/+1
| | | | | (as title) Automerge-Triggered-By: @Mariatta
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Kyle Stanley2020-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/18410#issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros
* 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>