From 6a29db5914e5597a599151c684eaae021b3d9948 Mon Sep 17 00:00:00 2001 From: Phil Connell Date: Tue, 12 Nov 2019 14:38:21 +0000 Subject: [PATCH 1/6] bpo-38778: Document that os.fork is not allowed in subinterpreters --- Doc/library/os.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 48bd6b95a9b39ef..54c7f04e1c5a619 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3480,6 +3480,11 @@ written in Python, such as a mail server's external command delivery program. Note that some platforms including FreeBSD <= 6.3 and Cygwin have known issues when using fork() from a thread. + .. note:: + + Calling fork() in a subinterpreter is not supported (:exc:`RuntimeError` + is raised). + .. warning:: See :mod:`ssl` for applications that use the SSL module with fork(). From 6a1df36201715cba872ee548b6263e884ea682d0 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2019 15:31:10 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst diff --git a/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst b/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst new file mode 100644 index 000000000000000..3ff551ae12ae859 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst @@ -0,0 +1 @@ +Document the fact that `RuntimeError` is raised if `os.fork()` is called in a subinterpreter. \ No newline at end of file From 7f22c3520aea964f29f47ebb166623a72e53a5d6 Mon Sep 17 00:00:00 2001 From: Phil Connell Date: Wed, 13 Nov 2019 09:56:02 +0000 Subject: [PATCH 3/6] Update Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst Co-Authored-By: Brandt Bucher --- .../next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst b/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst index 3ff551ae12ae859..053e1d294b70f89 100644 --- a/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst +++ b/Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst @@ -1 +1 @@ -Document the fact that `RuntimeError` is raised if `os.fork()` is called in a subinterpreter. \ No newline at end of file +Document the fact that :exc:`RuntimeError` is raised if :meth:`os.fork` is called in a subinterpreter. From 7b7a63c93805f9860619c0c257ed0e000968b628 Mon Sep 17 00:00:00 2001 From: Phil Connell Date: Wed, 13 Nov 2019 09:58:37 +0000 Subject: [PATCH 4/6] bpo-38778: PR markups -- add a versionchanged note in the docs --- Doc/library/os.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 54c7f04e1c5a619..7f6fb717c479fab 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3480,10 +3480,9 @@ written in Python, such as a mail server's external command delivery program. Note that some platforms including FreeBSD <= 6.3 and Cygwin have known issues when using fork() from a thread. - .. note:: - - Calling fork() in a subinterpreter is not supported (:exc:`RuntimeError` - is raised). + .. versionchanged:: 3.8 + Calling fork() in a subinterpreter is no longer supported + (:exc:`RuntimeError` is raised). .. warning:: From 827295e4c8f29f6dfce85d9199d432a73dc2a3e9 Mon Sep 17 00:00:00 2001 From: Phil Connell Date: Wed, 13 Nov 2019 10:02:58 +0000 Subject: [PATCH 5/6] bpo-38778: PR markups -- minor formatting changes --- Doc/library/os.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 7f6fb717c479fab..b85c5414b356361 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3478,10 +3478,10 @@ written in Python, such as a mail server's external command delivery program. parent. If an error occurs :exc:`OSError` is raised. Note that some platforms including FreeBSD <= 6.3 and Cygwin have - known issues when using fork() from a thread. + known issues when using ``fork()`` from a thread. .. versionchanged:: 3.8 - Calling fork() in a subinterpreter is no longer supported + Calling ``fork()`` in a subinterpreter is no longer supported (:exc:`RuntimeError` is raised). .. warning:: From ea9b70c869dd660abb17210722ec8531ee5c0aab Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Fri, 15 Nov 2019 09:48:43 -0700 Subject: [PATCH 6/6] Add the same note for forkpty(). --- Doc/library/os.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index b85c5414b356361..bbae5827107123a 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3499,6 +3499,10 @@ written in Python, such as a mail server's external command delivery program. master end of the pseudo-terminal. For a more portable approach, use the :mod:`pty` module. If an error occurs :exc:`OSError` is raised. + .. versionchanged:: 3.8 + Calling ``forkpty()`` in a subinterpreter is no longer supported + (:exc:`RuntimeError` is raised). + .. availability:: some flavors of Unix.