Skip to content

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

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

Dreamsorcerer merged 1 commit into
3.15from
patchback/backports/3.15/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 correction appears safe to merge.

The updated signature matches both stream-reader implementations and resolves the previous contradiction with the parameter description; no blocking or non-blocking issue remains.

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.25%. Comparing base (9e0b53c) to head (269efb7).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.15   #13528   +/-   ##
=======================================
  Coverage   96.25%   96.25%           
=======================================
  Files         161      161           
  Lines       51411    51411           
  Branches     2798     2798           
=======================================
+ Hits        49486    49487    +1     
  Misses       1748     1748           
+ Partials      177      176    -1     
Flag Coverage Δ
CI-GHA 96.22% <ø> (+<0.01%) ⬆️
OS-Linux 96.00% <ø> (+<0.01%) ⬆️
OS-Windows 93.71% <ø> (ø)
OS-macOS 95.18% <ø> (+<0.01%) ⬆️
Py-3.10 95.35% <ø> (ø)
Py-3.11 95.61% <ø> (-0.01%) ⬇️
Py-3.12 95.69% <ø> (ø)
Py-3.13 95.68% <ø> (ø)
Py-3.14 95.77% <ø> (ø)
Py-3.14t 94.79% <ø> (ø)
Py-pypy-3.11 94.65% <ø> (+<0.01%) ⬆️
VM-macos 95.18% <ø> (+<0.01%) ⬆️
VM-ubuntu 96.00% <ø> (+<0.01%) ⬆️
VM-windows 93.71% <ø> (ø)
cython-coverage 78.91% <ø> (-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 degrade performance by 10.62%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 (👁 1) regressed benchmark
✅ 89 untouched benchmarks
⏩ 86 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
👁 test_read_base64_part[pyloop] 15.2 ms 17 ms -10.62%

Comparing patchback/backports/3.15/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295 (269efb7) with 3.15 (9e0b53c)

Open in CodSpeed

Footnotes

  1. 86 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 552ad35 into 3.15 Aug 24, 2026
49 checks passed
@Dreamsorcerer
Dreamsorcerer deleted the patchback/backports/3.15/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295 branch August 24, 2026 01:13
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