Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-102780: Fix uncancel() call in asyncio timeouts#102815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
9f96cea07517b71150db0d207fb1912f26dee574fcc91dae7902691e0f7bde507c40cc2a8914ea6f31146e299faFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -306,7 +306,10 @@ The asyncio components that enable structured concurrency, like | ||
| :class:`asyncio.TaskGroup` and :func:`asyncio.timeout`, | ||
gvanrossum marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| are implemented using cancellation internally and might misbehave if | ||
| a coroutine swallows :exc:`asyncio.CancelledError`. Similarly, user code | ||
| should not generally call :meth:`uncancel <asyncio.Task.uncancel>`. | ||
| However, in such cases when supprssing :exc:`asynci.CancelledError` is | ||
kristjanvalur marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| truly desired, it is necessary to also call :meth:`uncancel` to completely | ||
kristjanvalur marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| remove the cancellation state. | ||
| .. _taskgroups: | ||
| @@ -1148,7 +1151,9 @@ Task Object | ||
| Therefore, unlike :meth:`Future.cancel`, :meth:`Task.cancel` does | ||
| not guarantee that the Task will be cancelled, although | ||
| suppressing cancellation completely is not common and is actively | ||
| discouraged. Should the coroutine nevertheless decide to suppress | ||
| the cancellation, it needs to call :meth:`Task.uncancel` in addition | ||
| to catching the exception. | ||
| .. versionchanged:: 3.9 | ||
| Added the *msg* parameter. | ||
| @@ -1238,6 +1243,10 @@ Task Object | ||
| with :meth:`uncancel`. :class:`TaskGroup` context managers use | ||
| :func:`uncancel` in a similar fashion. | ||
| If end-user code is, for some reason, suppresing cancellation by | ||
| catching :exc:`CancelledError`, it needs to call this method to remove | ||
| the cancellation state. | ||
| .. method:: cancelling() | ||
| Return the number of pending cancellation requests to this Task, i.e., | ||