Skip to content

Conversation

@mind1m
Copy link
Contributor

@mind1m mind1m commented Oct 3, 2023

What do these changes do?

Fixes an issue reported in 7616 - An iteration of the chunks of an EmptyStreamReader with iter_chunks() never ends.

Are there changes in behavior for the user?

  • EmptyStreamReader iter_chunks() does not get stuck
  • First call of EmptyStreamReader readchunk() now returns (b"", False). All the subsequent calls return (b"", True). Before this PR it was always (b"", True).

Related issue number

7616

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@mind1m mind1m requested a review from asvetlov as a code owner October 3, 2023 11:13
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 3, 2023
@mind1m mind1m requested a review from webknjaz as a code owner October 3, 2023 11:25
@mind1m
Copy link
Contributor Author

mind1m commented Oct 3, 2023

Looks like failing test test_https_proxy_unsupported_tls_in_tls fails on master too

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #7644 (f19a4f1) into master (dad48ad) will increase coverage by 0.00%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #7644   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files         106      106           
  Lines       31541    31550    +9     
  Branches     3593     3595    +2     
=======================================
+ Hits        30709    30718    +9     
  Misses        630      630           
  Partials      202      202           
Flag Coverage Δ
CI-GHA 97.28% <100.00%> (+<0.01%) ⬆️
OS-Linux 96.95% <100.00%> (+<0.01%) ⬆️
OS-Windows 95.40% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.60% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 95.33% <100.00%> (+<0.01%) ⬆️
Py-3.10.13 96.81% <100.00%> (+<0.01%) ⬆️
Py-3.11.5 96.51% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 95.30% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 96.74% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 95.29% <100.00%> (+<0.01%) ⬆️
Py-3.9.18 96.77% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.11 96.29% <100.00%> (+<0.01%) ⬆️
VM-macos 96.60% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 96.95% <100.00%> (+<0.01%) ⬆️
VM-windows 95.40% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
aiohttp/streams.py 97.96% <100.00%> (+0.01%) ⬆️
tests/test_streams.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Dreamsorcerer
Copy link
Member

I stripped the comments because I think the code is fairly clear, and the tests ensure someone won't mess it up in future.

@Dreamsorcerer Dreamsorcerer enabled auto-merge (squash) October 3, 2023 12:29
@Dreamsorcerer Dreamsorcerer merged commit 6639f7d into aio-libs:master Oct 3, 2023
@patchback
Copy link
Contributor

patchback bot commented Oct 3, 2023

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/6639f7df32bea3ee6952299173bdf90c95f9ee5f/pr-7644

Backported as #7645

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

patchback bot pushed a commit that referenced this pull request Oct 3, 2023
## What do these changes do?

Fixes an issue reported in
[7616](#7616) - An iteration
of the chunks of an EmptyStreamReader with iter_chunks() never ends.
## Are there changes in behavior for the user?

- `EmptyStreamReader` `iter_chunks()` does not get stuck
- First call of `EmptyStreamReader` `readchunk()` now returns `(b"",
False)`. All the subsequent calls return `(b"", True)`. Before this PR
it was always `(b"", True)`.

## Related issue number

[7616](#7616)

(cherry picked from commit 6639f7d)
Dreamsorcerer pushed a commit that referenced this pull request Oct 3, 2023
…chunks() never ends (#7645)

**This is a backport of PR #7644 as merged into master
(6639f7d).**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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