diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-25 08:29:50 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-25 08:29:50 (GMT) |
commit | a6d865c128dd46a067358e94c29ca2d84205ae89 (patch) | |
tree | 5ab1f1d1a8c37f022fa3ca6a4041fdccd3b96200 /Doc/library/multiprocessing.rst | |
parent | 47b4557679154a645780b2e44dd7a4a2c62b5d12 (diff) | |
download | cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.zip cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.tar.gz cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.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/library/multiprocessing.rst')
-rw-r--r-- | Doc/library/multiprocessing.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index bf25f3f..6440f5c 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -2694,7 +2694,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 |