Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5642ff9

Browse files
committed
Fixup reST syntax errors and streamline docs of PEP 446.
1 parent c76aa48 commit 5642ff9

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

Doc/library/os.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,41 +1206,40 @@ Querying the size of a terminal
12061206
Inheritance of File Descriptors
12071207
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12081208

1209-
A file descriptor has a inheritable flag which indicates if the file descriptor
1210-
can be inherited or not in child processes. Since Python 3.4, file descriptors
1209+
.. versionadded:: 3.4
1210+
1211+
A file descriptor has an "inheritable" flag which indicates if the file descriptor
1212+
can be inherited by child processes. Since Python 3.4, file descriptors
12111213
created by Python are non-inheritable by default.
12121214

12131215
On UNIX, non-inheritable file descriptors are closed in child processes at the
12141216
execution of a new program, other file descriptors are inherited.
12151217

12161218
On Windows, non-inheritable handles and file descriptors are closed in child
1217-
processes, except standard streams (file descriptors 0, 1 and 2: stdin, stdout
1218-
and stderr) which are always inherited. Using :func:`os.spawn*` functions,
1219+
processes, except for standard streams (file descriptors 0, 1 and 2: stdin, stdout
1220+
and stderr), which are always inherited. Using :func:`os.spawn*` functions,
12191221
all inheritable handles and all inheritable file descriptors are inherited.
12201222
Using the :mod:`subprocess` module, all file descriptors except standard
1221-
streams are closed, inheritable handles are only inherited if the *close_fds*
1222-
parameter is ``False``.
1223-
1224-
.. versionadded:: 3.4
1223+
streams are closed, and inheritable handles are only inherited if the
1224+
*close_fds* parameter is ``False``.
12251225

12261226
.. function:: get_inheritable(fd)
12271227

1228-
Get the `inheritable flag <fd_inheritance>`_ of the specified file
1229-
descriptor. Return a :class:`bool`.
1228+
Get the "inheritable" flag of the specified file descriptor (a boolean).
12301229

12311230
.. function:: set_inheritable(fd, inheritable)
12321231

1233-
Set the `inheritable flag <fd_inheritance>`_ of the specified file descriptor.
1232+
Set the "inheritable" flag of the specified file descriptor.
12341233

12351234
.. function:: get_handle_inheritable(handle)
12361235

1237-
Get the `inheritable flag <fd_inheritance>`_ of the specified handle. Return a :class:`bool`.
1236+
Get the "inheritable" flag of the specified handle (a boolean).
12381237

12391238
Availability: Windows.
12401239

12411240
.. function:: set_handle_inheritable(handle, inheritable)
12421241

1243-
Set the `inheritable flag <fd_inheritance>`_ of the specified handle.
1242+
Set the "inheritable" flag of the specified handle.
12441243

12451244
Availability: Windows.
12461245

Doc/whatsnew/3.4.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ Please read on for a comprehensive list of user-facing changes.
126126
PEP 446: Make newly created file descriptors non-inheritable
127127
============================================================
128128

129-
The :pep:`446` makes newly created file descriptors `non-inheritable
130-
<fd_inheritance>`_. New functions and methods:
129+
The :pep:`446` makes newly created file descriptors :ref:`non-inheritable
130+
<fd_inheritance>`. New functions and methods:
131131

132132
* :func:`os.get_inheritable`, :func:`os.set_inheritable`
133133
* :func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`
@@ -318,8 +318,8 @@ try/except statement by code that only cares whether or not an error occurred.
318318
socket
319319
------
320320

321-
Socket objects have new methods to get or set their `inheritable flag
322-
<fd_inheritance>`_:
321+
Socket objects have new methods to get or set their :ref:`inheritable flag
322+
<fd_inheritance>`:
323323

324324
* :meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`
325325

0 commit comments

Comments
 (0)