Skip to content

gh-101100: Fix os.statvfs and os.uname references#151301

Merged
serhiy-storchaka merged 12 commits into
python:mainfrom
cmaloney:fix_remaining_os_warnings
Jun 19, 2026
Merged

gh-101100: Fix os.statvfs and os.uname references#151301
serhiy-storchaka merged 12 commits into
python:mainfrom
cmaloney:fix_remaining_os_warnings

Conversation

@cmaloney

@cmaloney cmaloney commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Restructure descriptive paragraphs to class definitions copying across descriptions. Add constants from statvfs to os as data directives.

Expand the os.uname section slightly with a see also which matches the one at the beginning of os.rst added in gh-56535 commit a83cdaa.

This gets os.rst out of nitignore.


The statvfs_result members had no definition before and I opted not to add ones here. The C code in posixmodule.c just forwards them directly so I don't think a description would be more precise than what is in the man page.

Restructure descriptive paragraphs to class definitions copying across
descriptions. Add constants from statvfs to os as data directives.

Expand the `os.uname` section slightly with a see also which matches the
one at the beginning of os.rst added in pythongh-56535 (commit a83cdaa).

---
The statvfs_result members had no definition before and I opted not to
add ones ere. The C code in `posixmodule.c` just forwards them directly
so I don't think a description would be more precise than what is in the
man page.
@read-the-docs-community

read-the-docs-community Bot commented Jun 11, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33209797 | 📁 Comparing de6f122 against main (84630e2)

  🔍 Preview build  

48 files changed · ± 48 modified

± Modified

Comment thread Doc/library/os.rst Outdated
Comment on lines +803 to +804
The return value is a :class:`uname_result` object whose attributes
correspond to the members described in :manpage:`uname(2)`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The return value is a :class:`uname_result` object whose attributes
correspond to the members described in :manpage:`uname(2)`.
The return value is a :class:`uname_result` object.

I think the note should be with the attributes ("These attributes correspond to the ...").

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misinterpreted this my first read, moved the manpage reference to the uname_result section

Comment thread Doc/library/os.rst Outdated
cmaloney and others added 3 commits June 12, 2026 12:41
Comment thread Doc/library/os.rst Outdated

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general good, but I have other suggestions which you can implement here or leave to other PRs.

9 data classes are defined in the os module: DirEntry, sched_param, stat_result, statvfs_result, statx_result, terminal_size, times_result, uname_result, and waitid_result. 4 of them are not explicitly documented: stat_result, times_result, uname_result, and waitid_result.

Could you please document times_result and waitid_result too? Or you prefer to leave this to other PR?

Please check that all 9 classes use similar style (except that DirEntry and statx_result are not tuples).

And you can turn other mentions of uname_result (in NEWS entries) to references.

Comment thread Doc/library/os.rst

.. attribute:: f_flag

Bit-mask of mount flags. The following flags are defined:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just refer to them as ``ST_*`` flags?

@cmaloney cmaloney Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worry that would be confusing with the stat module ST_* constants (https://docs.python.org/3/library/stat.html#stat.ST_MODE)

Comment thread Doc/library/os.rst
Comment thread Doc/library/os.rst
Comment thread Doc/library/os.rst
@hugovk hugovk removed their request for review June 16, 2026 08:53
@cmaloney

Copy link
Copy Markdown
Contributor Author

Want to keep this focused on getting the reference issues fixed (the issue this PR links to). I added short descriptions to the statvfs_result members. I like the short sentence between class and item so added, other dataclasses + flags should get.

Created gh-151684 for the followups.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

But note that reference-cleanest is not a goal by itself. It can be a measure, but the goal is the documentation completeness and clarity. When it became a goal, it stops to be measure.

@serhiy-storchaka serhiy-storchaka merged commit 9688d25 into python:main Jun 19, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 19, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 19, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151690 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 19, 2026
@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151691 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 19, 2026
@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151692 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 19, 2026
serhiy-storchaka pushed a commit that referenced this pull request Jun 19, 2026
… related constants (GH-151301) (GH-151692)

(cherry picked from commit 9688d25)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
@vstinner

Copy link
Copy Markdown
Member

@serhiy-storchaka

Copy link
Copy Markdown
Member

Yes, I am going to restore the ignore files.

serhiy-storchaka pushed a commit that referenced this pull request Jun 19, 2026
… related constants (GH-151301) (GH-151691)

(cherry picked from commit 9688d25)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants