summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-01-29 21:14:24 (GMT)
committerGregory P. Smith <greg@krypto.org>2019-01-29 21:14:24 (GMT)
commitbafa8487f77fa076de3a06755399daf81cb75598 (patch)
tree8c8ace269bfe20263047098a1e612930c2ca82a4 /Misc
parent742d768656512a469ce9571b1cbd777def7bc5ea (diff)
downloadcpython-bafa8487f77fa076de3a06755399daf81cb75598.zip
cpython-bafa8487f77fa076de3a06755399daf81cb75598.tar.gz
cpython-bafa8487f77fa076de3a06755399daf81cb75598.tar.bz2
subprocess: close pipes/fds by using ExitStack (GH-11686)
Close pipes/fds in subprocess by using ExitStack. "In case of premature failure on X.Close() or os.close(X) the remaining pipes/fds will remain "open". Perhaps it makes sense to use contextlib.ExitStack." - Rationale: https://github.com/python/cpython/pull/11575#discussion_r250288394
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2019-01-29-17-24-52.bpo-35537.Q0ktFC.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-01-29-17-24-52.bpo-35537.Q0ktFC.rst b/Misc/NEWS.d/next/Library/2019-01-29-17-24-52.bpo-35537.Q0ktFC.rst
new file mode 100644
index 0000000..2a9588e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-01-29-17-24-52.bpo-35537.Q0ktFC.rst
@@ -0,0 +1,4 @@
+An ExitStack is now used internally within subprocess.POpen to clean up pipe
+file handles. No behavior change in normal operation. But if closing one
+handle were ever to cause an exception, the others will now be closed
+instead of leaked. (patch by Giampaolo Rodola)