Skip to content

Commit c968f33

Browse files
committed
fix review idea
Signed-off-by: Manjusaka <[email protected]>
1 parent 74b77d3 commit c968f33

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Doc/library/os.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4592,6 +4592,10 @@ written in Python, such as a mail server's external command delivery program.
45924592
master end of the pseudo-terminal. For a more portable approach, use the
45934593
:mod:`pty` module. If an error occurs :exc:`OSError` is raised.
45944594

4595+
The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`.
4596+
This means it will not be passed to child processes created by subsequent
4597+
:func:`fork` or :func:`exec*` calls.
4598+
45954599
.. audit-event:: os.forkpty "" os.forkpty
45964600

45974601
.. warning::
@@ -4608,6 +4612,9 @@ written in Python, such as a mail server's external command delivery program.
46084612
threads, this now raises a :exc:`DeprecationWarning`. See the
46094613
longer explanation on :func:`os.fork`.
46104614

4615+
.. versionchanged:: 3.15
4616+
The returned file descriptor is now made non-inheritable.
4617+
46114618
.. availability:: Unix, not WASI, not Android, not iOS.
46124619

46134620

Doc/library/pty.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ The :mod:`pty` module defines the following functions:
3333
file descriptor connected to the child's controlling terminal (and also to the
3434
child's standard input and output).
3535

36+
The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`.
37+
This means it will not be passed to child processes created by subsequent
38+
:func:`os.fork` or :func:`os.exec*` calls.
39+
3640
.. warning:: On macOS the use of this function is unsafe when mixed with using
3741
higher-level system APIs, and that includes using :mod:`urllib.request`.
3842

43+
.. versionchanged:: 3.15
44+
The returned file descriptor is now made non-inheritable.
45+
3946

4047
.. function:: openpty()
4148

Lib/test/test_pty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
raise unittest.SkipTest("pty is not available on this platform")
1313

1414
import errno
15-
import fcntl
1615
import os
1716
import pty
1817
import tty

0 commit comments

Comments
 (0)