Skip to content

making content_length really optinal as intended #11325

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

realgam3
Copy link

What do these changes do?

Fix issue made on version 3.12.0
Where content_length argument in function write_bytes supposed to be optional but it's not because it's a positional argument and not keyword argument.

@realgam3 realgam3 requested a review from asvetlov as a code owner July 20, 2025 10:45
Copy link

codecov bot commented Jul 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (ebf65d9) to head (e577aaa).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11325   +/-   ##
=======================================
  Coverage   98.76%   98.76%           
=======================================
  Files         129      129           
  Lines       43374    43374           
  Branches     2323     2323           
=======================================
  Hits        42837    42837           
  Misses        383      383           
  Partials      154      154           
Flag Coverage Δ
CI-GHA 98.64% <ø> (ø)
OS-Linux 98.38% <ø> (ø)
OS-Windows 96.79% <ø> (-0.02%) ⬇️
OS-macOS 97.68% <ø> (ø)
Py-3.10.11 97.32% <ø> (-0.02%) ⬇️
Py-3.10.18 97.72% <ø> (-0.01%) ⬇️
Py-3.11.13 97.92% <ø> (ø)
Py-3.11.9 97.52% <ø> (ø)
Py-3.12.10 97.62% <ø> (-0.02%) ⬇️
Py-3.12.11 98.02% <ø> (ø)
Py-3.13.3 98.28% <ø> (ø)
Py-3.9.13 97.21% <ø> (ø)
Py-3.9.23 97.61% <ø> (-0.01%) ⬇️
Py-pypy7.3.16 87.36% <ø> (-4.70%) ⬇️
VM-macos 97.68% <ø> (ø)
VM-ubuntu 98.38% <ø> (ø)
VM-windows 96.79% <ø> (-0.02%) ⬇️

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 Jul 20, 2025

CodSpeed Performance Report

Merging #11325 will not alter performance

Comparing realgam3:fix-client_reqrep (e577aaa) with master (ebf65d9)

Summary

✅ 59 untouched benchmarks

@Dreamsorcerer
Copy link
Member

supposed to be optional

I'm not convinced this is correct. Is there a use case where you are calling this function in your code? I was under the impression that users would not access this method..

@realgam3
Copy link
Author

supposed to be optional

I'm not convinced this is correct. Is there a use case where you are calling this function in your code? I was under the impression that users would not access this method..

I'm using it with my library:
https://github.com/realgam3/aiohttp-raw

@Dreamsorcerer
Copy link
Member

Ah, subclasses, always forget about those..

My thinking is that it is beneficial to be a required parameter to ensure that people don't miss it. However, I guess it's also a breaking change to 3.x, so we should probably make it optional in the 3.12 branch atleast. For your project, you'll want to force the None at all times, otherwise it's likely to break your functionality.

@bdraco Does that make sense?

Also, interesting project, might be useful for some of our own testing when it comes to parsing issues, HTTP request forgery and such.

@bdraco bdraco added backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot labels Jul 20, 2025
@bdraco
Copy link
Member

bdraco commented Jul 20, 2025

@bdraco Does that make sense?

Yes. Seems fine to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants