summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760)Stefan Zabka2022-03-081-1/+1
| | | | | | This change aligns the documentation at https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Server with the actual implementation Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-052-4/+4
|
* bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)Guido van Rossum2022-02-281-2/+5
| | | | | | | | | | | | | | | Also from the _asyncio C accelerator module, and adjust one test that the change caused to fail. For more discussion see the discussion starting here: https://github.com/python/cpython/pull/31394#issuecomment-1053545331 (Basically, @asvetlov proposed to return False from cancel() when there is already a pending cancellation, and I went along, even though it wasn't necessary for the task group implementation, and @agronholm has come up with a counterexample that fails because of this change. So now I'm changing it back to the old semantics (but still bumping the counter) until we can have a proper discussion about this.)
* Taskgroup tweaks (GH-31559)Tin Tvrtković2022-02-261-27/+23
| | | Now uses .cancel()/.uncancel(), for even fewer broken edge cases.
* bpo-46771: Implement task cancel requests counter (GH-31513)Tin Tvrtković2022-02-241-9/+21
| | | | | This changes cancelling() and uncancel() to return the count of pending cancellations. This can be used to avoid bugs in certain edge cases (e.g. two timeouts going off at the same time).
* Inherit asyncio proactor datagram transport from asyncio.DatagramTransport ↵Andrew Svetlov2022-02-221-1/+2
| | | | (#31512)
* bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)Thomas Grainger2022-02-221-1/+3
| | | | | Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-45390: Propagate CancelledError's message from cancelled task to its ↵Andrew Svetlov2022-02-211-0/+5
| | | | | | awaiter (GH-31383) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)Serhiy Storchaka2022-02-213-22/+7
|
* Raise TypeError if SSLSocket is passed to asyncio transport-based methods ↵Andrew Svetlov2022-02-202-10/+20
| | | | (GH-31442)
* bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)Nikita Sobolev2022-02-201-1/+2
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* bpo-46752: Uniform TaskGroup.__repr__ (GH-31409)Andrew Svetlov2022-02-201-8/+10
|
* bpo-46752: Slight improvements to TaskGroup API (GH-31398)Guido van Rossum2022-02-181-18/+4
| | | | | | | | | | | | | | | | | * Remove task group names (for now) We're not sure that they are needed, and once in the code we would never be able to get rid of them. Yury wrote: > Ideally, there should be a way for someone to build a "trace" > of taskgroups/task leading to the current running task. > We could do that using contextvars, but I'm not sure we should > do that in 3.11. * Pass optional name on to task in create_task() * Remove a bunch of unused stuff
* bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)Guido van Rossum2022-02-154-2/+252
| | | | | | | | | | | | | | | | | asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes: - Allow creating new tasks as long as the last task hasn't finished - Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError - Instead of monkey-patching the parent task's cancel() method, add a new public API to Task The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`. Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup. This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside". Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)Alex Waygood2022-02-151-4/+0
| | | The docstring for `BufferedProtocol` states that the class is still an "experimental API", but it has been considered stable since 3.8.
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-157-467/+721
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol ↵Emiya2022-02-012-0/+12
| | | | | transports (GH-30958) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close ↵Kumar Aditya2022-01-281-2/+8
| | | | the coroutine (#30288)
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)Kumar Aditya2022-01-223-6/+6
| | | | | | | | | | | | * bpo-46469: Make asyncio generic classes return GenericAlias * 📜🤖 Added by blurb_it. * Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46310: simplify `for` loop in `asyncio/windows_events` (GH-30334)Nikita Sobolev2022-01-111-1/+1
|
* bpo-46278: fix typo introduced in GH-30427 (GH-30430)Kumar Aditya2022-01-061-2/+2
| | | Automerge-Triggered-By: GH:asvetlov
* Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427)Andrew Svetlov2022-01-061-4/+4
|
* bpo-46239: improve error message when importing `asyncio.windows_events` ↵Nikita Sobolev2022-01-041-0/+5
| | | | (GH-30353)
* bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352)Nikita Sobolev2022-01-041-3/+3
|
* bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)Kumar Aditya2021-12-261-2/+2
|
* bpo-42413: Replace `concurrent.futures.TimeoutError` and ↵Kumar Aditya2021-12-191-2/+1
| | | | | `asyncio.TimeoutError` with builtin `TimeoutError` (GH-30197) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Re-add `reuse_address` parameter to `create_server` (GH-29733)Jim Crist-Harif2021-12-121-0/+6
| | | | | | | This parameter was accidentally removed when fixing https://bugs.python.org/issue45129, this reverts the unnecessary changes there. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-23819: asyncio: Replace AssertionError with TypeError where it makes ↵Kumar Aditya2021-12-062-3/+8
| | | | sense (GH-29894)
* bpo-37658: Actually return result in race condition (GH-29202)Sam Bull2021-11-291-6/+2
|
* Cleanup a couple of comments left on PR 28775 post-merge. (GH-29079)Gregory P. Smith2021-10-201-1/+1
|
* bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)Joongi Kim2021-10-101-2/+0
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-062-3/+3
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* 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>