summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:29:50 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:29:50 (GMT)
commit8a208510104a0ac5a34240ae4329b881ffcee998 (patch)
tree02176fdace0dd6960e804a835ac4f3a93081c133 /Doc
parent540a81c720fa5886f3f43a479424873a28a91512 (diff)
downloadcpython-8a208510104a0ac5a34240ae4329b881ffcee998.zip
cpython-8a208510104a0ac5a34240ae4329b881ffcee998.tar.gz
cpython-8a208510104a0ac5a34240ae4329b881ffcee998.tar.bz2
Issue #25654:
* multiprocessing: open file with closefd=False to avoid ResourceWarning * _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a previous test forgot to remove TESTFN) * test_sys_exit(): remove TESTFN after each loop iteration Initial patch written by Serhiy Storchaka.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/multiprocessing.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 8209ae9..684a59f 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -2689,7 +2689,7 @@ Beware of replacing :data:`sys.stdin` with a "file like object"
in issues with processes-in-processes. This has been changed to::
sys.stdin.close()
- sys.stdin = open(os.devnull)
+ sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)
Which solves the fundamental issue of processes colliding with each other
resulting in a bad file descriptor error, but introduces a potential danger