[Python-checkins] bpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)

Miss Islington (bot) webhook-mailer at python.org
Fri Nov 15 11:56:13 EST 2019


https://github.com/python/cpython/commit/b22030073b9327a3aeccb69507694bce078192aa
commit: b22030073b9327a3aeccb69507694bce078192aa
branch: master
author: Phil Connell <pconnell at gmail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-11-15T08:56:03-08:00
summary:

bpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)



Small docs update for [bpo-34651](https://bugs.python.org/issue34651).

Other references to fork (e.g. the PyOS.*Fork functions or discussions of fork() when embedding Python) point back to os.fork, so I don't think any other updates are needed.





https://bugs.python.org/issue38778



Automerge-Triggered-By: @ericsnowcurrently

files:
A Misc/NEWS.d/next/Documentation/2019-11-12-15-31-09.bpo-38778.PHhTlv.rst
M Doc/library/os.rst

diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 652d8de4e384f..4fec647828e25 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -3478,7 +3478,11 @@ 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
+      (:exc:`RuntimeError` is raised).
 
    .. warning::
 
@@ -3495,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.
 
 
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 0000000000000..053e1d294b70f
--- /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 :exc:`RuntimeError` is raised if :meth:`os.fork` is called in a subinterpreter.



More information about the Python-checkins mailing list