summaryrefslogtreecommitdiff
path: root/Lib/asyncio
Commit message (Collapse)AuthorAgeFilesLines
...
* GH-90985: Revert "Deprecate passing a message into cancel()" (#97999)Guido van Rossum2022-10-062-11/+0
| | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement.
* GH-88050: fix race in closing subprocess pipe in asyncio (#97951)Kumar Aditya2022-10-061-1/+3
| | | Check for None when iterating over `self._pipes.values()`.
* gh-88050: Fix asyncio subprocess to kill process cleanly when process is ↵Kumar Aditya2022-10-051-6/+7
| | | | blocked (#32073)
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-043-1/+22
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (#97765)hetmankp2022-10-031-3/+4
| | | Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
* gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() ↵Łukasz Langa2022-10-011-2/+2
| | | | | | (#95253) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* GH-96827: Don't touch closed loops from executor threads (#96837)Guido van Rossum2022-09-302-2/+6
| | | | | * When chaining futures, skip callback if loop closed. * When shutting down an executor, don't wake a closed loop.
* GH-82448: Add thread timeout for loop.shutdown_default_executor (#97561)Kumar Aditya2022-09-283-7/+26
| | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* gh-97545: Make Semaphore run faster. (#97549)Cyker Way2022-09-261-21/+17
|
* GH-85760: Fix race in calling process_exited callback too early (#97009)Kumar Aditya2022-09-221-1/+2
|
* gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (#93222)Cyker Way2022-09-221-22/+42
| | | | | | | | | The main problem was that an unluckily timed task cancellation could cause the semaphore to be stuck. There were also doubts about strict FIFO ordering of tasks allowed to pass. The Semaphore implementation was rewritten to be more similar to Lock. Many tests for edge cases (including cancellation) were added.
* Revert "gh-87079: Warn on unintended signal wakeup fd override in `asyncio` ↵Guido van Rossum2022-09-172-28/+5
| | | | | | | (#96807)" (#96898) This reverts commit 05878106989c6f5b9dd35a6c15a21bee59312827. Reason: This broke buildbots (some warnings added by that commit are turned to errors in the SSL buildbot). Repro: ./python Lib/test/ssltests.py
* gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)Michel Hidalgo2022-09-172-5/+28
| | | Warn on loop initialization, when setting the wakeup fd disturbs a previously set wakeup fd, and on loop closing, when upon resetting the wakeup fd, we find it has been changed by someone else.
* gh-94972: document that shield users need to keep a reference to their task ↵Hendrik Makait2022-09-101-2/+9
| | | | | | (#96724) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-93973: Add all_errors to asyncio.create_connection (#93974)Pamela Fox2022-09-041-1/+4
| | | | Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705)Kumar Aditya2022-08-291-19/+16
|
* gh-90467: StreamReaderProtocol - add strong reference to created task (#96323)Kirill2022-08-271-1/+3
|
* GH-95704: Don't suppress errors from tasks when TG is cancelled (#95761)Guido van Rossum2022-08-161-4/+3
| | | | | | | | | | | | | When a task catches CancelledError and raises some other error, the other error should not silently be suppressed. Any scenario where a task crashes in cleanup upon cancellation will now result in an ExceptionGroup wrapping the crash(es) instead of propagating CancelledError and ignoring the side errors. NOTE: This represents a change in behavior (hence the need to change several tests). But it is only an edge case. Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* GH-95899: fix asyncio.Runner to call set_event_loop only once (#95900)Kumar Aditya2022-08-151-3/+5
|
* gh-95724: Clarify taskgroups.py license. (#95847)Yury Selivanov2022-08-111-1/+2
|
* GH-95289: Always call uncancel() when parent cancellation is requested (#95602)Kumar Aditya2022-08-041-8/+9
| | | Co-authored-by: Guido van Rossum <guido@python.org>
* gh-91323: Revert "Allow overriding a future compliance check in asyncio.Task ↵Łukasz Langa2022-08-041-5/+1
| | | | | | (GH-32197)" (GH-95442) This reverts commit d4bb38f82bf18b00db3129031ce4969b6f0caab9.
* GH-95097: fix `asyncio.run` for tasks without `uncancel` method (#95211)Kumar Aditya2022-07-281-4/+5
| | | | Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* gh-95051: ensure that timeouts scheduled with `asyncio.Timeout` that have ↵Thomas Grainger2022-07-241-4/+4
| | | | | | already expired are deliverered promptly (#95109) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-45924: Fix asyncio incorrect traceback when future's exception is raised ↵Kumar Aditya2022-07-111-1/+2
| | | | multiple times (GH-30274)
* GH-93896: AAlways set event loop in asyncio.run and IsolatedAsyncioTestCase ↵Kumar Aditya2022-07-061-0/+6
| | | | (#94593)
* GH-94398: TaskGroup: Fail create_task() during shutdown (GH-94400)Guido van Rossum2022-06-301-0/+2
| | | | | | | Once the task group is shutting down, it should not be possible to create a new task. Here "shutting down" means `self._aborting` is set, indicating that at least one task has failed and we have cancelled all others. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-84623: Remove unused imports in stdlib (#93773)Victor Stinner2022-06-135-5/+0
|
* gh-93297: Make asyncio task groups prevent child tasks from being GCed (#93299)Yury Selivanov2022-05-271-13/+6
|
* gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)Oleg Iarygin2022-05-171-1/+1
|
* gh-91880 - fix typo (GH-92069)David Hewitt2022-04-291-1/+1
| | | | | https://github.com/python/cpython/issues/91880#issuecomment-1113914241 - With thanks to @MojoVampire for spotting this. Automerge-Triggered-By: GH:gvanrossum
* Fix missing `f` prefix on f-strings (GH-91910)Alexander Shadchin2022-04-271-1/+1
|
* gh-91880: add try/except around `signal.signal` (#91881)David Hewitt2022-04-251-1/+7
| | | | Fixes gh-91880.
* gh-91487: Optimize asyncio UDP speed (GH-91488)msoxzw2022-04-152-2/+9
| | | | | | | Fix #91487 When transferring a small file, e.g. 256 KiB, the speed of this PR is comparable. However, if a large file, e.g. 65536 KiB, is transferred, asyncio UDP will be over 100 times faster than the original. The speed is presumably significantly faster if a larger file is transferred, e.g. 1048576 KiB. Automerge-Triggered-By: GH:gpshead
* gh-79156: Add start_tls() method to streams API (#91453)Oleg Iarygin2022-04-151-0/+21
| | | | | | | | | | | | | The existing event loop `start_tls()` method is not sufficient for connections using the streams API. The existing StreamReader works because the new transport passes received data to the original protocol. The StreamWriter must then write data to the new transport, and the StreamReaderProtocol must be updated to close the new transport correctly. The new StreamWriter `start_tls()` updates itself and the reader protocol to the new SSL transport. Co-authored-by: Ian Good <icgood@gmail.com>
* bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)Andrew Svetlov2022-04-011-1/+5
|
* bpo-39622: Interrupt the main asyncio task on Ctrl+C (GH-32105)Andrew Svetlov2022-03-301-1/+36
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131)Vincent Bernat2022-03-291-1/+2
| | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-47062: Rename factory argument to loop_factory (GH-32113)Andrew Svetlov2022-03-261-5/+5
|
* bpo-43352: Add a Barrier object in asyncio lib (GH-24903)Duprat2022-03-262-3/+161
| | | | Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-47062: Implement asyncio.Runner context manager (GH-31799)Andrew Svetlov2022-03-241-18/+106
| | | Co-authored-by: Zachary Ware <zach@python.org>
* bpo-46829: Deprecate passing a message into Future.cancel() and ↵Andrew Svetlov2022-03-232-0/+11
| | | | | Task.cancel() (GH-31840) After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.
* bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910)Andrew Svetlov2022-03-221-6/+10
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964)Andrew Svetlov2022-03-171-10/+4
| | | Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-47039: Normalize repr() of asyncio future and task objects (GH-31950)Andrew Svetlov2022-03-174-27/+19
|
* bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)Maximilian Hils2022-03-151-1/+1
|
* Drop accidentally added whitespaces in asyncio internals (GH-31900)Andrew Svetlov2022-03-151-1/+1
|
* bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API ↵Andrew Svetlov2022-03-144-10/+26
| | | | (GH-31837)
* bpo-46805: Add low level UDP socket functions to asyncio (GH-31455)Alex Grönholm2022-03-134-0/+165
|
* bpo-46995: Deprecate missing asyncio.Task.set_name() for third-party task ↵Andrew Svetlov2022-03-131-1/+4
| | | | | implementations (GH-31838) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>