summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorromasku <romasku135@gmail.com>2020-05-15 20:12:05 (GMT)
committerGitHub <noreply@github.com>2020-05-15 20:12:05 (GMT)
commit382a5635bd10c237c3e23e346b21cde27e48d7fa (patch)
treeaeafbddb7b6a726cb148345269719c79043354d7 /Misc
parentc087a268a4d4ead8ef2ca21e325423818729da89 (diff)
downloadcpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.zip
cpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.tar.gz
cpython-382a5635bd10c237c3e23e346b21cde27e48d7fa.tar.bz2
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (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>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-13-15-32-13.bpo-40607.uSPFCi.rst3
2 files changed, 4 insertions, 0 deletions
diff --git a/Misc/ACKS b/Misc/ACKS
index b479aa5..fad920b 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1593,6 +1593,7 @@ J. Sipprell
Ngalim Siregar
Kragen Sitaker
Kaartic Sivaraam
+Roman Skurikhin
Ville Skyttä
Michael Sloan
Nick Sloan
diff --git a/Misc/NEWS.d/next/Library/2020-05-13-15-32-13.bpo-40607.uSPFCi.rst b/Misc/NEWS.d/next/Library/2020-05-13-15-32-13.bpo-40607.uSPFCi.rst
new file mode 100644
index 0000000..8060628
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-05-13-15-32-13.bpo-40607.uSPFCi.rst
@@ -0,0 +1,3 @@
+When cancelling a task due to timeout, :meth:`asyncio.wait_for` will now
+propagate the exception if an error happens during cancellation.
+Patch by Roman Skurikhin.