FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-129011: Update docs for Raw I/O read, readinto, and write by cmaloney · Pull Request #135328 · python/cpython · GitHub

Repository navigation

gh-129011: Update docs for Raw I/O read, readinto, and write - #135328

Merged
vstinner merged 4 commits into
python:mainfrom
cmaloney:rawio_retry_nonblock
Jun 5, 2026
Merged

vstinner merged 4 commits into
python:mainfrom
cmaloney:rawio_retry_nonblock

Conversation

cmaloney commented Jun 10, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

Update RawIOBase and FileIO documentation to match implementation behavior around .read, .readinto, .readall and .write.

see also: gh-80050 / GH-130653 (similar work on Buffered I/O read docs)


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

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: pythongh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 26, 2026
cmaloney removed the stale Stale PR or inactive for long period of time. label Apr 26, 2026

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. 👍

@vstinner, could you please look at this as the author of retry-on-interrupt logic?

serhiy-storchaka requested a review from vstinner June 2, 2026 17:08
serhiy-storchaka added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Jun 2, 2026

read-the-docs-community Bot commented Jun 2, 2026 •
edited
Loading

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32996868 | 📁 Comparing c0b547b against main (f7e0fb6)

  🔍 Preview build  

73 files changed · + 1 added · ± 72 modified

+ Added

± Modified

vstinner commented Jun 4, 2026

Copy link
Copy Markdown
Member

Tests / Docs / Docs (pull_request): Failing after 16s

A git command failed with fatal: shallow file has changed since we read it.

vstinner 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. I just have some minor formatting suggestions.

Sometimes, I wish that the io module has readall() and writeall() methods, similar to socket sendall() method.

Comment thread Doc/library/io.rst Outdated
Comment thread Doc/library/io.rst Outdated
Comment thread Doc/library/io.rst Outdated
Comment thread Doc/library/io.rst Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>

cmaloney commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

FileIO has a .readall() which is used several times in CPython so to duck type replace it with BufferedIO in my I/O plans need to add one calling through to .read(-1). Happy to do that as a small earlier feature add

 - Move to commas around nonessential phrase
 - Expand contraction
vstinner merged commit e4db68b into python:main Jun 5, 2026
30 checks passed

Copy link
Copy Markdown

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

github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 5, 2026

bedevere-app Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 5, 2026

bedevere-app Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

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

bedevere-app Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 5, 2026

vstinner commented Jun 5, 2026

Copy link
Copy Markdown
Member

Merged, thanks for the improved io doc.

vstinner added a commit that referenced this pull request Jun 5, 2026
…H-135328) (#150959)

gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Jun 5, 2026
…H-135328) (#150958)

gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Jun 5, 2026
…H-135328) (#150957)

gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
cmaloney deleted the rawio_retry_nonblock branch June 5, 2026 18:09
philthompson10 pushed a commit to philthompson10/cpython that referenced this pull request Jun 17, 2026
…ython#135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: pythongh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL