Document the real readuntil() signature by hxperl · Pull Request #13686 · aio-libs/aiohttp · GitHub
Skip to content

Document the real readuntil() signature - #13686

Merged
Dreamsorcerer merged 2 commits into
aio-libs:masterfrom
hxperl:docs-readuntil-signature
Sep 24, 2026
Merged

Dreamsorcerer merged 2 commits into
aio-libs:masterfrom
hxperl:docs-readuntil-signature

Conversation

@hxperl

@hxperl hxperl commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

What do these changes do?

docs/streams.rst documents StreamReader.readuntil as taking a str separator:

.. method:: StreamReader.readuntil(separator="\n")

The implementation takes bytes (aiohttp/streams.py:381), so the documented call raises TypeError. The prose directly under the directive already says "where separator is a sequence of bytes", so the signature line contradicts the sentence below it as well as the code. max_size is keyword-only and appears nowhere in docs/.

Are there changes in behavior for the user?

No. Documentation only — the rendered signature becomes readuntil(separator=b'\n', *, max_size=None).

Is it a substantial burden for the maintainers to support this?

No. One directive line plus one :param: in a single .rst.

Related issue number

None filed; found by comparing documented signatures against real ones.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Added to CONTRIBUTORS.txt
  • Added a news fragment in CHANGES/

Verified on macOS arm64, Python 3.14, pure-Python mode: tests/test_streams.py 136 passed, and the docs build renders the corrected signature. I did not run the full suite or build the Cython extensions, which this does not touch.

Drafted with Claude Opus 5; reviewed by hxperl.

The documented signature passes a str separator, but StreamReader.readuntil
takes bytes, so the documented call raises TypeError. It also omits the
keyword-only max_size argument entirely.
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Sep 11, 2026
@hxperl
hxperl force-pushed the docs-readuntil-signature branch from 2da49c8 to 6e619ad Compare September 11, 2026 03:55
@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

@codspeed

codspeed Bot commented Sep 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 97 untouched benchmarks
⏩ 83 skipped benchmarks1


Comparing hxperl:docs-readuntil-signature (6e619ad) with master (9e08ba0)2

Open in CodSpeed

Footnotes

  1. 83 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on master (5da6d53) during the generation of this report, so 9e08ba0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@hxperl
hxperl marked this pull request as ready for review September 15, 2026 00:38
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge: the documentation matches the implemented readuntil() interface and behavior.

No actionable issues were found. Focused runtime checks covered the default separator, keyword-only argument enforcement, explicit size limits, and high-water fallback; the relevant existing tests also passed.

Files Needing Attention: No files need further changes.

T-Rex T-Rex Logs

What T-Rex did

  • Authored the executable doc-readuntil-contract-check.py to perform the read-until contract validation.
  • Ran the contract-check and captured the focused runtime results in readuntil-contract-02-after.log, noting the default separator output, TypeError on positional max_size, LineTooLong on explicit max_size, and LineTooLong on max_size=None with high-water 8, with an exit code of 0.
  • Validated the documentation rendering by inspecting streams-rst-render-02-after.log and confirmed Sphinx rendered successfully aside from a single missing-dot warning.
  • Created artifact references for the executable, runtime logs, and docs render to enable reviewer inspection.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "Add changelog fragment" | Re-trigger Greptile

@Dreamsorcerer Dreamsorcerer added backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot backport-3.15 Trigger automatic backporting to the 3.15 release branch by Patchback robot labels Sep 24, 2026
@Dreamsorcerer
Dreamsorcerer merged commit 802216e into aio-libs:master Sep 24, 2026
55 of 56 checks passed
@patchback

patchback Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Backport to 3.15: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.15/802216ec739038f4b238f194c32e38ee89d7c170/pr-13686

Backported as #13806

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback

patchback Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Dreamsorcerer pushed a commit that referenced this pull request Sep 24, 2026
…nature (#13806)

**This is a backport of PR #13686 as merged into master
(802216e).**

Co-authored-by: geonseok <hxperl@gmail.com>
Dreamsorcerer pushed a commit that referenced this pull request Sep 24, 2026
…nature (#13807)

**This is a backport of PR #13686 as merged into master
(802216e).**

Co-authored-by: geonseok <hxperl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentscan:automated-account backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot backport-3.15 Trigger automatic backporting to the 3.15 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants