Skip to content

Commit a02b64c

Browse files
committed
gh-101100: Fix warnings is os around stat
Point to either the constants in `stat` or to `os.stat_result` as needed.
1 parent 20758f9 commit a02b64c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/library/os.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,10 +2606,10 @@ features:
26062606

26072607
Create a filesystem node (file, device special file or named pipe) named
26082608
*path*. *mode* specifies both the permissions to use and the type of node
2609-
to be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
2610-
``stat.S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants are
2611-
available in :mod:`stat`). For ``stat.S_IFCHR`` and ``stat.S_IFBLK``,
2612-
*device* defines the newly created device special file (probably using
2609+
to be created, being combined (bitwise OR) with one of :const:`stat.S_IFREG`,
2610+
:const:`stat.S_IFCHR`, :const:`stat.S_IFBLK`, and :const:`stat.S_IFIFO`.
2611+
For :const:`stat.S_IFCHR` and :const:`stat.S_IFBLK`, *device* defines the
2612+
newly created device special file (probably using
26132613
:func:`os.makedev`), otherwise it is ignored.
26142614

26152615
This function can also support :ref:`paths relative to directory descriptors
@@ -2627,13 +2627,13 @@ features:
26272627
.. function:: major(device, /)
26282628

26292629
Extract the device major number from a raw device number (usually the
2630-
:attr:`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`).
2630+
:attr:`stat_result.st_dev` or :attr:`stat_result.st_rdev`).
26312631

26322632

26332633
.. function:: minor(device, /)
26342634

26352635
Extract the device minor number from a raw device number (usually the
2636-
:attr:`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`).
2636+
:attr:`stat_result.st_dev` or :attr:`stat_result.st_rdev`).
26372637

26382638

26392639
.. function:: makedev(major, minor, /)
@@ -3364,8 +3364,8 @@ features:
33643364

33653365
.. versionchanged:: 3.8
33663366
On Windows, the :attr:`st_mode` member now identifies special
3367-
files as :const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK`
3368-
as appropriate.
3367+
files as :const:`~stat.S_IFCHR`, :const:`~stat.S_IFIFO` or
3368+
:const:`~stat.S_IFBLK` as appropriate.
33693369

33703370
.. versionchanged:: 3.12
33713371
On Windows, :attr:`st_ctime` is deprecated. Eventually, it will

0 commit comments

Comments
 (0)