Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncancel tasks after timeout in python 3.11 #363

Merged
merged 10 commits into from
Aug 9, 2023

Conversation

tristan
Copy link
Contributor

@tristan tristan commented Jul 11, 2023

What do these changes do?

Python 3.11 introduced the concept of uncancelling a cancelled task.
From https://docs.python.org/3/library/asyncio-task.html#task-cancellation

user code should not generally call uncancel. However, in cases when suppressing asyncio.CancelledError is truly desired, it is necessary to also call uncancel() to completely remove the cancellation state.

This updates async-timeout to be compliant with python 3.11 when cancelling the tasks after a timeout

Are there changes in behavior for the user?

no

Related issue number

#362

Checklist

  • I think the code is well written
  • but happy to receive change suggestions!
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #363 (1cb6f25) into master (adf9e28) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #363   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          105       116   +11     
  Branches        18        19    +1     
=========================================
+ Hits           105       116   +11     
Flag Coverage Δ
unit 98.27% <94.11%> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
async_timeout/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Dreamsorcerer Dreamsorcerer merged commit 3cfabe2 into aio-libs:master Aug 9, 2023
21 checks passed
bdraco added a commit to aio-libs/aiohttp that referenced this pull request Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants