Skip to content

[PR #13295/29303217 backport][3.14] Fix documented default for StreamReader.read_nowait - #13529

Merged
Dreamsorcerer merged 1 commit into
3.14from
patchback/backports/3.14/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295
Aug 24, 2026
Merged

Dreamsorcerer merged 1 commit into
3.14from
patchback/backports/3.14/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295

Conversation

@patchback

@patchback patchback Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

This is a backport of PR #13295 as merged into master (2930321).

What do these changes do?

Correct the documented signature of StreamReader.read_nowait in docs/streams.rst.

The reference documented it as read_nowait(n=None), but the real signature in aiohttp/streams.py is def read_nowait(self, n: int = -1). The code even carries a comment recording the change:

def read_nowait(self, n: int = -1) -> bytes:
    # default was changed to be consistent with .read(-1)

The documentation was never updated to follow. Notably the :param int n: description directly below the signature is already correct — it says "-1 for the whole internal buffer" — so the signature line was the only stale part, and it contradicted the prose sitting three lines under it.

One line changed. Documentation only, no code changes.

Are there changes in behavior for the user?

No. Nothing in the library changes. The reference now shows the default the method actually has, and no longer contradicts its own parameter description.

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

No. One-line documentation correction with no ongoing maintenance cost.

Related issue number

None — found while comparing documented parameter defaults against the real signatures.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist — N/A, documentation-only change
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES/ folder

Drafted with Claude Opus 5; reviewed by @LALITH0110.

@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The documentation-only PR appears safe to merge.

The updated signature matches the existing n=-1 implementation and whole-buffer behavior, while the changelog fragment follows repository conventions.

Reviews (1): Last reviewed commit: "Fix documented default for StreamReader...." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (4b8f195) to head (6aa3f6e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.14   #13529   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files         160      160           
  Lines       51080    51080           
  Branches     2761     2761           
=======================================
  Hits        49152    49152           
  Misses       1751     1751           
  Partials      177      177           
Flag Coverage Δ
CI-GHA 96.22% <ø> (-0.01%) ⬇️
OS-Linux 96.00% <ø> (ø)
OS-Windows 93.72% <ø> (-0.01%) ⬇️
OS-macOS 95.20% <ø> (-0.01%) ⬇️
Py-3.10 95.42% <ø> (+<0.01%) ⬆️
Py-3.11 95.66% <ø> (ø)
Py-3.12 95.73% <ø> (-0.01%) ⬇️
Py-3.13 95.72% <ø> (ø)
Py-3.14 95.82% <ø> (ø)
Py-3.14t 94.83% <ø> (+<0.01%) ⬆️
Py-pypy-3.11 94.68% <ø> (ø)
VM-macos 95.20% <ø> (-0.01%) ⬇️
VM-ubuntu 96.00% <ø> (ø)
VM-windows 93.72% <ø> (-0.01%) ⬇️
cython-coverage 79.02% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codspeed

codspeed Bot commented Aug 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 78 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing patchback/backports/3.14/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295 (6aa3f6e) with 3.14 (4b8f195)

Open in CodSpeed

Footnotes

  1. 7 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. ↩

@Dreamsorcerer
Dreamsorcerer merged commit 46cd835 into 3.14 Aug 24, 2026
48 checks passed
@Dreamsorcerer
Dreamsorcerer deleted the patchback/backports/3.14/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295 branch August 24, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants