Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-107801: Improve the docs of the SEEK_* constants #108099

Merged
merged 3 commits into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@

.. note::

On some platforms, including FreeBSD and macOS, setting ``environ`` may

Check warning on line 216 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: putenv
cause memory leaks. Refer to the system documentation for
:c:func:`putenv`.

You can delete items in this mapping to unset environment variables.

Check warning on line 220 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: pop

Check warning on line 220 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: clear
:func:`unsetenv` will be called automatically when an item is deleted from
:data:`os.environ`, and when one of the :meth:`pop` or :meth:`clear` methods is
called.
Expand Down Expand Up @@ -399,7 +399,7 @@

.. note::

On macOS, :func:`getgroups` behavior differs somewhat from

Check warning on line 402 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: MACOSX_DEPLOYMENT_TARGET
other Unix platforms. If the Python interpreter was built with a
deployment target of ``10.5`` or earlier, :func:`getgroups` returns
the list of effective group ids associated with the current user process;
Expand Down Expand Up @@ -563,7 +563,7 @@

.. note::

On some platforms, including FreeBSD and macOS, setting ``environ`` may

Check warning on line 566 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: putenv
cause memory leaks. Refer to the system documentation for :c:func:`putenv`.

.. audit-event:: os.putenv key,value os.putenv
Expand Down Expand Up @@ -646,7 +646,7 @@

.. function:: setpgrp()

Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on

Check warning on line 649 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: setpgrp
which version is implemented (if any). See the Unix manual for the semantics.

.. availability:: Unix, not Emscripten, not WASI.
Expand All @@ -654,7 +654,7 @@

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

Call the system call :c:func:`setpgid` to set the process group id of the

Check warning on line 657 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: setpgid
process with id *pid* to the process group with id *pgrp*. See the Unix manual
for the semantics.

Expand Down Expand Up @@ -768,9 +768,9 @@
Returns information identifying the current operating system.
The return value is an object with five attributes:

* :attr:`sysname` - operating system name

Check warning on line 771 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: sysname
* :attr:`nodename` - name of machine on network (implementation-defined)

Check warning on line 772 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: nodename
* :attr:`release` - operating system release

Check warning on line 773 in Doc/library/os.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: release
* :attr:`version` - operating system version
* :attr:`machine` - hardware identifier

Expand Down Expand Up @@ -1180,16 +1180,26 @@
SEEK_CUR
SEEK_END

Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
respectively.
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
method on :term:`file-like objects <file object>`,
for whence to adjust the file position indicator.

:const:`SEEK_SET`
Adjust the file position relative to the beginning of the file.
:const:`SEEK_CUR`
Adjust the file position relative to the current file position.
:const:`SEEK_END`
Adjust the file position relative to the end of the file.

Their values are 0, 1, and 2, respectively.
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved


.. data:: SEEK_HOLE
SEEK_DATA

Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
method on file objects, for seeking file data and holes on sparsely
allocated files.
method on :term:`file-like objects <file object>`,
for seeking file data and holes on sparsely allocated files.

:data:`!SEEK_DATA`
Adjust the file offset to the next location containing data,
Expand Down
Loading