From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 23 Nov 2025 10:17:20 +0000 (+0100) Subject: [3.14] gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59ab1edb0046addf7ff621cc293d2b19bf275cf5;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871) (#141872) gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871) Revert (unneeded, already done elsewhere) "gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849)" This reverts commit 58badb1711e12b6e8b5240ab96cdd01b95012de7. (cherry picked from commit 614a28b3da1c898f29c34c14f59bf2d496dbd31d) Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com> --- diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py index 8a4e8d835b0c..cc8947c5e04f 100644 --- a/Lib/multiprocessing/forkserver.py +++ b/Lib/multiprocessing/forkserver.py @@ -326,7 +326,6 @@ def main(listener_fd, alive_r, preload, main_path=None, sys_path=None, len(fds))) child_r, child_w, *fds = fds s.close() - util._flush_std_streams() pid = os.fork() if pid == 0: # Child diff --git a/Misc/NEWS.d/next/Library/2025-11-22-18-00-38.gh-issue-98552.d5KNy-.rst b/Misc/NEWS.d/next/Library/2025-11-22-18-00-38.gh-issue-98552.d5KNy-.rst deleted file mode 100644 index 37a71ac1fff3..000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-22-18-00-38.gh-issue-98552.d5KNy-.rst +++ /dev/null @@ -1,4 +0,0 @@ -The :mod:`multiprocessing` forkserver process now flushes stdout and stderr -before it forks to avoid the confusion children inheriting any buffered but -not yet written output data. Normally there is none, but when using -:func:`multiprocessing.set_forkserver_preload` there *could* be.