Skip to content

Conversation

cmaloney
Copy link
Contributor

@cmaloney cmaloney commented Oct 5, 2025

Resolves 7 warnings.

Generally: "file object" -> IOBase; "binary"/byte read/write -> BufferedIOBase, "text"/str read/write -> TextIOBase

My reasoning for specific cases (happy to change):

  • EOFError is for input builtin function which reads a str, so TextIOBase
  • os.read and os.write speak bytes but the sentence is about sys.stdin and sys.stdout which are TextIOBase; use the function that gets called by sys.stdout.write (TextIOBase.write).
  • os.exec: flush is talking about files generally, so IOBase
  • email.parser is talking about binary files / bytes so BufferedIOBase

📚 Documentation preview 📚: https://cpython-previews--139592.org.readthedocs.build/

Resolves 7 warnings.

Generally: "file object" -> IOBase; "binary"/`byte` read/write -> BufferedIOBase, "text"/`str` read/write -> TextIOBase

Specific cases:

 - `EOFError` is for `input` builtin function which reads a `str`, so `TextIOBase`
 - `os.read` and `os.write` speak bytes but the sentence is about `sys.stdin` and `sys.stdout` which are `TextIOBase`; use the function that gets called by `sys.stdout.write`.
 - `os.exec`: `flush` is talking about files generally, so `IOBase`
 - `email.parser` is talking about binary files / `bytes` so `BufferedIOBase`
@cmaloney cmaloney requested a review from a team as a code owner October 5, 2025 07:38
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Oct 5, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Oct 5, 2025
@cmaloney cmaloney changed the title gh-101100: Fix sphinx warnings around I/O gh-101100: Fix sphinx reference warnings around I/O Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant