Skip to content

Commit 49abeb5

Browse files
miss-islingtonerlend-aaslandAA-Turner
authored
[3.11] Docs: Remove links to external C functions and macros in os.rst (GH-108138) (#108144)
(cherry picked from commit c31c61c) Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent e0ca342 commit 49abeb5

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

Doc/library/os.rst

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ process and user.
215215

216216
On some platforms, including FreeBSD and macOS, setting ``environ`` may
217217
cause memory leaks. Refer to the system documentation for
218-
:c:func:`putenv`.
218+
:c:func:`!putenv`.
219219

220220
You can delete items in this mapping to unset environment variables.
221221
:func:`unsetenv` will be called automatically when an item is deleted from
@@ -553,7 +553,7 @@ process and user.
553553
.. note::
554554

555555
On some platforms, including FreeBSD and macOS, setting ``environ`` may
556-
cause memory leaks. Refer to the system documentation for :c:func:`putenv`.
556+
cause memory leaks. Refer to the system documentation for :c:func:`!putenv`.
557557

558558
.. audit-event:: os.putenv key,value os.putenv
559559

@@ -597,15 +597,15 @@ process and user.
597597

598598
.. function:: setpgrp()
599599

600-
Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on
600+
Call the system call :c:func:`!setpgrp` or ``setpgrp(0, 0)`` depending on
601601
which version is implemented (if any). See the Unix manual for the semantics.
602602

603603
.. availability:: Unix, not Emscripten, not WASI.
604604

605605

606606
.. function:: setpgid(pid, pgrp, /)
607607

608-
Call the system call :c:func:`setpgid` to set the process group id of the
608+
Call the system call :c:func:`!setpgid` to set the process group id of the
609609
process with id *pid* to the process group with id *pgrp*. See the Unix manual
610610
for the semantics.
611611

@@ -971,7 +971,7 @@ as internal buffering of data.
971971
.. function:: fsync(fd)
972972

973973
Force write of file with filedescriptor *fd* to disk. On Unix, this calls the
974-
native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` function.
974+
native :c:func:`!fsync` function; on Windows, the MS :c:func:`!_commit` function.
975975

976976
If you're starting with a buffered Python :term:`file object` *f*, first do
977977
``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal
@@ -2127,7 +2127,7 @@ features:
21272127

21282128
.. function:: lstat(path, *, dir_fd=None)
21292129

2130-
Perform the equivalent of an :c:func:`lstat` system call on the given path.
2130+
Perform the equivalent of an :c:func:`!lstat` system call on the given path.
21312131
Similar to :func:`~os.stat`, but does not follow symbolic links. Return a
21322132
:class:`stat_result` object.
21332133

@@ -2936,14 +2936,16 @@ features:
29362936

29372937
Windows file attributes: ``dwFileAttributes`` member of the
29382938
``BY_HANDLE_FILE_INFORMATION`` structure returned by
2939-
:c:func:`GetFileInformationByHandle`. See the ``FILE_ATTRIBUTE_*``
2939+
:c:func:`!GetFileInformationByHandle`.
2940+
See the :const:`!FILE_ATTRIBUTE_* <stat.FILE_ATTRIBUTE_ARCHIVE>`
29402941
constants in the :mod:`stat` module.
29412942

29422943
.. attribute:: st_reparse_tag
29432944

2944-
When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT``
2945+
When :attr:`st_file_attributes` has the :const:`~stat.FILE_ATTRIBUTE_REPARSE_POINT`
29452946
set, this field contains the tag identifying the type of reparse point.
2946-
See the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module.
2947+
See the :const:`IO_REPARSE_TAG_* <stat.IO_REPARSE_TAG_SYMLINK>`
2948+
constants in the :mod:`stat` module.
29472949

29482950
The standard module :mod:`stat` defines functions and constants that are
29492951
useful for extracting information from a :c:struct:`stat` structure. (On
@@ -2982,7 +2984,7 @@ features:
29822984

29832985
.. function:: statvfs(path)
29842986

2985-
Perform a :c:func:`statvfs` system call on the given path. The return value is
2987+
Perform a :c:func:`!statvfs` system call on the given path. The return value is
29862988
an object whose attributes describe the filesystem on the given path, and
29872989
correspond to the members of the :c:struct:`statvfs` structure, namely:
29882990
:attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`,
@@ -4063,7 +4065,7 @@ written in Python, such as a mail server's external command delivery program.
40634065
setpgroup=None, resetids=False, setsid=False, setsigmask=(), \
40644066
setsigdef=(), scheduler=None)
40654067

4066-
Wraps the :c:func:`posix_spawn` C library API for use from Python.
4068+
Wraps the :c:func:`!posix_spawn` C library API for use from Python.
40674069

40684070
Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`.
40694071

@@ -4099,44 +4101,44 @@ written in Python, such as a mail server's external command delivery program.
40994101
Performs ``os.dup2(fd, new_fd)``.
41004102

41014103
These tuples correspond to the C library
4102-
:c:func:`posix_spawn_file_actions_addopen`,
4103-
:c:func:`posix_spawn_file_actions_addclose`, and
4104-
:c:func:`posix_spawn_file_actions_adddup2` API calls used to prepare
4105-
for the :c:func:`posix_spawn` call itself.
4104+
:c:func:`!posix_spawn_file_actions_addopen`,
4105+
:c:func:`!posix_spawn_file_actions_addclose`, and
4106+
:c:func:`!posix_spawn_file_actions_adddup2` API calls used to prepare
4107+
for the :c:func:`!posix_spawn` call itself.
41064108

41074109
The *setpgroup* argument will set the process group of the child to the value
41084110
specified. If the value specified is 0, the child's process group ID will be
41094111
made the same as its process ID. If the value of *setpgroup* is not set, the
41104112
child will inherit the parent's process group ID. This argument corresponds
4111-
to the C library :c:macro:`POSIX_SPAWN_SETPGROUP` flag.
4113+
to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag.
41124114

41134115
If the *resetids* argument is ``True`` it will reset the effective UID and
41144116
GID of the child to the real UID and GID of the parent process. If the
41154117
argument is ``False``, then the child retains the effective UID and GID of
41164118
the parent. In either case, if the set-user-ID and set-group-ID permission
41174119
bits are enabled on the executable file, their effect will override the
41184120
setting of the effective UID and GID. This argument corresponds to the C
4119-
library :c:macro:`POSIX_SPAWN_RESETIDS` flag.
4121+
library :c:macro:`!POSIX_SPAWN_RESETIDS` flag.
41204122

41214123
If the *setsid* argument is ``True``, it will create a new session ID
4122-
for ``posix_spawn``. *setsid* requires :c:macro:`POSIX_SPAWN_SETSID`
4123-
or :c:macro:`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError`
4124+
for ``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID`
4125+
or :c:macro:`!POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError`
41244126
is raised.
41254127

41264128
The *setsigmask* argument will set the signal mask to the signal set
41274129
specified. If the parameter is not used, then the child inherits the
41284130
parent's signal mask. This argument corresponds to the C library
4129-
:c:macro:`POSIX_SPAWN_SETSIGMASK` flag.
4131+
:c:macro:`!POSIX_SPAWN_SETSIGMASK` flag.
41304132

41314133
The *sigdef* argument will reset the disposition of all signals in the set
41324134
specified. This argument corresponds to the C library
4133-
:c:macro:`POSIX_SPAWN_SETSIGDEF` flag.
4135+
:c:macro:`!POSIX_SPAWN_SETSIGDEF` flag.
41344136

41354137
The *scheduler* argument must be a tuple containing the (optional) scheduler
41364138
policy and an instance of :class:`sched_param` with the scheduler parameters.
41374139
A value of ``None`` in the place of the scheduler policy indicates that is
41384140
not being provided. This argument is a combination of the C library
4139-
:c:macro:`POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:`POSIX_SPAWN_SETSCHEDULER`
4141+
:c:macro:`!POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:`!POSIX_SPAWN_SETSCHEDULER`
41404142
flags.
41414143

41424144
.. audit-event:: os.posix_spawn path,argv,env os.posix_spawn
@@ -4149,7 +4151,7 @@ written in Python, such as a mail server's external command delivery program.
41494151
setpgroup=None, resetids=False, setsid=False, setsigmask=(), \
41504152
setsigdef=(), scheduler=None)
41514153

4152-
Wraps the :c:func:`posix_spawnp` C library API for use from Python.
4154+
Wraps the :c:func:`!posix_spawnp` C library API for use from Python.
41534155

41544156
Similar to :func:`posix_spawn` except that the system searches
41554157
for the *executable* file in the list of directories specified by the
@@ -4330,7 +4332,7 @@ written in Python, such as a mail server's external command delivery program.
43304332

43314333
Use *show_cmd* to override the default window style. Whether this has any
43324334
effect will depend on the application being launched. Values are integers as
4333-
supported by the Win32 :c:func:`ShellExecute` function.
4335+
supported by the Win32 :c:func:`!ShellExecute` function.
43344336

43354337
:func:`startfile` returns as soon as the associated application is launched.
43364338
There is no option to wait for the application to close, and no way to retrieve
@@ -4340,7 +4342,7 @@ written in Python, such as a mail server's external command delivery program.
43404342
:func:`os.path.normpath` function to ensure that paths are properly encoded for
43414343
Win32.
43424344

4343-
To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute`
4345+
To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute`
43444346
function is not resolved until this function is first called. If the function
43454347
cannot be resolved, :exc:`NotImplementedError` will be raised.
43464348

0 commit comments

Comments
 (0)