-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Remove unused readall from Python parser #8096
Conversation
Huh, seems we have a parameter which only exists on the Python parser... |
I think I saw a few other underscored tests somewhere around the proxy testing modules, IIRC. I don't think I ever got to re-enabling them.. |
I think we should be backporting the test-only changes all the way to the oldest stable we released recently. This helps with future backports, reducing merge conflicts, while not having any effect on the SemVer considerations, because they aren't user-facing. |
test_proxy_functional.py has a lot of skips, a third of the file is not run in tests currently. |
@Dreamsorcerer here's some more: https://github.com/aio-libs/aiohttp/blob/28b574f/tests/test_proxy_functional.py#L461 — just search Interestingly, they were disabled in #1626 (comment) because a maintainer didn't understand why a contributor added them in the first place (https://github.com/aio-libs/aiohttp/pull/1421/files#diff-be15bec475f6c781d5d3e4413c19d0e24ccaf616b8a2495c6824fc3a16d139f5R120). They were then renamed without re-enabling by another maintainer: https://github.com/aio-libs/aiohttp/pull/2256/files#diff-be15bec475f6c781d5d3e4413c19d0e24ccaf616b8a2495c6824fc3a16d139f5R279. |
@Dreamsorcerer 🤦♂️ I've actually found an issue where I documented this precisely: #6031. |
Yeah, figured you'd looked at them before. I've no plans to look at the proxy stuff, but fixing the currently failing tests on Windows/Mac with Python 3.12 would be the first priority, before looking at these ones. |
Fair, I don't think I'll be looking into them anytime soon. But it's good that they are documented. |
OK, can someone check this, I think the parameter is totally useless and can be removed. aiohttp/aiohttp/http_parser.py Line 377 in 9736477
After passing this check: aiohttp/aiohttp/http_parser.py Lines 359 to 363 in 9736477
The value passed through is then used at the end here: aiohttp/aiohttp/http_parser.py Lines 746 to 762 in 9736477
But, if it passed the check above, then it must not be able to reach the code where the variable is used, if I'm reading that right. |
If correct, it must then be able to be removed from the latter code too, as the only other code that uses that parameter is hardcoded to |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8096 +/- ##
==========================================
+ Coverage 97.54% 97.62% +0.08%
==========================================
Files 107 107
Lines 33093 33080 -13
Branches 3887 3886 -1
==========================================
+ Hits 32282 32296 +14
+ Misses 590 567 -23
+ Partials 221 217 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm not sure how I feel about the removal. On one hand, it's an unused private API. And on the other — |
Another thought: since it's used in some payload tests, they might rely on the underlying buffers being drained automatically or something like that. Could you check? I wouldn't be surprised if this thing exists as a test helper. |
We're removing a parameter called readall, not a method. I think this is also unrelated to streaming APIs, as the parameter is basically just saying "read until EOF when there is no length/chunked specified", which I'm pretty sure is the only sensible (i.e. spec-compliant) approach if the response is not 204 (or similar). The only place where it ever gets set to False is when we've already determined that that the response has a body (i.e. not 204). |
Backport to 3.10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 175954c on top of patchback/backports/3.10/175954c010eb2446fe43c3167cdca671a4079e53/pr-8096 Backporting merged PR #8096 into master
🤖 @patchback |
(cherry picked from commit 175954c)
Here's a test that hasn't been run, ever.