Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing CRLF at end of a chunk in malformed chunked encoding me… #10359

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

xdegaye
Copy link

@xdegaye xdegaye commented Jan 25, 2025

See issue #10355.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jan 25, 2025
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.77%. Comparing base (d3dc087) to head (a6d61fe).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10359   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         122      122           
  Lines       37038    37089   +51     
  Branches     2041     2045    +4     
=======================================
+ Hits        36585    36636   +51     
  Misses        314      314           
  Partials      139      139           
Flag Coverage Δ
CI-GHA 98.66% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.35% <100.00%> (+<0.01%) ⬆️
OS-Windows 96.26% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.46% <100.00%> (-0.01%) ⬇️
Py-3.10.11 97.35% <98.03%> (-0.01%) ⬇️
Py-3.10.16 97.92% <98.03%> (+<0.01%) ⬆️
Py-3.11.11 98.00% <98.03%> (-0.01%) ⬇️
Py-3.11.9 97.43% <98.03%> (-0.01%) ⬇️
Py-3.12.8 98.44% <98.03%> (-0.01%) ⬇️
Py-3.13.1 98.43% <98.03%> (-0.01%) ⬇️
Py-3.9.13 97.25% <100.00%> (+<0.01%) ⬆️
Py-3.9.21 97.80% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 97.39% <100.00%> (+<0.01%) ⬆️
VM-macos 97.46% <100.00%> (-0.01%) ⬇️
VM-ubuntu 98.35% <100.00%> (+<0.01%) ⬆️
VM-windows 96.26% <100.00%> (+<0.01%) ⬆️

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

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

Copy link

codspeed-hq bot commented Jan 25, 2025

CodSpeed Performance Report

Merging #10359 will not alter performance

Comparing xdegaye:issue-10355 (a6d61fe) with master (24913d7)

Summary

✅ 47 untouched benchmarks

@xdegaye
Copy link
Author

xdegaye commented Jan 26, 2025

It is not clear how to make the Labels / Backport label added check pass.

@Dreamsorcerer Dreamsorcerer added backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot labels Jan 26, 2025
@@ -1761,6 +1761,69 @@ async def test_parse_chunked_payload_split_end_trailers4(
assert out.is_eof()
assert b"asdf" == b"".join(out._buffer)

async def test_parse_chunked_payload_split_CRLF(
Copy link
Member

@Dreamsorcerer Dreamsorcerer Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a test that uses the response: HttpResponseParser fixture, rather than using HttpPayloadParser directly?
I think we'd want to ensure that both parsers work the same way, this only tests the Python parser (which is not used by most users).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is this second parser ?
Please bear with me, I have only been looking at aiohttp source code for few days.

The tests check the changes made in HttpPayloadParser, not in the second parser.

Copy link
Member

@Dreamsorcerer Dreamsorcerer Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you use the fixture as mentioned above, the test will be run against both parsers (i.e. run twice).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did not answer my question. Please, what is the name of the second parser ?

Why should changes that affect HttpPayloadParser be tested against the second parser ?

What if the tests against the second parser fail ?
In that case:

  • do you consider that these failures must be fixed within this PR ?
  • would'nt it be better to update the title of the PR and the issue to restrict their scope to HttpPayloadParser ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a Python parser and a C parser (llhttp). Both should behave the same way, hence why we have a fixture to run the same tests against both parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 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